The frontend and backend communicate over HTTP on localhost. This document is the canonical list of endpoints, kept in sync with backend/app/main.py and the per-module routers.
- Dev:
http://127.0.0.1:8000 - Packaged:
http://127.0.0.1:${window.__BACKEND_PORT__}(set by the Tauri shell at boot)
All request/response shapes are Pydantic models in backend/app/schemas/. The TS frontend imports them from @mercury/shared-types, which is regenerated from /openapi.json.
After changing any model or route signature:
pnpm gen:typesCommit the updated packages/shared-types/src/generated.ts in the same PR.
Owners populate this table as endpoints land. Format: METHOD path → response.
| Method | Path | Body | Response | Notes |
|---|---|---|---|---|
| GET | /healthz |
— | { status: "ok" } |
liveness probe |
| Method | Path | Body | Response | Notes |
|---|---|---|---|---|
| (planned) | /feeds/* |
see backend/feed_engine/AGENT.md |
| Method | Path | Body | Response | Notes |
|---|---|---|---|---|
| (planned) | /content/* |
see backend/content_cleaner/AGENT.md |
| Method | Path | Body | Response | Notes |
|---|---|---|---|---|
| (planned) | /agents/summary/* |
see backend/agent_summary/AGENT.md |
| Method | Path | Body | Response | Notes |
|---|---|---|---|---|
| (planned) | /agents/translation/* |
see backend/agent_translation/AGENT.md |
A breaking change is:
- Removing or renaming a route, query param, or response field
- Changing a response field's type
- Making a previously-optional field required
Before merging a breaking change:
- Coordinate with the UI engineer (member 5) and any downstream module owners
- Update both the backend and the UI in the same PR (or in two sequenced PRs the same day)
- Note the change in the PR description
Additions (new endpoint, new optional field) are non-breaking and do not require coordination beyond review.
All errors return JSON:
{
"detail": "human-readable message",
"code": "MACHINE_READABLE_CODE",
"context": {}
}4xxfor user errors (bad input, not found)5xxfor internal errors (DB unavailable, upstream provider down)- Never raise an unhandled exception; FastAPI converts those to opaque 500s
Use HTTPException from FastAPI with a structured detail.