Development
Local development workflow, project structure, and package conventions.
Running Individual Apps
# Run all apps together
bun run dev
# Run a single app with Turbo filter
bun run dev --filter=app
bun run dev --filter=api
bun run dev --filter=docsApp Overview
| App | Port | Tech |
|---|---|---|
apps/web | 3000 | Next.js 16 + shadcn/ui |
apps/api | 3002 | Hono + Bun |
apps/docs | 3004 | FumaDocs (this site) |
apps/email | — | React Email preview |
apps/storybook | — | Storybook |
Package Conventions
Environment Variables
Every package exports a keys() function with Zod validation:
// packages/auth/keys.ts
export const keys = () =>
createEnv({
server: { BETTER_AUTH_SECRET: z.string().min(16) },
runtimeEnv: { BETTER_AUTH_SECRET: process.env.BETTER_AUTH_SECRET },
});Apps compose these in their env.ts:
// apps/web/env.ts
export const env = createEnv({
extends: [auth(), database(), payments()],
});Internal Package Imports
All internal packages use the @repo/* namespace with workspace protocol:
{
"dependencies": {
"@repo/database": "workspace:*",
"@repo/auth": "workspace:*"
}
}Background Jobs (Trigger.dev)
Tasks live in packages/trigger/tasks/:
import { task } from '@trigger.dev/sdk/v3';
export const myTask = task({
id: 'my-task',
run: async (payload: { userId: string }) => {
// task logic
},
});