A geotechnical data management platform for engineers
This repository contains both the API server and the frontend website for Earthworks PM.
- Python 3, with ability to create virtual environments
- PostgreSQL (tested with 9.5, 9,6, 10.1)
- PostGIS extension for postgresql
- npm package manager
- Create a Python 3 virtual environment and activate it (see Python docs)
- Clone this repository
- From the root directory (containing
manage.pyandrequirements.txt), runpip install -r requirements.txt
- Create a new postgres user (see PostgreSQL docs)
- Create a new postgres database
- Enter the command line for your database with
psql -d your_database_nameand run the commandCREATE EXTENSION POSTGIS; - Start the database server (on systemd Linux systems, run
sudo systemctl enable postgresqlandsudo systemctl start postgresql)
- Edit
eqc/settings_secret.py.templatewith your database credentials. Generate a random secret key. You can generate a key with Python with:
>>> import random
>>> ''.join([random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)])
- You must copy the generated string into the constant. Rename the file to
settings_secret.py(remove 'template' from filename) - Go to the root directory of the repo and setup database tables with
python manage.py migrate - Use
python manage.py createsuperuserto create an admin account for the backend API. - Start the Django development server with
python manage.py runserver. You should see a message that your application is running on localhost:8000. Try logging in with your admin account at localhost:8000/admin/ and see the API at localhost:8000/projects/api/ - For production systems, use gunicorn and nginx.
- Enter the epm-web folder from the repository root
- run
npm installto install dependencies - run
npm run devto run the development server - If you have trouble logging in or connecting to the API, make sure that
CORS_WHITELISTineqc/settings.pycontains the localhost:8080 frontend dev server and thatapiandloginApiinepm-web/src/store/index.jsare pointing to the local API server (localhost:8000).