Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/hotosm/tasking-manager/llms.txt

Use this file to discover all available pages before exploring further.

HOT Tasking Manager is composed of two independently developed components: a React frontend that provides the mapping interface and project management UI, and a FastAPI + PostgreSQL/PostGIS backend that exposes a versioned REST API. You can work on either component in isolation — the frontend can be pointed at the HOT staging API, and the backend can be exercised directly through its Swagger UI — or you can run the full stack locally using Docker Compose.

OSM OAuth2 Setup

Tasking Manager delegates all user authentication to OpenStreetMap’s OAuth 2.0 system. Before configuring any environment, you need OAuth2 credentials from openstreetmap.org.
  1. Log in to openstreetmap.org. If you do not have an account, create one at openstreetmap.org/user/new.
  2. Open the dropdown on the top-right of the navigation bar and select My Settings.
  3. Navigate to OAuth 2 applications and click Register new application.
  4. Configure the application:
    • Redirect URI: http://127.0.0.1:3000/authorized
    • Permissions: read_prefs (Read user preferences) and write_api (Modify the map)
  5. Save the form and note down your Client ID and Client Secret.
Use http://127.0.0.1:3000/authorized as the redirect URI, not http://localhost:3000/authorized. OpenStreetMap’s OAuth2 implementation requires the literal IP address 127.0.0.1 for local development environments. Using localhost will cause authentication to fail.

Configure the Environment File

The repository includes a fully-documented example.env that serves as the starting point for any deployment. Copy it to tasking-manager.env in the repository root:
cp example.env tasking-manager.env
Open tasking-manager.env and set the following variables at minimum. The full list of available variables is described in the operations configuration reference.
VariableDescriptionExample
TM_APP_BASE_URLPublic URL of the frontend (used in email links and OAuth callbacks)http://127.0.0.1:3000
TM_CLIENT_IDOAuth2 Client ID from openstreetmap.orgabc123
TM_CLIENT_SECRETOAuth2 Client Secret from openstreetmap.orgs3cr3t
TM_REDIRECT_URIMust match the URI registered on OSMhttp://127.0.0.1:3000/authorized
TM_SCOPEOAuth2 permission scopesread_prefs write_api
TM_SECRETFreely-defined secret shared between frontend and backendany-long-random-string
POSTGRES_DBDatabase nametasking-manager
POSTGRES_USERDatabase usertm
POSTGRES_PASSWORDDatabase passwordtm
POSTGRES_ENDPOINTDatabase host (use Docker service name or IP for standalone)tm-db
POSTGRES_PORTDatabase port5432
A minimal working configuration for local development looks like:
TM_APP_BASE_URL=http://127.0.0.1:3000
TM_CLIENT_ID=<your-client-id>
TM_CLIENT_SECRET=<your-client-secret>
TM_REDIRECT_URI=http://127.0.0.1:3000/authorized
TM_SCOPE=read_prefs write_api
TM_SECRET=replacethiswithalongrandomstring

POSTGRES_DB=tasking-manager
POSTGRES_USER=tm
POSTGRES_PASSWORD=tm
POSTGRES_ENDPOINT=tm-db
POSTGRES_PORT=5432

Running the Stack

Docker Compose is the recommended way to run the full Tasking Manager stack for development. It brings up the PostGIS database, runs database migrations, starts the FastAPI backend, the React frontend, cron jobs, and the Traefik reverse proxy — all wired together automatically.

Requirements

Install Docker Engine (Docker Compose v2 is bundled).

Start All Services

1

Copy and configure the env file

cp example.env tasking-manager.env
# Edit tasking-manager.env — set TM_CLIENT_ID, TM_CLIENT_SECRET at minimum
2

Bring up the full stack

docker compose --env-file tasking-manager.env up -d
The tm-migration service runs Alembic migrations against the database before tm-backend starts. Docker Compose healthchecks ensure correct startup ordering.
3

Open the application

The Tasking Manager frontend is available at:
http://127.0.0.1:3000
The backend API docs are served at:
http://127.0.0.1:3000/api/docs
4

