A digital evidence documentation platform for victims of forced evictions, land disputes, and civil rights violations in Indonesia.
Built for #JuaraVibeCoding | a Google for Developers event · Code Less, Build More
WitnessChain helps citizens facing rights violations document their cases digitally — free, no login required, in under 30 minutes — and produces a legally-formatted document ready to be submitted to a legal aid organization (LBH).
Users simply describe what happened through an AI chat interface. The system automatically extracts key facts, calculates case completeness, and generates a digitally-signed PDF that can be used as initial evidence.
| Feature | Description |
|---|---|
| 🤖 AI Interview | Guided chat with Gemini 2.5 Flash that empathetically walks users through fact-gathering |
| 📄 Document Generation | Professional PDF output with SHA-256 hash verification for each piece of evidence |
| ⚖️ Legal Radar | AI analysis of potentially violated articles and recommended legal steps |
| 🗺️ LBH Referral | Interactive map of 19 legal aid organizations across Indonesia with specialization filters |
| 🛡️ Admin Dashboard | Case management with bulk selection, bulk deletion, and statistics overview |
| Layer | Detail |
|---|---|
| Framework | Next.js 15 (App Router) |
| AI | Google Gemini 2.5 Flash via Vertex AI |
| Database & Storage | Supabase (PostgreSQL + Storage Buckets) |
| Styling | Tailwind CSS v4 |
| jsPDF | |
| Maps | Google Maps Embed API |
git clone https://github.com/username/witnesschain.git
cd witnesschain
npm installCreate a .env.local file at the project root:
# Google Cloud / Gemini
GOOGLE_APPLICATION_CREDENTIALS=./service-account.json
GOOGLE_PROJECT_ID=your-project-id
GOOGLE_LOCATION=global
GEMINI_MODEL=gemini-2.5-flash
GEMINI_API_KEY=your-gemini-api-key
# Supabase
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
# Google Maps
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your-maps-api-key
⚠️ Never commit.env.localto your repository. It is already included in.gitignore.
# Using Supabase CLI
npx supabase db push
# Or manually: copy and run the contents of supabase/schema.sql in the Supabase SQL Editornpm run devOpen http://localhost:3000 in your browser.
witnesschain/
├── app/
│ ├── api/ # Route handlers (interview, cases, document, legal-radar)
│ ├── interview/ # AI chat interview page
│ ├── result/[id]/ # Case result & PDF download page
│ ├── legal-radar/ # AI legal analysis page
│ ├── referral/ # LBH map & directory page
│ ├── admin/ # Admin dashboard
│ └── page.tsx # Landing page
├── components/
│ ├── ui/ # Reusable UI components (Button, Badge, Card, etc.)
│ ├── interview/ # ChatBubble, EvidenceUpload, ProgressTracker, etc.
│ └── ...
├── lib/
│ ├── gemini.ts # Gemini AI client & helpers
│ ├── supabase.ts # Supabase clients (anon + admin)
│ ├── pdf.ts # PDF generation
│ └── maps.ts # Maps & distance calculation helpers
├── types/index.ts # TypeScript type definitions
├── data/lbh.json # Static data for 19 LBH organizations
└── supabase/schema.sql # Database schema
#JuaraVibeCoding is a Google for Developers program that invites everyone, regardless of coding background, to build real applications using AI.
"Your ideas are the only 'code' you need."
WitnessChain was built as part of this program as a demonstration that vibe coding can produce tools with genuine social impact.
Documents generated by WitnessChain are not a substitute for consultation with a lawyer or legal aid organization. This platform assists with initial documentation only and does not provide formal legal advice.
Made with ❤️ for #JuaraVibeCoding by Google for Developers