Skip to content

CodeForBuffalo/affordable_water

Repository files navigation

GetWaterWiseBuffalo

GitHub release (latest by date) Build Status Test Coverage Maintainability GitHub

This mobile-friendly site allows Buffalo residents to apply for the Residential Affordable Water Program. Residents can create a new application and upload multiple photos of required documents even at a later date.

This project was developed as part of the 2019 Code for America Community Fellowship.

Development

Tech Stack

  • Python 3.7 with Django 2.2
  • Node.js for npm packages and scripts
  • Travis CI for testing and builds
  • Heroku deployment
  • Heroku-hosted PostgreSQL database for storing application data
  • S3 bucket for storing photos of documents

Requirements

Make sure these are installed on your machine.

Windows users

Instructions

We use npm scripts to speed up development. Manual instructions are also provided.

Clone repository and open terminal in project's root directory.

$ PATH\TO\REPO\affordable_water>

Setup environment automatically

npm run setup

This script automatically:

  1. Installs pipenv to manage Python virtual environment and dependencies. Learn more about pipenv.
    • pip install pipenv
  2. Creates a Python virtual environment using pipenv and installs dependencies based on the Pipfile.lock
    • pipenv sync
  3. Installs node modules using npm
    • npm install

Build assets

npm run assets

This script automatically:

  • Uses gulp.js to copy assets from node_modules to _vendor folder.
    • gulp
  • Collects Django static files, including the copied assets from _vendor
    • pipenv run manage.py collectstatic

Start local server

npm start

This script runs pipenv run manage.py runserver

Visit local server

Open server in browser at http://localhost:8000/

Run tests

If you make changes to the code, you'll want to run the test suite to make sure existing functionality didn't break. You should also write tests for any new or modified code.

npm test

This script runs the testing suite along with a code coverage analysis using Coverage.py. If the current tests pass, a new folder called htmlcov will be generated. If you open htmlcov/index.html in a browser, you can interactively see how much of the source code is covered by tests.

License

The project is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in this project’s codebase, issue trackers, chat rooms and mailing lists is expected to follow the Code for America code of conduct.