(Optional) Change the default port

The default frontend port is 3000, routed through Traefik. To use a different port, pass TM_DEV_PORT before the compose command:
TM_DEV_PORT=9000 docker compose --env-file tasking-manager.env up -d
If you change the port you must also update TM_APP_BASE_URL in your env file and update the Redirect URI in your OSM OAuth2 application to match the new port.
5

(Optional) Override Docker Compose configuration

To add custom service configuration (resource limits, volume mounts for live frontend reload, etc.) without modifying the tracked docker-compose.yml, create an override file from the included sample:
cp docker-compose.override.sample.yml docker-compose.override.yml
# Edit docker-compose.override.yml as needed
Docker Compose automatically merges docker-compose.override.yml when present.
6

(Optional) Use an external database

If you want to connect to an existing PostgreSQL/PostGIS server (self-hosted or cloud-managed) instead of the containerised tm-db service, update these variables in tasking-manager.env:
POSTGRES_DB=tasking-manager
POSTGRES_USER=tm
POSTGRES_PASSWORD=your-password
POSTGRES_ENDPOINT=192.168.1.100   # Your database host IP
POSTGRES_PORT=5432
If your database runs on your local machine (not inside Docker), use your machine’s LAN IP address rather than localhost — the tm-backend container cannot reach the host via localhost.
Then recreate the containers:
docker compose --env-file tasking-manager.env up -d
7

(Optional) Frontend-only deployment

If you only want to run the frontend against a remote backend (e.g. the HOT staging API), set TM_APP_API_URL in your env file:
TM_APP_API_URL=https://tasking-manager-staging-api.hotosm.org
Then start only the frontend service:
docker compose --env-file tasking-manager.env up -d tm-frontend
Follow the frontend logs to confirm a successful build:
docker logs tasking-manager-main-tm-frontend-1 -f

API Access

When the backend is running, the full API is accessible at http://localhost:5000 (standalone) or proxied through Traefik at http://127.0.0.1:3000/api/ (Docker). The Swagger UI at /api/docs documents every endpoint, shows request/response schemas, and supports authenticated test calls. To authenticate in Swagger UI:
  1. Log in via the browser frontend to create your user session.
  2. Open your profile settings, enable Expert Mode, and copy the API Key.
  3. In the Swagger UI, click Authorize and enter Token <your-api-key>.
Authenticated curl requests use the same format (adjust the host and port for your setup — port 3000 via Docker, port 5000 standalone):
curl http://127.0.0.1:3000/api/v2/projects/ \
  -H "Authorization: Token <your-api-key>"

Key Environment Variables Reference

Below is a summary of the most important variables. For the complete reference, see the operations configuration guide.
VariableRequiredDefaultDescription
TM_APP_BASE_URLYeshttp://127.0.0.1:3000Public URL of the frontend
TM_CLIENT_IDYesOSM OAuth2 Client ID
TM_CLIENT_SECRETYesOSM OAuth2 Client Secret
TM_REDIRECT_URIYeshttp://127.0.0.1:3000/authorizedOAuth2 redirect URI (must match OSM registration)
TM_SCOPEYesread_prefs write_apiOAuth2 permission scopes
TM_SECRETYesShared secret between frontend and backend
POSTGRES_DBYestasking-managerPostgreSQL database name
POSTGRES_USERYestmPostgreSQL user
POSTGRES_PASSWORDYestmPostgreSQL password
POSTGRES_ENDPOINTYestm-dbPostgreSQL host
POSTGRES_PORTYes5432PostgreSQL port
TM_APP_API_URLNohttp://127.0.0.1:3000/apiBackend API URL consumed by the frontend
TM_DEV_PORTNo3000Traefik-exposed port for the frontend (Docker only)
TM_ENABLE_SANDBOXNofalseEnable the sandbox/practice mapping mode
TM_DEFAULT_LOCALENoenDefault UI language

Build docs developers (and LLMs) love