Add service health checks and dynamic Apps page
Backend polls each registered service's /health endpoint every 30 s via a background asyncio task. GET /api/services exposes the live status snapshot. The Apps page now renders from this endpoint — showing "Unavailable" (dimmed, non-clickable) when a service is registered but its container is unreachable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+13
-5
@@ -40,6 +40,14 @@ JWT signing uses a 4096-bit RSA key pair (`RS256`). Keys are generated by `scrip
|
||||
| `GET` | `/api/admin/users` | List all users (admin only) |
|
||||
| `PATCH` | `/api/admin/users/{id}` | Update user (role, active flag) |
|
||||
|
||||
### Services (`/api/services`)
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| `GET` | `/api/services` | Returns health status of all registered feature services |
|
||||
|
||||
A background task (`service_health.py`) polls each service's `/health` endpoint every 30 s and stores the result in memory. The first check runs immediately on startup. Any authenticated user may call `GET /api/services`; the frontend uses it to drive app card visibility.
|
||||
|
||||
### Settings (`/api/settings`)
|
||||
|
||||
| Method | Path | Description |
|
||||
@@ -80,11 +88,11 @@ Browser (port 5173 dev / 80 prod)
|
||||
│
|
||||
└── /api/* → backend:8000 (FastAPI)
|
||||
│
|
||||
┌───────────┼────────────┐
|
||||
/auth /settings /documents/*
|
||||
/users (JSON │
|
||||
/admin volume) └── proxy → doc-service:8001
|
||||
/profile
|
||||
┌───────────┼────────────┬──────────────┐
|
||||
/auth /settings /documents/* /services
|
||||
/users (JSON │ │
|
||||
/admin volume) └── proxy → health-check loop
|
||||
/profile doc-service:8001 (30s poll)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user