a free non-partisan and open-source political knowledge base for the United States
Dev Setup instructions
Thanks for your interest in contributing! Here's how to get started. The app is split into 3 parts:
- Frontend (/apps/web) - a typical react setup with vite
- Job Runner (/apps/server) - The frontend does not talk to this, this is essentially just a node service that runs cron jobs to fill the database. The frontend does not rely on this being up and running, only run this if you want to continue populating your local database.
- Database (/apps/database) - we use this as a Backend-as-a-service. The front end reads directly with the anon key from the database. There are no users to consider, everything currently is read-only.
Steps for setting up Database
Install supabase globally, https://supabase.com/docs/guides/local-development/cli/getting-started
- cd into /apps/database
- run
supabase start - take note of the
anon keyandservice_role keyandapi_urlfor the.envfile we will need to make - run
supabase db reset - Your database should be seeded with data up to 2/2/2025
Steps for Frontend
- Create an
.envfile in /apps/web, with the keysVITE_SUPABASE_URLandVITE_SUPABASE_ANON_KEY, fill them with theapi_urlandanon_keyrespectively. - from the root directory:
pnpm install - From the root directory:
pnpm dev:web - you should see the app loaded with data at
localhost:5713
Steps for Backend
- This is only needed if you are writing jobs to fetch data, the frontend or database does not require this. This service only runs jobs.
- create an
.envfile in /apps/server with the keysSUPABASE_URL,SUPABASE_SERVICE_ROLE_KEY,GOOGLE_GEOCODE_API_KEY, andCONGRESS_GOV_API_KEYthe first two supabase ones are from setting up the database. pnpm devwill start the server.