Website environment
For the modern FastAPI backend (recommended): The FastAPI application requires database and cache services. Use Skaffold for the complete development environment:
cd gwtm-helm
skaffold dev # Starts full stack including FastAPI, database, and cacheFastAPI will be available at http://localhost:8000 with API docs at http://localhost:8000/docs
See the FastAPI README for detailed setup instructions and testing.
Configuration is handled via environmental variables. At a minimum, the following env vars must be present:
DB_PWD
MAIL_PASSWORD
RECAPTCHA_PUBLIC_KEY
RECAPTCHA_PRIVATE_KEY
ZENODO_ACCESS_KEY
REDIS_URL
# Storage backend (choose one: s3, abfs, or swift)
STORAGE_BUCKET_SOURCE # "s3", "abfs", or "swift"
# AWS S3 credentials (if using s3)
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
# Azure credentials (if using abfs)
AZURE_ACCOUNT_NAME
AZURE_ACCOUNT_KEY
# OpenStack Swift credentials (if using swift)
OS_AUTH_URL
OS_STORAGE_URL
OS_USERNAME
OS_PASSWORD
OS_CONTAINER_NAME
For FastAPI configuration and detailed storage setup, see server/README.md.
Env vars can be set by using export:
export MAIL_PASSWORD=ASecretPassword
export RECAPTCHA_PUBLIC_KEY=ASecretPassword2Or by using a utility like direnv.
For a more complete development environment with Kubernetes, you can use Skaffold with the Helm chart:
-
Prerequisites:
-
Navigate to the Helm chart directory:
cd gwtm-helm- Start the development environment:
skaffold devThis will:
- Build the Docker image
- Deploy the application to your Kubernetes cluster
- Set up port-forwarding (frontend: localhost:3000, fastapi: localhost:8000)
- Display logs in real-time
- Automatically redeploy when files change
- To restore sample data to the database:
cd gwtm-helm
./restore-db /path/to/your/dump.sqlThis script copies the SQL dump to the database pod and executes it directly.
-
Access the application:
- Frontend dashboard: http://localhost:3000
- FastAPI docs: http://localhost:8000/docs
-
When finished, stop Skaffold with Ctrl+C or run:
skaffold deleteThis Kubernetes setup includes:
- PostgreSQL database with PostGIS
- Redis cache
- FastAPI backend
- Svelte frontend dashboard
Tests can be run from the root directory using pytest. First create a virtual environment and install the requirements:
python3.11 -m venv venv
source venv/bin/activate
pip install -r server/requirements.txt
pip install pytestThen run the tests:
pytest