andhbhakt README

The project's README from github.com/JCRYDER3/andhbhakt. As one markdown file: README.md.

Andhbhakt.org

A civic accountability platform that cross-references official government announcements against Comptroller and Auditor General (CAG) audit findings — so citizens can see the gap between political promises and ground reality.

Live site: andhbhakt.org


What it does

Stack

Layer Tech
Monorepo pnpm workspaces
Runtime Node.js 24, TypeScript 5.9
API Express 5 (artifacts/api-server)
Frontend React 19 + Vite + Tailwind CSS (artifacts/govlens)
Database PostgreSQL + Drizzle ORM (lib/db)
Validation Zod v4 + drizzle-zod (lib/api-zod)
API codegen Orval — OpenAPI spec → typed hooks + Zod schemas (lib/api-spec)
Bot protection Cloudflare Turnstile + HMAC-signed session cookie

Quick start

# Requires pnpm — https://pnpm.io
pnpm install

# Copy env vars and fill in your values
cp .env.example .env

# Create tables
pnpm --filter @workspace/db run push

# Load seed data (schemes, CAG audits, PIB entries — ~800 rows)
psql "$DATABASE_URL" -f lib/db/seed.sql

# Start the API server (port from $PORT env var)
pnpm --filter @workspace/api-server run dev

# Start the frontend (separate terminal)
pnpm --filter @workspace/govlens run dev

Environment variables

See .env.example for the full list. Minimum required:

Variable When Description
DATABASE_URL Always PostgreSQL connection string
PORT Always API server port (Replit sets this automatically)
SESSION_SECRET Production 64-char hex — signs session cookies. Generate: openssl rand -hex 32
ADMIN_TOKEN Production Token for /api/admin/* routes (X-Admin-Token header)
TURNSTILE_SECRET_KEY Production Cloudflare Turnstile bot-check secret
ALLOWED_ORIGIN Production CORS origin (e.g. https://govlens.in)

Where things live

artifacts/
  api-server/src/
    routes/          Express route handlers
    middlewares/     Auth, rate-limiting, cache, session
    jobs/            Background jobs (news fetcher)
  govlens/src/
    pages/           Frontend page components
    data/            Static civic data — schemes, state facts, ministers, manifestos, CAG reports
lib/
  db/                Drizzle schema + migrations
  api-zod/           Auto-generated Zod schemas
  api-spec/          OpenAPI 3.1 spec (openapi.yaml)

Architecture decisions

Static data in source files — scheme details, state facts, minister profiles, manifesto promises, and CAG report narratives live as TypeScript constants in artifacts/govlens/src/data/. This makes every data point auditable, diff-able, and contribution-friendly without a CMS. Only dynamic data (live PIB entries, CAG audit records, news) lives in the database.

Session cookie, not JWT — The Turnstile gate issues an HMAC-signed cookie. The server refuses to start in production without SESSION_SECRET.

Cloudflare in front — Production traffic passes through Cloudflare Turnstile + CF-Connecting-IP check + optional origin secret (CF_ORIGIN_SECRET). The cloudflareOnlyMiddleware is a no-op in development.

Admin via header only — X-Admin-Token is the only valid admin auth mechanism. Query-string tokens are rejected (they appear in server logs and browser history).

Data sources

All civic data is sourced from public documents:

Contributing

  1. Fork the repo and clone locally.
  2. Copy .env.example → .env and fill in DATABASE_URL, SESSION_SECRET, and ADMIN_TOKEN.
  3. Run pnpm install then pnpm --filter @workspace/db run push.
  4. Data corrections go in artifacts/govlens/src/data/ — each file has inline source citations.
  5. Open a PR with the source URL for any data change.

License

MIT

andhbhakt (JCRYDER3/andhbhakt)

Searching Database…

What is this?Andhbhakt.org is a civic accountability platform that cross-references official Indian government announcements (PIB) against CAG audit findings and independent survey data to show the gap between political promises and ground reality.
Is this a live website or something I install and run myself?It is primarily a live website (andhbhakt.org), but the full source is a pnpm monorepo with an Express API and a React + Vite + Tailwind frontend that you can also self-host.
How do I run the project locally?Fork/clone the repo, copy .env.example to .env with DATABASE_URL, SESSION_SECRET and ADMIN_TOKEN, then run pnpm install followed by the DB push script.
What do I need before running it?Node.js 24, pnpm (enforced by a preinstall check), and a PostgreSQL database connection string are required at minimum; production deployments also need a 64-char SESSION_SECRET and a Cloudflare Turnstile secret key.
What's the main gotcha when deploying this?The server refuses to boot in production unless SESSION_SECRET is set, and admin routes only accept the X-Admin-Token header — query-string tokens are explicitly rejected because they leak into logs and browser history.
Who is this site aimed at?Indian citizens, journalists, and researchers tracking government scheme delivery and state governance, since the data and UI are bilingual with full Hindi translation.
How are the scheme scorecards built?Each major government scheme since 2014 is rated against PIB press releases, CAG audit findings, and independent datasets like NFHS-5, NCRB, MOSPI, and ASER.
What is the Manifesto tracker?It maps promises from the 2014, 2019, and 2024 election manifestos term-by-term against actual delivery evidence.
Where does the civic data come from?Public documents: ECI affidavits via ADR/myneta.info, CAG reports from cag.gov.in, PIB press releases from pib.gov.in, and national survey data (NFHS-5, NCRB, MOSPI, ASER).
How is the data kept trustworthy and editable?Static data like scheme details, state facts, and minister profiles lives as TypeScript constants with inline source citations instead of a CMS, so every data point is diffable and contribution-friendly via pull requests.
Creator
JCRYDER3
Size
9.2 MB
Stars
151
Updated
CommitAug 13
Age
2mo
Commits · 90 Days