API Overview
API endpoints live in src/pages/api/ and follow file-based routing.
Route groups
/api/auth/*: login/signup/session verification flows/api/transactions/*: CRUD, bulk actions, template helpers/api/budgets/*and/api/budget/*: budget management and analytics/api/accounts/*: account CRUD, transfer, close/reopen/api/reports/*: report and drilldown views/api/workspace/*: workspace settings, members, invitations/api/admin/*: operational diagnostics and admin dashboards/api/mcp: MCP HTTP transport endpoint
Implementation pattern
Most route handlers follow this sequence:
- Validate authentication/session.
- Parse and validate request input.
- Call service-layer method in
src/services. - Return JSON or HTML fragment response.
Contract source of truth
- Primary spec file:
openapi.yml - Related docs:
openapi/README.md