Skip to content

Repository files navigation

Letter Builder — نامه‌ساز

A free, fully client-side web app for designing and exporting professional corporate letters in Persian (RTL) and English (LTR).
No backend. No sign-up. Everything runs in the browser.

🌐 Live Demo  ·  Demo license key: OPEND-EMO20-26LTR-BLDR0


Features

📄 Live A4 Preview Every change reflects instantly on the page
📥 PDF Export High-quality output with correct Persian font rendering
🔄 RTL ↔ LTR Toggle Full direction switch — layout, labels and alignment all reverse
🖼️ Logo Upload Drag-and-drop (JPG, PNG, WebP, SVG — max 2 MB)
✍️ Rich Text Editor Bold, italic, underline, headings, lists, tables, images, text color
📅 Jalali Date Picker Shamsi calendar for Persian letters
📂 Template System Save / load / delete letter templates stored in the browser
💾 JSON Import / Export Transfer all settings between devices
🌙 Dark / Light Mode Full theme support
🔢 Auto Letter Number Jalali year + auto-incrementing counter (1405/آ/01)
🔐 License Gate Optional soft-lock — easily customizable (see below)

Getting Started

git clone https://github.com/Alirewa/Letter-Builder.git
cd Letter-Builder
npm install
npm run dev

Open http://localhost:3000

Note: The app uses B Nazanin for Persian text. Place BNazanin.ttf and BNazaninBold.ttf in public/fonts/ — this font is not redistributable and must be obtained separately.


Customizing the License Key

The license gate is a client-side soft-lock defined in src/lib/license.ts.
To set your own key, edit the VALID_CODE constant:

// src/lib/license.ts
const VALID_CODE = 'YOURKEY0000000000000'; // exactly 20 alphanumeric chars

Rules:

  • Exactly 20 alphanumeric characters (A–Z, 0–9, case-insensitive)
  • Dashes are stripped automatically — users can enter XXXXX-XXXXX-XXXXX-XXXXX or without dashes
  • The gate is wired into src/app/layout.tsx by default (<LicenseGate>{children}</LicenseGate>). The unlock state is stored in localStorage, so it's only asked once per browser
  • To disable the gate entirely, remove the <LicenseGate> wrapper in src/app/layout.tsx and render {children} directly

Build & Deploy

npm run build   # outputs to /out — ready for any static host

GitHub Pages deploys automatically via the included Actions workflow on every push to master.


Tech Stack

Tool Purpose
Next.js 16 (static export) Framework
React 19 + TypeScript 5 UI & type safety
Tailwind CSS v4 Styling
Zustand 5 State management with localStorage persistence
TipTap Rich text editor
react-multi-date-picker Jalali calendar
html2canvas + jsPDF PDF generation

License

MIT — free to use, modify, and distribute.


Designed & built by @Alirewa

About

A free, fully client-side web app for designing and exporting professional corporate letters in Persian (RTL) and English (LTR). No backend. No sign-up. Everything runs in the browser.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages