The Federal Election Commission (FEC) is the independent regulatory agency charged with administering and enforcing the federal campaign finance law. The FEC has jurisdiction over the financing of campaigns for the U.S. House, Senate, Presidency and the Vice Presidency.
This project will provide a web application for filling out FEC campaign finance information. The project code is distributed across these repositories:
Software necessary to run the application locally
When running docker-compose you will need to be in the root directory of the project. The reason for this is that docker-compose looks for docker-compose.yml to be in the same directory where it's run. You will also need at least 3GB of memory allocated for docker during the build.
docker-compose up -d
You should set the following environment variables in the shell where you are running 'docker-compose up -d'. Proper values for the development variables are shown here as an example
export DATABASE_URL="postgres://postgres:postgres@db/postgres"
export FECFILE_TEST_DB_NAME="postgres"
export DJANGO_SECRET_KEY="If_using_test_db_use_secret_key_in_cloud.gov"
export FEC_API="https://api.open.fec.gov/v1/"
# Note - this API key has a very low rate limit -
# For a better key, reach out to a team member or get one at https://api.open.fec.gov/developers/
export FEC_API_KEY="DEMO_KEY"
# Test EFO Services (for test filings):
export FEC_FILING_API="EFO_get_this_from_team_member"
export FEC_FILING_API_KEY="EFO_get_this_from_team_member"
docker-compose down
docker ps
docker-compose exec <container name> <command>
Special Note: If the fecfile-validate repo was updated, the commit of the update needs to be updated in the requirements.txt file otherwise the CircleCI cache will not roll out the change.
Using git-flow extensions:
git flow feature start feature_branch
Without the git-flow extensions:
git checkout develop git pull git checkout -b feature/feature_branch develop
develop
branchdevelop
via GitHubdevelop
is deployed to dev
git flow release start sprint-#
git checkout develop
git pull
git checkout -b release/sprint-# develop
git push --set-upstream origin release/sprint-#
main
branch to track if commits pass deployment checks. The actual merge will happen when deploying a release to production.git flow hotfix start my-fix
# Work happens here
git flow hotfix finish my-fix
git checkout -b hotfix/my-fix main
# Work happens here
git push --set-upstream origin hotfix/my-fix
main
and develop
branches:develop
and main
develop
is deployed to dev
. Make sure the build passes before deploying to main
.main
(At this point the code is automatically deployed)develop
branchdevelop
The fecfile-web-api is our system's backend while the fecfile-web-app is the single-page angular app. The fecfile-web-api is deployed as a cloud.gov application per environment (dev, stage, and prod). Each cloud.gov fecfile-web-api application has at least two instances running. Similarly, the fecfile-web-app is deployed as a cloud.gov application per environment (dev, stage, and prod). There are also at least two instances running per cloud.gov fecfile-web-app application.
The following events occur for fecfile-web-api and fecfile-web-app independently of each other:
This section covers a few topics we think might help developers after setup.
Set up git secrets to protect oneself from committing sensitive information such as passwords to the repository.
Black is the Python code formatter used on the project.
pip install black
."[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true
}
black <file_or_directory>
As a best practice policy, please commit any feature code changes made during the day to origin each evening before signing off for the day.
The project is using the Google Python Style Guide as the baseline to keep code style consistent across project repositories. See here for comment style rules: https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings