To begin development, check out the repo via git clone [email protected]:OpenGeoscience/divers-h.git
.
- To prepare the web client, install its requirements with
cd client && npm install
. - Run the docker containers with
docker compose up
. Be sure to check that all containers were able to start and stay running successfully before continuing. - While the containers are up, run the following commands in a separate terminal to prepare the database:
- Run
docker compose run --rm django ./manage.py migrate
. - Run
docker compose run --rm django ./manage.py createsuperuser
and follow the prompts to create your own user. - Run
docker compose run --rm django ./manage.py makeclient --username {[email protected]}
to create the client application id for user logins. - Run
docker compose run --rm django ./manage.py ingest_data tva.json
to use sample data. - Copy the
./client/env.example
environment file to./client/.env
. The default environment variables should be sufficient for local development.
- Run
- Run
docker compose up
. You can access the admin page at port 8000: http://localhost:8000/admin/ - In the
client
directory runnpm run dev
. The user interface is on port 3000: http://localhost:3000/ - When finished, use
Ctrl+C
to stop the docker-compose and npm commands, respectively.
Occasionally, new package dependencies or schema changes will require rebuilding the docker images. To non-destructively update your development stack at any time:
- Run
docker compose pull
- Run
docker compose build --pull --no-cache
- Run
docker compose run --rm django ./manage.py migrate