Brief-Generator - DIN 5008 Letters in the Browser

A browser app that writes German letters to DIN 5008 and prints them so the address fits the envelope window. No accounts, no installation, works offline, and every letter stays in your browser.

JavaScript (ES Modules) IndexedDB WebCrypto Node.js Stripe Brevo nginx Docker Plausible

Write It, Print It, It Fits the Window

Brief-Generator writes German letters to DIN 5008 right in the browser and prints them so the recipient’s address sits in the window of a window envelope (Fensterumschlag). No accounts, no installation, and it works offline.

The Challenge

A formal German letter has a standard layout, and the printout has to match it on paper, not just on screen. The address has to land in the envelope window, fold marks have to sit where the paper gets folded, and a letter that runs onto a second page needs correct page breaks and page numbers.

At the same time, letters tend to carry personal details. Sending them through someone else’s server just to get the layout right is a poor trade.

The Solution

Brief-Generator does the layout in the browser and treats the printout as the product. The test suite prints letters to PDF in real Firefox and Chrome and measures the result. Everything the user writes stays in their own browser. A one-time Pro licence is verified offline, so the app never needs to know who its users are.

Key Features

  • Window-ready printing: Laid out to DIN 5008 so the address fits the window of a window envelope, with fold marks on the page
  • Multi-page letters: Correct page breaks and “Seite x von y” page numbers; on-screen page guides show where the printed breaks will fall
  • Signatures: Drawn, typed in a script font, or scanned
  • Sender profiles and logo: Reusable sender details, plus a logo in Pro
  • Backup file: Export and import all letters, signatures and profiles
  • Offline, no installation: Runs in the browser, keeps working without a connection
  • Private by design: No accounts; letters, signatures and profiles live in IndexedDB and never reach the server

Technical Implementation

Front End:

  • Plain ES modules, no framework, no build step, no runtime dependencies
  • Letters, signatures and profiles stored locally in IndexedDB
  • Strict Content Security Policy: no inline scripts, no third-party origins

Print Testing:

  • The test suite prints letters to PDF in real Firefox and Chrome
  • Word positions in the address and header area are checked against a reference PDF to within ±0.5 mm
  • The logo box is located from rasterized pixels
  • On-screen page guides are checked against where the printed page breaks actually fall
  • Firefox is the reference browser; Chrome honors orphans/widows, so its page breaks can differ

Licensing Without Accounts:

  • Free for up to 3 saved letters, 1 signature and 1 sender profile; Pro is a €19 one-time purchase for unlimited letters, signatures and profiles plus the logo
  • Stripe Payment Link → webhook → a small Node server signs a licence key (ECDSA P-256) and emails it via Brevo
  • The app verifies the signature offline with WebCrypto against its bundled public key
  • No database: Stripe is the record

Deployment & Analytics:

  • Static site served by nginx, containerized with Docker and deployed via Dokploy
  • Cookie-free, self-hosted Plausible analytics

Why It Matters

  • Checked on paper, not on screen: Layout is verified against real PDF output from real browsers, not just the DOM
  • Data stays with the user: No account and no server-side storage of letters or signatures
  • Pay once: €19 one-time instead of a subscription
  • Small surface: No framework, no dependencies, no third-party scripts