Appearance
HTTP Routes
All HTTP routes are defined in server/src/routes/http.ts. The route handler is a large function that returns route definitions consumed by the Bun HTTP server.
Route Groups
Authentication
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /.well-known/jwks.json | None | Public JWKS endpoint for JWT verification |
| POST | /login | None | Authenticate with email/password, returns JWT |
| POST | /register | Admin | Create a new user |
| POST | /change-password | Auth | Change current user's password |
Users
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /users | Admin | List all users |
| DELETE | /users/:userId | Admin | Delete a user |
Beacons
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /beacons | Auth | List all beacons |
| POST | /beacons | Admin | Create a beacon |
| GET | /beacon/:id | Auth | Get beacon details |
| PUT | /beacon/:id | Admin | Update a beacon |
| DELETE | /beacon/:id | Admin | Delete a beacon |
| GET | /beacon/:mac/info | Auth | Get beacon info by MAC address |
| GET | /beacon/:id/intervals | Auth | Get tracking intervals for a beacon |
Gateways
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /gateways | Auth | List all gateways |
| POST | /gateways | Admin | Create a gateway |
| GET | /gateway/:id | Auth | Get gateway details |
| PUT | /gateway/:id | Admin | Update a gateway |
| DELETE | /gateway/:id | Admin | Delete a gateway |
Locations
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /locations | Auth | List all locations |
| POST | /locations | Admin | Create a location |
| PUT | /locations/:id | Admin | Update a location |
| DELETE | /locations/:id | Admin | Delete a location |
Maps
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /maps | Auth | List all maps |
| POST | /maps/upload | Admin | Upload a new map image |
| GET | /map/:id | Auth | Get map details |
| PUT | /map/:id | Admin | Update map metadata |
| DELETE | /map/:id | Admin | Delete a map |
| GET | /maps/image | Auth | Get map image file |
| GET | /maps/:id/zones | Auth | Get zones for a map |
| GET | /maps/:id/gateways | Auth | Get gateways for a map |
| POST | /maps/:id | Admin | Save zones and gateway positions |
| GET | /maps/overview | Auth | Get map overview data |
Events & Logs
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /events | Auth | List beacon events |
| GET | /events/export | Admin | Export events as CSV |
| GET | /logs | Auth | List system logs |
Tracking
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /tracking/start/:alg | Admin | Start tracking with algorithm |
| POST | /tracking/stop | Admin | Stop tracking |
| GET | /tracking/status | Auth | Get tracking status |
| GET | /tracking/algorithms | Auth | List available algorithms |
| GET | /tracking/:id | Auth | Get tracking data for a beacon |
Floors (Navigation)
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /floors | Auth | List all floors |
| POST | /floors | Admin | Create a floor |
| GET | /floor/:id | Auth | Get floor details |
| PUT | /floor/:id | Admin | Update a floor |
| DELETE | /floor/:id | Admin | Delete a floor |
| GET | /floor/:id/nodes | Auth | Get nodes for a floor |
| GET | /floor/:id/edges | Auth | Get edges for a floor |
| GET | /floor/:id/graph | Auth | Get full navigation graph for a floor |
| POST | /floor/:id/graph | Admin | Save navigation graph for a floor |
Nodes & Edges
| Method | Path | Auth | Description |
|---|---|---|---|
| PUT | /node/:id | Admin | Update a node |
| DELETE | /node/:id | Admin | Delete a node |
| PUT | /edge/:id | Admin | Update an edge |
| DELETE | /edge/:id | Admin | Delete an edge |
Navigation
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /navigation/tokens | Admin | List navigation tokens |
| POST | /navigation/tokens | Admin | Create a navigation token |
| DELETE | /navigation/token/:id | Admin | Delete a navigation token |
| GET | /navigation/project/:id | Token/Auth | Get navigation bundle for a location |
| POST | /navigation/pathfind | Token/Auth | Find shortest path between nodes |
| GET | /navigation/floor/:id/map | Token/Auth | Get floor map image |
LLD (Zabbix Low-Level Discovery)
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /lld/beacons | None | LLD data for beacons |
| GET | /lld/gateways | None | LLD data for gateways |
Import
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /import/beacons | Admin | Bulk import beacons |
| POST | /import/gateways | Admin | Bulk import gateways |
Status & Version
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /version | None | Server version and build info |
| GET | /status/kiss | Auth | KISS service status |
| GET | /status/mqtt | Auth | MQTT connection status |
Deploy
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /deploy | None | Deployment webhook (e.g. GitHub) |
Static Files
| Method | Path | Description |
|---|---|---|
| GET | / | Web UI index page |
| GET | /index.html | Web UI index page |
| GET | /css/:filename | CSS files |
| GET | /js/:filename | JavaScript files |
| GET | /images/:filename | Image files |
| GET | /webfonts/:filename | Web font files |
Auth Levels
- None: No authentication required
- Auth: Valid JWT required (any user)
- Admin: Valid JWT with admin role required
- Token/Auth: Either a navigation token or JWT auth