Architecture
API Map
Source: apps/api-worker/src/index.ts
Current API Worker
Source: apps/api-worker/src/index.ts
| Method | Path | Status | Purpose |
|---|---|---|---|
GET | / | Implemented | Returns Hello Hono!. Smoke test only. |
GET | /health | Implemented | Returns { ok, service, time } for worker health. |
GET | /openapi.json | Implemented | Returns the first minimal OpenAPI document for local API exploration. |
GET | /docs | Implemented | Serves Scalar API Reference for the local worker. |
The current OpenAPI document is a small hand-authored skeleton. Zod/OpenAPI route registration is still planned.
Current Shell API Usage
Current facts:
- No
fetch(...)calls were found inapps/os-shell/src. QueryClientProvideris wired inapps/os-shell/src/providers, but nouseQuerycalls are active yet.openapi-fetchis installed but not used.mswis installed as a dev dependency but no handlers are present./app-dev/scalar-apiembeds the local Scalar docs athttp://localhost:8787/docs.- Local fixtures live in
packages/os-apps/src/shared/mock-data.tsand app-local arrays.
Planned First OS Shell APIs
| Method | Path | Scenario | Notes |
|---|---|---|---|
GET | /api/apps | App Store, registry inspection, community app discovery. | Should return manifest summaries, not executable UI. |
GET | /api/settings | Load synced shell display/user preferences. | Mirrors localStorage-backed settings. |
PATCH | /api/settings | Persist changed preferences. | Should accept partial updates. |
GET | /api/windows/layout | Restore persisted window sizes/positions across sessions. | Current local size persistence is localStorage only. |
PUT | /api/windows/layout | Save window layout hints. | Should be user/session scoped. |
GET | /api/user/session | Profile, shell identity, signed-in state. | Needed before real user-aware OS surfaces. |
API Ownership
- Hono worker owns HTTP routes, validation, and edge runtime behavior.
- Zod/OpenAPI owns request and response shape.
- Scalar can expose API docs and exploration.
- Shell apps should call typed clients through app-local API modules or shared API clients.
- Zustand should not hold remote data responses.