Getting started

Prerequisites

  • Python >=3.11.

  • PostgreSQL database. The application is developed with the latest version at the time of writing (PostgreSQL 16.2) deployed on Alpine 3.19 OS.

  • For containerised deployments, the only requirement is a working container engine installation running on your machine.

    • Podman is the preferred container engine. Docker can be used equivalently (as a first port of call, try simply replacing podman --> docker in any commands below).

Run the application

After following one of the deployment methods below, navigating to localhost:8000, 127.0.0.1:8000 or 0.0.0.0:8000 in the browser should return the application landing page (/). API documentation generated with OpenAPI can be viewed by navigating to the /docs endpoint.

Containerised

This method requires manual deployment of external application components (database, frontend) and network configuration between the application components.

podman build -t ska-src-maltopuft-backend:latest .
podman run -t -p 8000:8000/tcp ska-src-maltopuft-backend:latest

Note that the port specified in the above command (8000) is the same as the port exposed in ./Dockerfile.

Local

This method requires manual deployment of all application components and network configuration between them.

# Install poetry
curl -sSL https://install.python-poetry.org | python3 -

# Create and activate a virtual environment with venv
python3.11 -m venv .venv
source .venv/bin/activate

# Install dependencies in venv with poetry
poetry install --no-root

# Run the application
python main.py