API Structure
Routes are organised by domain, not by HTTP verb. The same API serves the research app, the public web frontend, and external tooling.
The RELab backend exposes a REST-style API used by the Expo app, the public web frontend, and selected operational tooling. Public and authenticated surfaces are separated in practice, but the cleanest source of truth is the live OpenAPI docs.
For the live schema and request models, use the interactive API documentation. For practical usage guidance, see the API Interaction Guide.
Route Organisation
Section titled “Route Organisation”Authentication & User Management
Section titled “Authentication & User Management”/auth/*— login, logout, refresh, registration, verification, password reset, and OAuth/users/*and/organizations/*— authenticated user and organization operations/admin/users/*and/admin/organizations/*— superuser administration
Data Collection
Section titled “Data Collection”/products/*— product creation, reads, updates, search, and parent-child component relations/users/me/products/*and/users/{user_id}/products/*— user-scoped product access
Reference Data
Section titled “Reference Data”- public
/taxonomies,/categories,/materials,/product-types, and/unitsendpoints for reference lookups /admin/*variants for controlled management of background data
/images/*and related file-storage endpoints for uploads, linked media, and retrieval
Hardware Integration
Section titled “Hardware Integration”/plugins/rpi-cam/*— camera registration, status, capture, streaming, and remote interactions
Supporting Services
Section titled “Supporting Services”/newsletter/*— newsletter subscription operations- health and readiness endpoints for deployment checks
Design Notes
Section titled “Design Notes”- The backend serves both browser-oriented and app-oriented clients.
- Authentication supports both cookie and bearer transports (see Authentication).
- Public reference data is openly accessible; user-owned research data requires authentication.
Example Interaction Flow
Section titled “Example Interaction Flow”sequenceDiagram participant Researcher participant API as FastAPI Backend participant DB as Database participant Storage as File Storage participant RPI as RPI Camera API
Researcher->>API: Authenticate with bearer or cookie login API-->>Researcher: Access token and optional refresh cookie
loop Add Products Researcher->>API: Create parent product API->>DB: Store Product API-->>Researcher: Product Details
opt Capture Product Images Researcher->>API: Request image capture API->>RPI: Trigger Camera RPI-->>API: Image Data API->>Storage: Store Image API->>DB: Link to Product API-->>Researcher: Image Details end
loop Add Components Researcher->>API: Create component API->>DB: Store Component API->>DB: Link Component to Parent API-->>Researcher: Component Details end end