Production-oriented civic-tech platform backbone for:
- Candidate transparency
- Civic issue reporting
- Identity verification
- Tokenized voting flow
- Blockchain-style audit receipts
apps/web- Next.js citizen-facing web appservices/api-gateway- API gateway and service routingservices/auth-service- registration/login/JWT authservices/candidate-service- candidate transparency APIsservices/manifesto-service- policy intelligence (summaries + comparisons)services/issue-service- issue reporting APIsservices/promise-service- candidate promise tracking and progress APIsservices/identity-service- voter verification + voting token issuanceservices/voting-service- election + vote submission orchestrationservices/blockchain-service- deterministic tx-hash ledger adapterservices/audit-service- vote audit APIspackages/config- shared runtime/env configpackages/types- shared typespackages/utils- shared error/security/runtime utilities
- Node.js 20+
- pnpm (via Corepack)
- Supabase project (or compatible Postgres + Supabase API)
- Install dependencies:
corepack pnpm install- Configure environment:
cp infrastructure/env.template .env
# Fill values in .env- Create schema in Supabase:
- Run
supabase-schema.sqlin the Supabase SQL editor.
- Start services (without Turbo):
corepack pnpm --filter api-gateway dev
corepack pnpm --filter auth-service dev
corepack pnpm --filter candidate-service dev
corepack pnpm --filter manifesto-service dev
corepack pnpm --filter issue-service dev
corepack pnpm --filter promise-service dev
corepack pnpm --filter identity-service dev
corepack pnpm --filter voting-service dev
corepack pnpm --filter blockchain-service dev
corepack pnpm --filter audit-service dev
corepack pnpm --filter web dev- Vercel reads
vercel.jsonat the repo root. Build/Install are set for pnpm and the monorepo. - Set these project env vars in Vercel:
NEXT_PUBLIC_API_URL,NEXT_PUBLIC_REQUEST_TIMEOUT_MS,NEXT_PUBLIC_DEMO_VOTER_ID,NEXT_PUBLIC_DEMO_REPORTER_ID. The@...placeholders invercel.jsonmap to Vercel Project Environment Variables or Secrets. - Output directory is
apps/web/.next; nopublicfolder is required beyond the Next.js defaults.
- Auth:
/auth/register,/auth/login,/auth/me - Candidate transparency:
/candidates,/candidates/search,/candidates/:id - Manifesto intelligence:
/manifestos,/manifestos/compare,/manifestos/:id - Issues:
/issues(GET/POST) - Promise tracker:
/promises,/promises/candidate/:id,/promises/:id/progress - Voting:
/voting/elections,/voting/generate-token,/voting/vote - Identity:
/identity/verify-voter,/identity/generate-voting-token - Audit:
/audit/election/:id,/audit/vote/:hash
All APIs include:
- JSON-schema request validation
- Consistent error payloads
- Security headers
- Graceful shutdown handling
- Health/readiness endpoints
- Set strong
JWT_SECRET(>=32 chars). - Keep
SUPABASE_SERVICE_ROLE_KEYsecret and server-side only. - Set explicit
CORS_ORIGINSper environment. - Put all services behind TLS termination and WAF/rate-limit at ingress.
- Run DB migrations/schema updates via controlled pipeline.