Skip to content
This repository was archived by the owner on May 8, 2024. It is now read-only.

Repository files navigation

360Giving Cost of Living Grants Tracker

360Giving Logo

A tracker for UK grants published to the 360Giving Data Standard, using data from the 360Giving Datastore.

The app is built using Dash by Plotly, which is based around the Flask python web framework and react.

Run development version

python -m venv env # create virtual env
source env/bin/activate # enter virtual environment (`env/Scripts/activate` on windows)
pip install -r requirements.txt # install needed requirements
mv .env-sample .env # rename .env file (linux)

You'll then need to edit the .env file, adding the correct values for DB_URL (the database connection for the 306Giving Datastore) and MAPBOX_TOKEN (which shows the map).

Once the settings are correct you need to fetch the latest data.

flask fetch-data

Finally run the development server

python index.py

Setup using dokku

  1. On server:
dokku apps:create col
  1. On client:
git remote add dokku dokku@<IPADDRESS>:col
  1. On server:
# create a persistant directory
dokku storage:ensure-directory col
dokku storage:mount col /var/lib/dokku/data/storage/col:/app/storage

# set up settings
dokku config:set --no-restart col DB_URL=**DATABASE URL**
dokku config:set --no-restart col GOOGLE_ANALYTICS=********
dokku config:set --no-restart col PROMETHEUS_AUTH_PASSWORD=********
dokku config:set --no-restart col DATA_DIR=/app/storage/data
dokku config:set --no-restart col FLASK_APP=coltracker.app:server

# set up redis
dokku redis:create coltrackercache
dokku redis:link coltrackercache col

# fetch data
dokku run col flask fetch-data
dokku run col flask clear-cache
dokku ps:rebuild col
  1. Set up cron tab for scheduled tasks (on server)
nano /etc/cron.d/col

About

Cost of Living grants tracker based on data published by UK grantmakers in the 360Giving Data Standard

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages