How openai/democratic-inputs works
Project type and purpose
• This is a “meta-project” or monorepo: an umbrella repository that houses ten different grant-funded subprojects, each with its own codebase (web apps, data pipelines, docs, notebooks, backends, etc.).
• The root README is purely an index of projects; each project folder (e.g. “Aligned-Platform-EnergizeAI”, “deliberation_at_scale”, “case_law_for_ai_policy”, etc.) is self-contained and implements its own architecture.
File structure
• Top-level:
• README.md – table of contents pointing to each project
• /projects – container for ten independent subdirectories
• Each /projects/<project> usually follows one of these patterns:
• Full-stack Next.js or Remix web application (e.g. Aligned-Platform-EnergizeAI, democratic_fine_tuning, inclusive_ai…)
• Serverless or Firebase functions + hosting (rappler_aidialogue)
• Pure frontend React/Vite app (Ubuntu_AI)
• Python/Jupyter notebooks and scripts (case_law_for_ai_policy, collective_dialogues_for_democratic_input, taxonomybuilder)
• Polyrepo (Nx) micro-monorepo with data layer, edge-functions, frontend, orchestrator services (deliberation_at_scale)
• Look for:
• package.json, tsconfig.json, bun.lock or pnpm-lock – indicates a JS/TS app
• /src, /app, /pages, /components – Next.js or React structure
• /functions, /hosting – Firebase serverless
• /migrations, /schema.prisma – database schema and migrations
• .ipynb, .py – Jupyter notebooks and Python scripts
• docs, public, assets – static documentation or assets
Extract insights from each subproject’s README
• Often describes the stack (e.g. “Next.js 13 + Supabase + Graphile”, “Remix + Prisma + Tailwind”, “Vite + Firebase”, “FastAPI or Flask backend + React frontend”)
• May mention external services: OpenAI API, Supabase, Firebase, Web3Auth, GraphQL endpoint, Sentry, Whereby, etc.
a. Main components (at two levels):
– Frontend (React/Next.js/Remix/Vite)
– Backend/API (Node.js/Edge functions/Firebase functions/Python server)
– Database/Data store (Postgres via Drizzle/Prisma, Supabase, Firestore, local CSV or JSON, Jupyter data files)
– Batch jobs, notebooks or ETL scripts (Python notebooks, migrations, taxonomy builder)
– External services (OpenAI API, Web3Auth, Whereby video calls, Supabase Realtime, Graphile Worker, Sentry)
b. Component relationships
c. Architectural patterns & design principles
• Monorepo, but no shared code cross-project (each has its own package.json)
• Separation of concerns: UI / business logic / data / docs
• Use of serverless functions for scalability and low-maintenance compute
• Event-driven or job-queue patterns in “deliberation_at_scale” orchestrator
• Client-heavy apps (Jupyter notebooks and React UIs) coupled to lightweight backends
d. Key technologies & frameworks
• Next.js, Remix, Vite, React
• Firebase Hosting & Functions, Supabase, Drizzle ORM, Prisma
• Jupyter, Python scripts, CSV/JSON data
• GraphQL (codegen, graphql.tsx), Apollo or SWR clients
• Tailwind CSS, PostCSS
• Web3Auth, ERC-20 contracts (Inclusive.AI)
• OpenAI API calls (energize-engine, chatgpt.js)
• Orchestrator: Node.js + graphile-worker + Supabase + Sentry + Whereby
• Blue = frontend/UI
• Green = backend/API
• Orange = database/data store
• Purple = external services/APIs
• Gray = batch jobs/notebooks