Build Checklist
SINGLE SOURCE OF TRUTH. Process rule: 1. This checklist is updated on EVERY task — tick
[x]with a one-line note the moment a task is done. 2. An orchestrator agent reads this file top-to-bottom, picks the next unchecked[ ]task, plans + executes it, ticks it, then moves to the next. 3. After editing this file (or any doc), re-runpython3 /var/www/udhaar-khata/tools/build_docs_site.pyso the live HTML site reflects the change. 4. Pause and report before any irreversible/credential decision; never touch unrelated services; back up before destructive edits.
Last updated: 2026-11-17 (Phase 6 app icon + Play-ready AAB shipped)
Phase 0 — Docs ✅
- [x] PRD
- [x] Architecture
- [x] Database schema
- [x] API spec
- [x] UI/UX spec
- [x] Dev plan
- [x] This checklist
- [x] Docs published as browsable HTML screens (udhaar.itsmehere.com)
Phase 1 — Backend (Node/Express + PG) ✅
- [x] Project init (express, pg, jwt, dotenv, helmet, rate-limit, zod)
- [x] .env.example + config loader
- [x] DB migration script (all tables)
- [x] DB pool + parameterized query helper
- [x] JWT middleware (shop_id from token, HS256 pinned)
- [x] Auth: send-otp (hashed OTP, rate-limit, lockout) + verify-otp (create shop, JWT)
- [x] WhatsApp sender module (getaseed reuse; OTP live, reminder template TODO)
- [x] Customers CRUD (+ computed balance, search, sort)
- [x] Entries CRUD (credit/payment, positive amounts)
- [x] Summary endpoint (outstanding + collected-this-month, deleted-safe)
- [x] Reminder endpoint (log + WA, inert until template approved)
- [x] Sync endpoint (idempotent by op_id, atomic claim)
- [x] Input validation on every route
- [x] Error handler + 404 + helmet
- [x] README + run instructions
Phase 2 — Flutter app ✅
- [x] Project init, Material 3 theme + tokens (Mukta font, money colors), dark mode
- [x] Models + money formatting (paise → ₹, no float)
- [x] API client (Dio) + secure JWT storage
- [x] Offline: sqflite cache + outbox + sync service (UUID-string ids)
- [x] Auth screens (phone → OTP)
- [x] Home dashboard (summary card, list, search, sort, FAB)
- [x] Customer detail (ledger timeline, balance, call + remind)
- [x] Entry bottom sheet (numeric keypad, note, date)
- [x] Add/Edit customer
- [x] Reminder preview + send (wa.me)
- [x] Settings (shop/owner, logout)
- [x] Empty/loading/error states
- [x]
flutter analyzeclean + 7 unit tests pass
Phase 3 — Review ✅
- [x] Correctness + security review (tenant isolation, SQL, money, OTP)
- [x] Ponytail over-engineering review
- [x] Fix blockers: sync contract, sync idempotency, swapped-param UPDATE, summary deleted/future
- [x] Re-verify fixes end-to-end (idempotent replay, balance correct, deleted-safe summary)
Phase 4 — Deploy + APK ✅
- [x] Production
.envon server (generate strong JWT_SECRET; set DB password; NODE_ENV=production; OTP debug off) — set NODE_ENV=production, OTP_DEBUG_RETURN=false; kept existing 48-byte JWT_SECRET and working DATABASE_URL; chmod 600 - [x] Decide + wire WhatsApp OTP sender (getaseed token/brand) — OTP must deliver for login (credential decision — confirm before using a shared sender) — reused user's getaseed single-sender (token from vaidyasaarthi); phone_id 1145303868662933, template login_otp, brand "Udhaar Khata"; pre-approved/reversible
- [x] systemd service
udhaar-backend(port 8042) enabled + running — created /etc/systemd/system/udhaar-backend.service (User=root, HOME=/root, Restart=always); enabled+started; localhost:8042/health → {"ok":true} - [x] Apache vhost
api.udhaar.itsmehere.comreverse-proxy → 127.0.0.1:8042 — NOTE: nginx (not Apache) fronts 80/443 on this host; created nginx vhost → 127.0.0.1:8042 instead; nginx -t OK, reloaded, http health → {"ok":true} - [x] certbot SSL for api.udhaar.itsmehere.com (--nginx/apache, --redirect) + clean reload — certbot --nginx issued cert (expires 2027-02-14, auto-renew); nginx -t OK, reloaded; https health → {"ok":true}, http 301→https
- [x] Smoke test over HTTPS (health → send-otp → verify → customer → entry → balance) — minted JWT for existing shop; sync customer.create+entry.create → balance ₹100; idempotent replay = duplicate (no double-apply); summary +10000 then restored after cleanup; send-otp → {ok:true}. FIX: added NODE_OPTIONS=--dns-result-order=ipv4first (undici IPv6 stall blocked OTP). Note: auth path is /auth not /api/auth
- [x] Set Flutter
Config.apiBaseUrlto https://api.udhaar.itsmehere.com — already set in lib/config.dart; verified client uses /auth/send-otp + /auth/verify-otp against this base - [x] Build Flutter APK (release) — flutter build apk --release OK (51 MB), base URL = https://api.udhaar.itsmehere.com
- [x] Host APK on telegram.itsmehere.com + add download link to docs site — udhaar-khata.apk hosted (HTTP 200); download link added to every docs screen
- [x] Final report: live API URL + APK link + what remains — API https://api.udhaar.itsmehere.com (live, SSL); APK https://udhaar.itsmehere.com/udhaar-khata.apk
Phase 5 — WhatsApp (wa-hub) + templates + notifications ✅
- [x] Migrate OTP + all WA off getaseed to wa-hub (plain text) — tested live, delivered
- [x] Central template store
wa_templates(DB) — editable, seeded once, {{var}} render - [x] OTP + reminder + udhaar_added + payment_received + welcome templates
- [x] Auto customer notification on every entry (udhaar/payment) — fire-and-forget, NOTIFY_ON_ENTRY toggle; tested live
- [x] Manual reminder uses template + shop name
- [x] GET /api/templates to view templates
- [x] Shared wa-hub token at /root/.config/wa-hub.env (one place for all apps)
- [x] Auto-reminder job + systemd timer installed, DISABLED by default (AUTO_REMINDERS_ENABLED opt-in)
- [x] Docs: WHATSAPP.md + site rebuilt
Phase 6 — App icon + Play Store release ✅
- [x] App icon designed (indigo ₹ monogram) — full, adaptive foreground, 512 hi-res, feature graphic
- [x] Launcher + adaptive icons generated into the app (flutter_launcher_icons, bg #4f46e5)
- [x] Upload keystore created + release signing wired (key.properties, gitignored; secrets root-only)
- [x] Signed AAB built (app-release.aab, CN=Udhaar Khata) — the Play upload artifact
- [x] Signed release APK rebuilt (v2 scheme verified) with new icon — direct install
- [x] Play assets hosted: icon-512, feature-1024x500; privacy policy page live
- [x] Store listing text + data-safety answers + publish steps (PLAY-STORE doc)
- [ ] Phone screenshots (2+) — capture on a real device; can't be auto-generated as genuine captures
- [ ] Create Play Console app + upload AAB + fill listing (user action, needs Play Developer account)