Skip to content

JonasGroeger/brieffenster-generator

Repository files navigation

Brieffenster-Generator

Sometimes, you just need the header.

Screenshots

WebUI

Screenshot

The generated PDF

Generated Briefkopf

Run

Using Docker (recommended)

  1. Create a .env file with your SECRET_KEY:
    cp .env.example .env
    # Edit .env and set a strong SECRET_KEY
  2. Build and run:
    docker compose up --build
  3. Go to the frontend

Development (without Docker)

  1. Create a .env file:
    cp .env.example .env
    # Edit .env and set a strong SECRET_KEY
  2. Install dependencies:
    uv sync
  3. Run the development server:
    uv run --env-file .env python -m brieffenster_generator.app
  4. Go to the frontend (default Flask port)

Form Validation

The application validates all required fields on the server side. Client-side validation (HTML5 required attributes) is included for user convenience, but all validation is performed server-side for security.

Optional: Automation

The PDF generation can be automated using a HTTP POST request with curl:

curl -X POST 'http://localhost:10000/generate/' \
    -F "abs_name=Erika Mustermann" \
    -F "abs_street=Heidestraße 1" \
    -F "abs_city=51477 Köln" \
    -F "empf_name=Bundeskanzleramt" \
    -F "empf_street=Willy-Brand-Straße 1" \
    -F "empf_city=10577 Berlin" \
    --output Briefkopf.pdf

All form fields are required. Missing or empty fields will result in a 400 error response.

License

This project is licensed under the MIT License. See LICENSE.md

About

Creates a PDF with a letter window (+ contents you specify) only

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors