Skip to content

codefordenver/waterbeacon

This branch is 1 commit ahead of, 99 commits behind master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

68cacf0 · Dec 26, 2021
Dec 4, 2021
Dec 26, 2021
Oct 4, 2016
Nov 11, 2019
Dec 26, 2021
Dec 4, 2021
Dec 24, 2021
Dec 26, 2021
Oct 22, 2021
Dec 26, 2021
Dec 4, 2021
Dec 12, 2021
Dec 26, 2021
May 9, 2020
Dec 3, 2019
Jun 18, 2019
Dec 24, 2021
Dec 24, 2021
Oct 4, 2016
Dec 26, 2021
Nov 22, 2021
Dec 15, 2018
Apr 19, 2020
Dec 26, 2021

Repository files navigation

waterbeacon

waterbeacon

Resources

Water quality data

NSF Water Quality Index

Water quality index calc

API Installation Guide

You'll need to install python3 along with pip.

Next, you'll need to install python virtual environment wrapper. You can do so by running pip install virtualenvwrapper.

Now, activate a python virtual environment by running mkvirtualenv ${ENV_NAME}. The ENV_NAME is arbitrary. We'll use "wb" for simplicity.

Finally, run pip install -r requirements.txt to install necessarry dependencies.

Before moving forward, make sure that you have postgresql installed and running. Run brew install postgresql

Make sure you have the folling tools are installed:

May be required:

Create an empty .env file touch .env.

Create the waterbeacon database by running createdb waterbeacon

(Optional - Linux Users) You may need to create a new Postgres User or update the default Postgres User to have access to the database. Do this by running the following:

sudo su - postgres

psql

CREATE USER myprojectuser WITH PASSWORD 'password';

GRANT ALL PRIVILEGES ON DATABASE waterbeacon TO myprojectuser;

You should then update the 'USER' and 'PASSWORD' to the dev.py file in the settings folder to your newly created postgres user.

When that completes, run ./manage.py migrate --settings=settings.dev to create a local postgres db instance for development.

(Optional - never necessary if csvs exist) To get all the new facility location data from the EPA, you can run ./manage.py download_epa_facility_data --settings=settings.dev

(Optional - never necessary if csvs exist) To get all the new SDWA data from the EPA, you can run ./manage.py download_epa_water_data --settings=settings.dev

(Optional) Populate the rawdata app with EPA data by running the following:

./manage.py import_epa_facility_data --settings=settings.dev;./manage.py import_epa_water_data --settings=settings.dev;./manage.py insert_facility_fips --settings=settings.dev;./manage.py data_cruncher --settings=settings.dev

Finally, run ./manage.py runserver --settings=settings.dev to kick off a dev server.

The dev server will run on localhost:8000 by default. If you prefer another port, just pass the desired port number following the previous command. That is ./manage.py runserver --settings=settings.dev ${PORT}

Note: to deactive the virtual env wrapper, just run deactivate.

Frontend Installation Guide

Navigate to the frontend directory where the react app is located and run install

  • cd frontend
  • npm install

After installation you can run npm start which will run the react app on localhost:3000 with "hot reload" enabled.

Server Installation Notes

In primary folder create a .env file and place the following parameters:

DEBUG=
DATABASE_URL=
PG_USERNAME=
PG_PASSWORD=
ENVIRONMENT=
DJANGO_SETTINGS_MODULE=
CELERY_BROKER_URL=
FLOWER_PORT=
TWITTER_ACCESS_TOKEN_SECRET=
TWITTER_ACCESS_TOKEN=
TWITTER_CONSUMER_SECRET=
TWITTER_CONSUMER_KEY=
VIRTUAL_PORT=
SENTRY_DSN=
EMAIL_FROM=

Within ./frontend folder create a .env file and place the following parameters:

VIRTUAL_HOST=[domain]