About

What this is

civic.bd is a national civic OS — one platform connecting citizens to every public service. This build is a functional prototype: real database, real workflows, seeded data, no real auth.

What's real here

Database
Postgres with 7 tables, RLS enabled, trigger-driven vote counts and resolution timestamps.
Workflow
Citizen submit → agency queue → ticket lifecycle → public case → vote → metrics recompute.
Roles
Citizen, official, admin — switchable from the header. Stored on profile row.
Analytics
Per district + category: avg resolution hours, satisfaction, total requests.

What's mocked

Authentication
No login. A role switcher in the header impersonates seeded profiles.
NID verification
National IDs are mock strings (NID-MOCK-xxxxxx). No NADRA/EC integration.
AI routing
Requests are routed by the citizen picking the agency. No classifier.
Geo
District is a text field. No map, no GIS layer.
SSO
Not implemented. Production design uses NID-based national SSO.

Path to production

  1. 01 Replace demo switcher with Supabase Auth + NID-bound SSO.
  2. 02 Move all writes behind auth.uid()-scoped RLS and a has_role() SECURITY DEFINER function.
  3. 03 Add AI classifier (Lovable AI Gateway) for category + agency suggestion.
  4. 04 Geo layer — geocode at submit, render heatmap per district.
  5. 05 Procurement transparency module — separate schema, public-by-default.
  6. 06 Pilot in one district. Measure resolution times against baseline.
Built as a single-shot Lovable prototype. No real personal data has been collected.