The BMD (Ballot Marking Device) app will be used in the following ways:
- An election offical can:
- configure the BMD app with an election file which supports:
- single seat contests.
- multiple seat contest.
- stack rank contest.
- yes/no measures and propositions.
- specify location-based ballot content.
- and more TBD…
- configure the BMD app with an election file which supports:
- A voter can:
- load their ballot using a code provided by a poll worker.
- cast a vote for each contest/prop/measure of their ballot.
- review votes and print offical paper ballot.
The master
branch of this repo is auto-deployed to:
Each pull request will have a unique demo url which can be found in the comments of the pull request.
This assumes you have git
and yarn
installed.
-
Clone the repo:
git clone https://github.com/votingworks/bmd.git
-
Install dependencies:
yarn install
-
Run the app in your local browser:
yarn start
Hey, we’re stoked that you’d like to contribute. Please let us know how we can help you contribute.
-
Fork this repo: https://github.com/votingworks/bmd
-
Clone the repo locally:
git clone https://github.com/YOUR_GITHUB_USERNAME/bmd.git
Optionally, if you already cloned the main repo, you can update your local repo to have two remotes,
votingworks
for the main repo andorigin
for your fork:git remote rename origin votingworks git remote add origin https://github.com/YOUR_GITHUB_USERNAME/bmd.git
-
Create a branch for the feature/bug/etc:
git checkout -b name-of-your-branch
-
Run the app:
yarn start
-
In a second console window, run the tests:
yarn test
Tests default to watch-mode: only tests related to changed code will run. Use the available commands in watch-mode to run the tests you want.
-
Add features, fix bugs, etc. and then use
git
to commit your changes in logical commits.There is a pre-commit hook which will run linting and code formatting scripts. You can run these manually with these three commands which are found in the
package.json
scripts:yarn eslint:base tslint:base yarn prettier:write
Using Visual Studio Code? Autorun linting and code formatting by installing/enabling the following plugins (which will pick up their respective config files in this project):
TSLint
for TypeScript lintingESLint
for (ECMAScript) JavaScript lintingPrettier - Code formatter
for code formatting
-
Check for test coverage. When you push your branch to github, CircleCI will run all the tests and check for test coverage. To check this yourself, run:
yarn test:coverage
In the root of the project there is a
coverage
directory. Opencoverage/lcov-report/index.html
in a browser to navigate the files to view test coverage. -
Push your branch to your fork on Github.
-
Create a pull request to merge your branch into
voingworks/bmd/master
. Once the pull request is created CircleCI will automatically run all the tests to ensure the app is working correctly. -
The VotingWorks maintainers will
yarn install
- Install the dependencies.yarn start
- Run the app locally.yarn test
- Run tests in interactive mode.yarn test:coverage
- Run all tests and update test coverage report.
See package.json
for all available scripts.
This project was bootstrapped with
Create React App for TypeScript.
It uses Styled Components for styles
(and some css
files too). ESLint,
TSLint, and
Prettier are used to maintain clean code.
Jest, dom-testing-library
and react-testing-library
are used to test components and end-to-end user flows.
jest-axe is used to test for basic web
accessibility.