CASE STUDYFull-stack web app · AI

CGCP

A platform that connects citizens with government services in Bangladesh.

Live demo
Next.jsPostgreSQLGemini APITypeScriptSupabase-OAuthSupabaseLeaflet.jsOpenStreetMap
01

Screenshots

02

The problem

Reporting a local issue to the right authority is slow and opaque. CGCP lets citizens report issues directly, verifies each report with AI, tracks it publicly and routes it through a structured workflow to the right department.
03

What it does

  • 01Report submission with photo / video evidence, anonymous and emergency options
  • 02AI image verification (Google Gemini) checks the media matches the reported category
  • 03Real-time status tracking, upvotes on community reports and in-app notifications
  • 04AI law chatbot with voice input / output for accessibility
  • 05Role-based dashboards for Admin, Police, Urban Local, Fire Service, Health and Education
  • 06Public transparency dashboard — no login needed
  • 07Interactive map with search, routing, nearby reports and a crime heatmap
  • 08Direct 1-to-1 chat between a citizen and department staff
04

How it works

  1. 1

    A citizen submits a report with evidence.

  2. 2

    Gemini checks whether the image matches the chosen category and returns a confidence score.

  3. 3

    The report is assigned to the right department.

  4. 4

    Department staff update the status with notes; the citizen is notified at each change.

  5. 5

    Resolved and open reports feed the public statistics dashboard.

05

Engineering decisions

  • Law chatbot uses RAG: laws from minlaw.gov.bd are stored as pgvector embeddings and passed to Groq as context.
  • Server-side Zod validation on all actions; Row Level Security on every Supabase table.
  • Login is rate limited (5 attempts / 15 min) and protected against credential enumeration.
  • Role checks happen in middleware, not just in the UI.
06

Tech stack

Frontend
Next.js (App Router), TypeScript
Styling
Tailwind CSS, shadcn/ui
Auth + DB
Supabase (Email + Google OAuth, PostgreSQL, pgvector)
AI
Google Gemini (image verification), Groq Llama 3 (chatbot)
Maps
Leaflet.js + React-Leaflet, OpenStreetMap
Rate limiting
Upstash Redis (sliding window)
Forms
React Hook Form + Zod
Deployment
Vercel
  • A weather widget is built but not yet mounted to a route.
  • The exam-results page is referenced but not built yet.