CivicChain is a modern, transparent web application designed to bridge the gap between local governments and citizens. It empowers communities by offering clear, interactive visualizations of municipal budgets, AI-powered financial insights, and a streamlined channel for submitting and tracking civic feedback and local reports.
- 📊 Interactive Budget Explorer: Filter, search, and visualize ward-level budgets by department and year using intuitive summary cards, interactive tables, and charts (Recharts).
- 🧠 AI-Powered Insights: Get citizen-friendly budget summaries, anomaly detection, and cost optimization recommendations powered by AI model queries.
- 📢 Citizen Engagement & Feedback: Report local community issues (e.g., road maintenance, lighting, waste management) with optional image/photo uploads.
- 💾 CSV Budget Importer: Municipal administrators can easily upload new budget sheets via a standard CSV template to keep data up-to-date.
- 🌐 Multi-Language Support: Localized navigation and content support in English, Hindi, Tamil, Telugu, Kannada, and Marathi.
- 🔌 Transparent Offline Fallback: Functions entirely offline out-of-the-box (using simulated database states in
localStorage) if a live database connection is not configured.
- Frontend Framework: React 18, Vite, TypeScript
- Styling & UI: Tailwind CSS, Shadcn UI, Radix UI, Lucide Icons
- Data Visualization: Recharts
- Database & API: Supabase (PostgreSQL, Edge Functions, Row Level Security, Storage buckets)
- State Management & Querying: TanStack React Query
Ensure you have Node.js (v18+) and npm installed on your machine.
- Clone the repository or open the project folder.
- Install dependencies:
npm install
To launch the local development server:
npm run devOpen http://localhost:5173 in your browser.
You can log in with the pre-seeded account citizen@example.com and password password123, or sign up for a new account.
To compile a minified production bundle:
npm run buildTo make installation effortless, CivicChain features a dual-mode database client implemented in src/integrations/supabase/client.ts:
- Offline Sandbox Mode (Default): Runs completely locally. Database queries, authentication states, uploads, and edge functions are simulated inside
localStorage. No database setup, Docker, or external keys are required. - Live Production Mode: Connects to a real, hosted Supabase instance once environment variables are detected.
- Copy the environment template file:
cp .env.example .env
- Open
.envand fill in your Supabase project parameters:VITE_SUPABASE_URL=https://your-project-ref.supabase.co VITE_SUPABASE_ANON_KEY=your-publishable-anon-key
- Restart the local development server (
npm run dev) to apply the connection.
If you connect to a live Supabase database, run the SQL migrations located in supabase/migrations/ to create the required tables. The primary table structures are as follows:
Tracks allocated and used funds per ward department.
CREATE TABLE public.municipal_budget (
id UUID NOT NULL DEFAULT gen_random_uuid() PRIMARY KEY,
account TEXT NOT NULL, -- Department name (e.g. Public Works Department)
account_budget_a TEXT NOT NULL, -- Category description (e.g. Road Repair)
glcode TEXT NOT NULL, -- Financial Year (e.g. 2024)
used_amt NUMERIC NOT NULL, -- Used funds
remaining_amt NUMERIC NOT NULL, -- Remaining funds
budget_a NUMERIC, -- Total allocated funds
file_id UUID REFERENCES public.budget_files(id),
user_id UUID REFERENCES auth.users(id),
created_at TIMESTAMP WITH TIME ZONE DEFAULT now()
);Stores community feedback and reports submitted by citizens.
CREATE TABLE public.citizen_reports (
id UUID NOT NULL DEFAULT gen_random_uuid() PRIMARY KEY,
description TEXT NOT NULL,
category TEXT NOT NULL,
image_urls TEXT[] DEFAULT '{}',
user_id UUID REFERENCES auth.users(id),
created_at TIMESTAMP WITH TIME ZONE DEFAULT now()
);When importing new budget data via the dashboard, upload a .csv file with the following headers:
Ward,Year,Category,Amount
Public Works Department (PWD),2024,Main Road Asphaltation,25000000
Education & Literacy,2024,School Infrastructure,11000000To update your repository at https://github.com/Srijan3412/CivicChain.02.git:
- Stage and commit your changes:
git add . git commit -m "docs: restructure README to focus on CivicChain features and architecture"
- Push to the
mainbranch:git push -u origin main