This is the backend for the Election Night Integrity Project, built by Data for Progress and VoteAmerica.
The job of the backend is to:
- Ingest data from the AP Elections API, historical data sources, and live commentary spreadsheets and write it to a Postgres database
- Export data from the Postgres database to populate static JSON files in S3 that are consumed by the frontend.
- To spin up a Postgres database for development, run
docker-compose up
. - Then, migrate your database with
scripts/migrate-db.sh
. You can connect withscripts/psql.sh
. - Copy
.env.example
to.env
and fill in your AP API key.
The ingester is responsible for importing all of our data sources into Postgres.
You can run the ingester with: pipenv run python -m enip_backend.ingest.run
.
The exporter is responsible for updates all the exports in S3 based on the latest data in Postgres.
You can run the exporter with: pipenv run python -m enip_backend.export.run