Follow the instructions below to install requirements and run this app for this interview exercise.
If Flask and pytest are needed:
pip install -r requirements.txt
Set up your local Flask environment:
export FLASK_APP=elections
export FLASK_ENV=development
flask run
Not implemented
pytest
It took me about two hours to correctly call the API with data from the form, and then an additional hour to parse and display the results in a nice format.
Required
- Stub out pages (Home/form and results)
- Confirm initial API call
- Wire up form to the API call <== ~ 2 hours of work (total)
- Parse results
- Format results nicely for display <== ~ 3 hours of work (total)
Stretch goals
- Validate form input
- Add input tests
- Add friendly error messages
- Display or link to results on Google Maps (maybe a link to show in Maps)
Issues
- Empty form hangs the page (fix with form validation)
- Update Election Results template to not display items that don't have values (ex. no website for Pinehurst)