Spaces:
Sleeping
Sleeping
Remove auto-generated README
Browse files
Downloads/hackathon/civicai/README.md
DELETED
|
@@ -1,116 +0,0 @@
|
|
| 1 |
-
# CivicAI β GenAI Citizen Complaint Summarizer
|
| 2 |
-
|
| 3 |
-
> National Hackathon Project Β· Built with React.js + Next.js + Claude API + Supabase
|
| 4 |
-
|
| 5 |
-
AI-powered platform that transforms unstructured citizen complaints into structured, actionable reports for government authorities β with multilingual support, voice input, real-time dashboards, and automated critical alerts.
|
| 6 |
-
|
| 7 |
-
---
|
| 8 |
-
|
| 9 |
-
## Setup in 5 steps
|
| 10 |
-
|
| 11 |
-
### Step 1 β Install dependencies
|
| 12 |
-
```bash
|
| 13 |
-
npm install
|
| 14 |
-
```
|
| 15 |
-
|
| 16 |
-
### Step 2 β Fill in API keys
|
| 17 |
-
Open `.env.local` and replace each placeholder with your real key:
|
| 18 |
-
|
| 19 |
-
```env
|
| 20 |
-
ANTHROPIC_API_KEY=sk-ant-... # console.anthropic.com
|
| 21 |
-
OPENAI_API_KEY=sk-proj-... # platform.openai.com
|
| 22 |
-
NEXT_PUBLIC_SUPABASE_URL=https://xxxx.supabase.co
|
| 23 |
-
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ...
|
| 24 |
-
SENDGRID_API_KEY=SG.... # sendgrid.com
|
| 25 |
-
ALERT_EMAIL=youremail@gmail.com
|
| 26 |
-
LOCATIONIQ_KEY=pk.... # locationiq.com
|
| 27 |
-
NEXT_PUBLIC_BASE_URL=http://localhost:3000
|
| 28 |
-
```
|
| 29 |
-
|
| 30 |
-
### Step 3 β Create Supabase table
|
| 31 |
-
Go to supabase.com β your project β SQL Editor β run:
|
| 32 |
-
|
| 33 |
-
```sql
|
| 34 |
-
create table complaints (
|
| 35 |
-
id uuid primary key default gen_random_uuid(),
|
| 36 |
-
raw_text text,
|
| 37 |
-
language text,
|
| 38 |
-
summary text,
|
| 39 |
-
department text,
|
| 40 |
-
urgency text,
|
| 41 |
-
action_items jsonb,
|
| 42 |
-
location text,
|
| 43 |
-
estimated_resolution text,
|
| 44 |
-
language_detected text,
|
| 45 |
-
status text default 'pending',
|
| 46 |
-
created_at timestamptz default now()
|
| 47 |
-
);
|
| 48 |
-
```
|
| 49 |
-
|
| 50 |
-
### Step 4 β Run locally
|
| 51 |
-
```bash
|
| 52 |
-
npm run dev
|
| 53 |
-
```
|
| 54 |
-
- Citizen portal: http://localhost:3000
|
| 55 |
-
- Authority dashboard: http://localhost:3000/dashboard
|
| 56 |
-
|
| 57 |
-
### Step 5 β Deploy to Vercel
|
| 58 |
-
```bash
|
| 59 |
-
npx vercel
|
| 60 |
-
```
|
| 61 |
-
Add all `.env.local` variables in Vercel β Settings β Environment Variables.
|
| 62 |
-
Change `NEXT_PUBLIC_BASE_URL` to your Vercel URL after deploying.
|
| 63 |
-
|
| 64 |
-
---
|
| 65 |
-
|
| 66 |
-
## Project structure
|
| 67 |
-
|
| 68 |
-
```
|
| 69 |
-
civicai/
|
| 70 |
-
βββ pages/
|
| 71 |
-
β βββ index.jsx Citizen portal (submit + track)
|
| 72 |
-
β βββ dashboard.jsx Authority dashboard (charts + table)
|
| 73 |
-
β βββ api/
|
| 74 |
-
β βββ process.js Claude AI engine
|
| 75 |
-
β βββ transcribe.js Whisper voice-to-text
|
| 76 |
-
β βββ alert.js SendGrid critical alerts
|
| 77 |
-
β βββ status.js Complaint status check
|
| 78 |
-
βββ lib/
|
| 79 |
-
β βββ supabase.js
|
| 80 |
-
βββ styles/
|
| 81 |
-
β βββ globals.css
|
| 82 |
-
βββ .env.local API keys (never commit!)
|
| 83 |
-
βββ .gitignore
|
| 84 |
-
βββ README.md
|
| 85 |
-
```
|
| 86 |
-
|
| 87 |
-
---
|
| 88 |
-
|
| 89 |
-
## GitHub upload (for hackathon submission)
|
| 90 |
-
|
| 91 |
-
```bash
|
| 92 |
-
# Inside the civicai folder:
|
| 93 |
-
git init
|
| 94 |
-
git add .
|
| 95 |
-
git commit -m "Initial commit β CivicAI hackathon project"
|
| 96 |
-
|
| 97 |
-
# Create a new repo on github.com, then:
|
| 98 |
-
git remote add origin https://github.com/YOUR_USERNAME/civicai.git
|
| 99 |
-
git branch -M main
|
| 100 |
-
git push -u origin main
|
| 101 |
-
```
|
| 102 |
-
|
| 103 |
-
IMPORTANT: `.env.local` is in `.gitignore` so your API keys will NOT be uploaded.
|
| 104 |
-
Add your keys manually in Vercel environment variables for deployment.
|
| 105 |
-
|
| 106 |
-
---
|
| 107 |
-
|
| 108 |
-
## Free API tiers
|
| 109 |
-
|
| 110 |
-
| API | Free tier | Sign up |
|
| 111 |
-
|-----|-----------|---------|
|
| 112 |
-
| Claude API | $5 credits | console.anthropic.com |
|
| 113 |
-
| Whisper | $5 credits (~$0.006/min) | platform.openai.com |
|
| 114 |
-
| Supabase | 500MB DB free | supabase.com |
|
| 115 |
-
| SendGrid | 100 emails/day free | sendgrid.com |
|
| 116 |
-
| LocationIQ | 5,000 req/day free | locationiq.com |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|