Skip to content

DevanTQ/developmentweb

Repository files navigation

⚖️ WitnessChain

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

Next.js Gemini Supabase Tailwind CSS


About

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.


Features

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

Tech Stack

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
PDF jsPDF
Maps Google Maps Embed API

Getting Started

1. Clone & Install

git clone https://github.com/username/witnesschain.git
cd witnesschain
npm install

2. Environment Variables

Create 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.local to your repository. It is already included in .gitignore.

3. Database Setup

# Using Supabase CLI
npx supabase db push

# Or manually: copy and run the contents of supabase/schema.sql in the Supabase SQL Editor

4. Run the Development Server

npm run dev

Open http://localhost:3000 in your browser.


Project Structure

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

About #JuaraVibeCoding

#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.


Disclaimer

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

Packages

 
 
 

Contributors

Languages