ProjectsSurat WargaLive
Surat Warga

Surat Warga

Getting an RT/RW letter usually means finding the right person at home, twice. The interesting part of the build is the template: an admin uploads a DOCX, the app scans it for placeholders, and those placeholders become the exact fields a resident has to fill in, so adding a new kind of letter needs no code change.

What it does

  • Template CRUD that auto-scans the DOCX for placeholders.
  • Request forms generated from whichever template the resident picks.
  • Approve / reject flow with letter numbering and a status trail.
  • Finished documents kept in a private bucket, handed out via signed URLs.

How it fits together

  1. Step 1TemplateAdmin uploads a DOCX; placeholders are scanned
  2. Step 2RequestResident fills the generated form
  3. Step 3ReviewAdmin approves and the letter is numbered
  4. Step 4DocumentDOCX rendered, stored privately, signed link issued

Diagrams

How the product behaves, and how the pieces behind it talk to each other.

Business flow
Business flow diagram for Surat Warga
System flow
System flow diagram for Surat Warga

Stack

App
Next.js 16 (App Router, SSR)TypeScript
UI
Tailwind CSS v4shadcn/ui
Data
Supabase PostgreSQLDrizzle ORM
Auth & files
Supabase Auth + role guardSupabase Storage
Documents
docx-templatesmammoth

Worth noting

  • Placeholders are read out of the DOCX itself, so adding a letter type is an upload, not a deploy.
  • Finished letters sit in a private bucket; every download is a short-lived signed URL.
  • Role rules are enforced on the server, not just hidden in the interface.

Next up

  • Resident flow: pick a template, fill the generated form, track the request.
  • Download the approved letter as a PDF.
Generating0%