{"id":24911502,"url":"https://github.com/hackoregon/openelections","last_synced_at":"2025-10-16T22:30:37.953Z","repository":{"id":34769356,"uuid":"175112905","full_name":"hackoregon/openelections","owner":"hackoregon","description":"Open and Accountable Elections","archived":false,"fork":false,"pushed_at":"2024-03-02T18:39:04.000Z","size":7528,"stargazers_count":16,"open_issues_count":46,"forks_count":1,"subscribers_count":17,"default_branch":"develop","last_synced_at":"2024-04-14T23:08:23.315Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://openelectionsportland.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hackoregon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-12T01:38:26.000Z","updated_at":"2023-10-10T13:19:06.000Z","dependencies_parsed_at":"2022-09-15T06:51:40.958Z","dependency_job_id":null,"html_url":"https://github.com/hackoregon/openelections","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackoregon%2Fopenelections","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackoregon%2Fopenelections/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackoregon%2Fopenelections/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackoregon%2Fopenelections/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackoregon","download_url":"https://codeload.github.com/hackoregon/openelections/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236750212,"owners_count":19198833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-02T04:20:32.734Z","updated_at":"2025-10-16T22:30:32.299Z","avatar_url":"https://github.com/hackoregon.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Open Elections Project\n\nWe're back baby.\n\nThis is the main repo for the Open Elections project.\n\nCheck out our [wiki](https://github.com/hackoregon/openelections/wiki) for information.\n\n## Getting Started\n\nTo get this repo running locally you need to have a few dependencies installed.\n\n- Node.js: make sure you have node installed on your machine. You can install it here: https://nodejs.org/en/download/\n- NVM: use the node version manager to make sure we're all using the same node version. Download it here: https://github.com/nvm-sh/nvm\n- Docker: You'll need Docker to run the frontend, backend, database. etc. Setup Docker by visiting: https://docs.docker.com/install/\n\n## Local Development\n\nThe frontend depends on the backend \u0026 database to be up and running in order to be worked on locally. If you want to have hot module reloading, during development you could use Docker with volumes, but starting the Docker services you need and running the node server separately, is likely simpler. Also checkout the [app](/api/Readme.md) and [api](/api/README.md) Readmes for more info. In general the following command will get all dependencies running with volumes in the foreground:\n\n```bash\n    docker-compose up # add '-d' if you don't want run Docker in detached mode in the background\n```\n\nIf you don't want to see local console logs from all running containers, you can add the `-d` flag to run in detached mode. See the (Docker documentation)[https://docs.docker.com/engine/reference/run/#detached-vs-foreground] for more info.\n\nYou can use the following commands to get up and running for frontend development locally:\n\n```bash\n    # start the api and db\n    docker-compose -f docker-compose-test.yml up api\n    # then start the frontend serve\n    cd app\n    yarn start\n```\n\n### Commands\n\nIf you're starting from scratch, you'll need to create a .env file\n\n```bash\n    touch .env\n```\n\nYou'll need a `GOOGLE_GIS_KEY` in order for addresses to be properly geocoded for the public data visualizations.\n\nPull all the Docker images by running:\n\n```bash\n    docker-compose pull\n```\n\nBuild the Docker images by running:\n\n```bash\n    docker-compose build\n```\n\nStart application by running:\n\n```bash\n    docker-compose up\n```\n\n### Seeding the Database\n\nWe have a set of seed files located in models/seeds, to run them:\n\n```bash\n    docker-compose -f docker-compose-test.yml up\n    docker-compose run --rm api npm run seed\n```\n\n### Testing\n\nUse the following steps to run through the jest/mocha tests. You can see the what Travis, the CI/CD tool we are using, runs when a PR is opened against the `develop` branch in `./scripts/test.sh`.\n\n\u003e Heads up: Make sure after each test you clear the Docker containers (`docker-compose [-f docker-file-name.yaml] down`) or you will probably get `Error: Request failed with status code 403`.\n\n##### 1. Install the app:\n\nIn the root directory run the following. Note: `-f docker-compose-test.yml` specifies the test Docker.\n\n```bash\n    docker-compose -f docker-compose-test.yml build\n```\n\nIn the app directory, you'll have to install the app dependencies (outside of Docker)\n\n```bash\n    cd app\n    yarn install\n```\n\n##### 2. Then you can run the api in Docker:\n\n```bash\n    docker-compose -f docker-compose-test.yml up api\n```\n\n##### 3. Run the Test Suites\n\nRun the api test suite:\n\n```bash\n    docker-compose -f docker-compose-test.yml run --rm api npm test\n```\n\nRun the app test suite:\n\n```bash\n    docker-compose -f docker-compose-test.yml run --rm app yarn test\n```\n\nRun the datascience api test suite:\n\n```bash\n    docker-compose -f docker-compose-test.yml run --rm data make test\n```\n\n### Debugging\n\nIf you encounter a particularly common or interesting issue, when trying to get the local environment working, feel free to add the problem / solution here.\n\n##### Debugging Docker\n\nIf you're not sure how to solve a Docker issue, removing all created Docker containers usually is a good place to start:\n\n```bash\n    #The following command will return a list of container ids\n    docker ps -a # yes docker, not docker-compose\n    #Use each container id in the following command\n    docker rm \u003ccontainer-id\u003e -f # remove the container id\n```\n\nI also have experienced issues getting docker to build locally to test UI. Most recently I was getting these errors: `docker output clipped, log limit 1MiB reached` and `npm WARN tar ENOSPC: no space left on device, open`. I had to do the following:\n\n```bash\ndocker system prune\n\nDOCKER_BUILDKIT=0 docker-compose -f docker-compose-qa.yml up\n```\n\nIf you are seeing pm2 errors when trying to spin up a production container, make the the pm2 version in the Dockerfile matches the node version in the Dockerfile.\n\n#### npm issue\n\nWhen opening this repo and `nvm use` the `api` directory, I was encountering this error when trying to install the dependencies (`npm i`):\n\n```\nERROR: npm is known not to run on Node.js v11.4.0\nYou'll need to upgrade to a newer Node.js version in order to use this\nversion of npm. You can find the latest version at https://nodejs.org/\n```\n\nIt took some debugging, but I was able to finally get a clean install by:\n\n```bash\nnvm uninstall v11.4.0 # this is the version in .nvmrc\nnvm install v11.4.0 --latest-npm\n```\n\n## Deployment\n\nThis project uses Travis to Continuously deploy to qa.openelectionsportland.org on commits to develop.\nWhen you open a PR, Travis will run our test suite, and mark it as passing or failing on the PR at Github.\nWhen the PR is merged into develop, and the test suite is passing, Travis will deploy using scripts/deploy.sh\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackoregon%2Fopenelections","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackoregon%2Fopenelections","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackoregon%2Fopenelections/lists"}