This project requires:
- Python 3.x (it's been running under 3.6 & 3.7)
- PostgreSQL with PostGIS extensions
- Node 12.x and NPM
- A Mapbox developer key
- A Here developer key
git clone
this repository and change into the resulting directory.- Create a virtual environment:
python3 -m venv .cmdi
- Activate the virtual environment:
source .cmdi/bin/activate
- Install the Python requirements:
pip install -r requirements.txt
- Create a PostgreSQL role for this project:
createuser --password cmdi
- Create the PostgreSQL database:
createdb --owner cmdi cmdi
- Import the current database:
bunzip2 < scratch/cmdi.sql.bz2 | psql --set ON_ERROR_STOP=on -h localhost cmdi
- Copy
.env-example
to.env
and fill in the appropriate credentials. - Copy
Procfile-example
toProcfile
and make sure the appropriate section for your environment is uncommented. - Install and build assets:
npm ci && npm run build:production
- For a local installation, start the server:
honcho start
(Django only) ornpm run dev
(with live asset compilation and reloading)
TODO.
- Be consistent in using American English for interface elements.
- Be consistent in using sentence case for interface elements and headers.
Ultimately the Directory will be presented in multiple, translated languages.
19 March 2020: Flipped the switch on account creation in production and so the flow of definitive data has reversed, now it's from production to development.
Remote:
pg_dump -U cmdi -h localhost -f scratch/cmdi.sql --clean --if-exists --no-privileges --no-acl --no-owner cmdi && bzip2 -9 --force scratch/cmdi.sql
Local:
scp [email protected]:/home/ubuntu/coop-map-directory-index/scratch/cmdi.sql.bz2 scratch/
bunzip2 < scratch/cmdi.sql.bz2 | psql --set ON_ERROR_STOP=on -h localhost cmdi
January 2020: Data is being managed outside of this repository. A locally-installed development database is periodically dumped, transferred, and imported into the production server.
Local:
pg_dump -U cmdi -h localhost -f scratch/cmdi.sql --clean --if-exists cmdi && bzip2 -9 --force scratch/cmdi.sql
scp scratch/cmdi.sql.bz2 ubuntu@awshost:/home/ubuntu/coop-map-directory-index/scratch
Remote:
bunzip2 scratch/cmdi.sql.bz2
sudo su postgres
psql --set ON_ERROR_STOP=on -h localhost -U cmdi -W -f scratch/cmdi.sql cmdi
exit
honcho start
Limit commit messages to 72 characters, do not end with a full stop, prefix with one of:
build
ci
chore
docs
feat
fix
perf
refactor
revert
style
test
For more information, see here.
Use dev
branch as the basis for all pull requests/feature development.
Use the master
branch for "stable" code (merge from dev
periodically).
Modules we may need further down the road: