Kaartdijin Boodja (meaning "Knowledge of Country") is a web application for managing a catalogue of GIS layers and publishing them for the Department of Biodiversity, Conservation and Attractions (DBCA).
The backend of Kaartdijin Boodja is a Python Django project using Django REST Framework backed by a PostgreSQL database. The backend uses Poetry to manage its dependencies.
To get a standard development environment up and running using Poetry and virtual environments:
# Ensure Poetry is installed
$ poetry --version
Poetry (version 1.2.1)
# Ensure Python 3.10 is currently activated
$ python3 --version
Python 3.10.4
# Create a virtual environment and install dependencies using Poetry
# The dependencies are installed from the `poetry.lock` file, providing
# consistent and reproducible installations across any machine.
$ poetry install
# Remember to enter the virtual environment shell after installation
$ poetry shell
# Check GDAL is installed correctly
$ gdal-config --version
3.3.2
# Install Python GDAL
$ pip install gdal==`gdal-config --version`
To run a development server, use the Django
manage.py
script:
$ DEBUG=True python3 manage.py runserver
The backend requires the following environment variables to be set:
SECRET_KEY=...
DATABASE_URL=...
DEV_APP_BUILD_URL="http://localhost:9072/src/main.ts"
PRODUCTION_EMAIL=False
EMAIL_INSTANCE='DEV'
NON_PROD_EMAIL='[email protected]'
EMAIL_DELIVERY=on
ENABLE_DJANGO_LOGIN=True <-- Will enable a login screen for developement purposes, set to false for production
For convenience, these can also be defined in a .env
file that will be loaded at runtime.
To install and/or appropriately update packages and their dependencies:
$ npm install
To build the project:
$ npm run build
To run a development server:
$ npm run dev
or to use a different port:
$ PORT=9072 npm run dev
They are:
govapp
- contains the department base templates, base packages and backend code
govapp/frontend
- Contains node web app frontend code