Use this file to discover all available pages before exploring further.
The cloud backend is a FastAPI application that receives BLE detection data from Raspberry Pi agents, stores it in PostgreSQL, and exposes a REST API with real-time WebSocket updates. You can run it with Docker Compose (recommended) or directly with Python 3.11.
Docker Compose starts both the PostgreSQL database and the backend API in a single command. The backend waits for the database health check to pass before starting.
1
Clone the repository and enter the backend directory
cp .env.example.prod .env# Edit .env — set DATABASE_URL to point to your local PostgreSQL instance
4
Run database migrations
alembic upgrade head
Alembic reads alembic.ini and applies all pending migrations from the migrations/ directory. The sqlalchemy.url in alembic.ini is overridden at runtime by the DATABASE_URL environment variable.
5
Start the server
bash run.sh
The backend requires a running PostgreSQL instance before it starts. If the database is unreachable, init_db() will fail on startup.
Once running, two diagnostic endpoints are available without authentication.GET /health — confirms the server is up and returns the current WebSocket connection count: