Documentation
API

Overview

Build APIs in a feature-first way with oRPC.

AI Skill for features

Prompt: Type /features in your Copilot / Cursor or other chat to use skill with the provided context.
/features Create a new feature "[featureName]" in `src/features/{scope}/[featureName]` where scope is one of: web, admin, dashboard, common.

Requirements:
- Use the standard feature structure from ai/skills/feature.md.
- Add model, service, and api folders.
- Optionally add actions for server actions.
- Define oRPC router and wire it in src/lib/orpc/router.ts.

API workflow in this project

We use oRPC and a feature-based structure.

A typical API feature lives here:

src/features/web/todo/

Inside a feature, your API usually has:

  • model/ for schemas and types
  • service/ for business logic
  • api/ for oRPC router
  • actions/ for optional server actions
  1. Define schemas in model/.
  2. Define business logic in service/.
  3. Define oRPC routes in api/{feature}.router.ts.

Optional steps

  1. Add server actions in actions/{feature}.ts for SSR-oriented flows.
  2. Expose router from src/lib/orpc/router.ts.
  3. Verify OpenAPI output at /openapi.json.

On this page