ServerRoutes & API
Overview
Routing, Hono integration, RPC contract exposure, and route architecture.
The CRM server uses Hono for HTTP routing with a single router factory (createHonoRouter) in routes/index.ts.
Key Concepts
- Route Factory:
createHonoRoutercomposes all feature routes - RPC Types: Frontend derives types from routes at build-time
- Feature Groups: Routes grouped per feature (CRUD, Flows, Dynamic Objects, Extensions)
File Structure
routes/
├── index.ts # Main router factory
├── gen/ # Auto-generated routes from Prisma
├── flows.routes.ts # Flow execution endpoints
└── dynamic.routes.ts # Dynamic object endpointsQuick Navigation
- Architecture — Router composition and context
- API Reference — Endpoint documentation
- Runbook — Troubleshooting routes