A Turbo monorepo with three main applications:
- Backend - NestJS API with Zod contracts for TypeScript
- Temporal - Workflow orchestration for async tasks and job scheduling
- Dashboard - Next.js frontend for client management and configuration
- Node.js >= 18.0.0
- pnpm >= 8.0.0
pnpm installRun all apps in development mode:
pnpm devRun specific apps:
# Backend only
pnpm --filter @broccoli/backend dev
# Temporal worker only
pnpm --filter @broccoli/temporal dev
# Dashboard only
pnpm --filter @broccoli/dashboard devBuild all apps:
pnpm buildBuild specific apps:
pnpm --filter @broccoli/backend build
pnpm --filter @broccoli/temporal build
pnpm --filter @broccoli/dashboard build
pnpm --filter @broccoli/contracts buildbroccoli/
├── apps/
│ ├── backend/ # NestJS API server
│ ├── temporal/ # Temporal workflow worker
│ └── dashboard/ # Next.js frontend
├── packages/
│ └── contracts/ # Shared Zod schemas and TypeScript types
├── turbo.json # Turbo configuration
├── pnpm-workspace.yaml # pnpm workspace configuration
└── package.json # Root workspace configuration
NestJS API server with:
- Zod contract validation
- TypeScript type safety
- CORS enabled for frontend communication
- Health check endpoint at
/health
Port: 4000 (default)
Temporal workflow orchestration worker:
- Handles async task execution
- Job scheduling capabilities
- Workflow and activity definitions
Requirements:
- Temporal server running (default:
localhost:7233) - Set
TEMPORAL_ADDRESSandTEMPORAL_NAMESPACEenvironment variables if needed
Next.js 14 frontend application:
- App Router architecture
- Tailwind CSS for styling
- TypeScript support
- Client management interface
Port: 3000 (default)
Shared Zod schemas and TypeScript types:
- API request/response schemas
- Workflow input/output schemas
- Type-safe contracts across all apps
Create .env.local files in each app directory as needed:
PORT=4000
FRONTEND_URL=http://localhost:3000TEMPORAL_ADDRESS=localhost:7233
TEMPORAL_NAMESPACE=defaultNEXT_PUBLIC_API_URL=http://localhost:4000pnpm dev- Start all apps in development modepnpm build- Build all appspnpm lint- Lint all appspnpm type-check- Type check all appspnpm format- Format code with Biome
The monorepo uses shared Zod contracts from @broccoli/contracts to ensure type safety across:
- API requests/responses
- Workflow inputs/outputs
- Frontend-backend communication
Import contracts in your code:
import { CreateClientRequestSchema, ClientResponse } from '@broccoli/contracts';Private