API Flows Overview
API flows show how HTTP requests traverse the worker and external services. Each route group has a dedicated page with sequence diagrams for key operations.
| Route group | Audience | Page |
|---|---|---|
/app/* | snr_usr (patients) | App flows |
/pro/* | snr_pro (doctors) | Pro flows |
/admin/* | snr_dash (dashboard) | Admin flows |
/scheduler/* | none (cron) | Scheduler flows |
Coverage
Section titled “Coverage”Sequence diagrams cover the main case journey endpoints. Admin configuration CRUD (review types, disease categories, coordinator mappings) is documented in API Reference without per-endpoint sequence diagrams — those are simple D1 read/write operations.
Common request path
Section titled “Common request path”sequenceDiagram participant Client participant Worker as second_opinion participant Auth as Auth Middleware participant JWKS as Key Service participant PX as Persistence participant D1 as D1 Client->>Worker: HTTP request + Authorization header Worker->>Auth: decrypt + verify JWT Auth->>JWKS: fetch public keys Auth->>PX: validate access token Auth-->>Worker: AuthUser context Worker->>D1: read/write Worker-->>Client: JSON response envelope
Response envelope
Section titled “Response envelope”All handlers return { status, message, data?, pagination? }. Middleware logs request/response to R2 (REQUEST_RESPONSE_LOGS).