Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


FEC's eRegs

The Federal Election Commission's web-based application that makes regulations easier to find, read and understand.

Glue project which combines regulations-site, regulations-core and styles/templates specific to FEC. Packaged as a app.

Site Location

package.json Known Vulnerabilities requirements.txt Known Vulnerabilities


General Architecture (described below)

This repository is a app which stitches together two large Django libraries with datastores and some FEC-specific styles and templates. The first library, regulations-core, defines an API for reading and writing regulation and associated data. fec-eregs mounts this application at the /api endpoint (details about the "write" API will be discussed later). The second library, regulations-site, defines the UI. When rendering templates, regulations-site will first look in fec-eregs to see if the templates have been overridden. These views pull their data from the API; this means that fec-eregs makes HTTP calls to itself to retrieve data (when it's not already cached).


We're currently deploying to multiple environments, a dev, stage, and a prod instance. All environments are deployed automatically based on git flow.

Environment App URL Proxy Website URL Description
dev Ad-hoc testing, deploys the latest changes from develop.
stage Staging site, deployed from branches matching release/*.
prod Production site, deployed from any tagged commit.

Front End Development

The static files are located at: fec_eregs/static/fec_eregs/.
Base SCSS files are copied from fec-cms (previously fec-style), but be mindful of custom stylesheets to make it work with this eregs instance.
Running npm run build will compile both the JS and SCSS files (generating /static/fec_eregs/css/main.css).

It's also important to keep in mind that the compile_frontend management command will compile the base regulations styles located at fec_eregs/static/regulations/*.

Local Development

This application requires Python 3.7.X

Use pip and npm to download the required libraries:

$ pip install -r requirements.txt
$ pip install -r requirements_dev.txt
# remove the node_modules from your local environment
$ rm -rf node_modules/
$ npm install

Then initialize the database, build the front-end, and run the server:

$ npm run build
$ python migrate
$ python compile_frontend
$ python runserver

Deploying Code

If the code within fec-eregs, regulations-core, or regulations-site has been updated, you will want to deploy the updated code to

$ pip install -r requirements.txt   # updates the -core/-site repositories
$ npm run build
$ python compile_frontend   # builds the frontend
$ cf target -s ${cf_space}
$ cf push --strategy rolling eregs -f manifest.${cf_space}.yml

Load FEC's regulations

  1. Follow the wiki to parse regulations on local.
  2. Follow this instructions to parse regulations on space.


For the time being, this application, which cobbles together regulations-core and regulations-site, makes HTTP calls to itself. The server therefore needs to know which port it is set up to listen on.

We default to 8000, as that's the standard for django's runserver, but if you need to run on a different port, either export an environmental variable or create a as follows:

$ export PORT=1234


$ echo "API_BASE = 'http://localhost:1234/api/'" >>