Skip to content

Business operating system for Claude Code — 57 skills, 21 agents, smart daemon. Unified inbox (WhatsApp/Email/Slack/Telegram), autonomous PR merge, full-AWS monitoring, revenue (Stripe+RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4), voice (Bland/ElevenLabs), APM (Datadog/NewRelic/OTEL), YOLO mode.

feat(09-04): NestJS API template with Fastify, JWT auth, BullMQ, Prisma

auroracapitalf779a389b138
diff --git a/claude-ops/.gitignore b/claude-ops/.gitignore
index 12853f8d..20ec036f 100644
--- a/claude-ops/.gitignore
+++ b/claude-ops/.gitignore
@@ -1,6 +1,7 @@
node_modules/
.env
.env.*
+!templates/**/.env.example
.DS_Store
*.swp
*.swo
diff --git a/claude-ops/templates/nestjs-api/.env.example b/claude-ops/templates/nestjs-api/.env.example
new file mode 100644
index 00000000..7be1c290
--- /dev/null
+++ b/claude-ops/templates/nestjs-api/.env.example
@@ -0,0 +1,4 @@
+DATABASE_URL=postgresql://postgres:postgres@localhost:5432/nestapp
+JWT_SECRET=change-me-to-a-random-secret-32-chars-min
+REDIS_HOST=localhost
+PORT=3000
diff --git a/claude-ops/templates/nestjs-api/Dockerfile b/claude-ops/templates/nestjs-api/Dockerfile
new file mode 100644
index 00000000..77939796
--- /dev/null
+++ b/claude-ops/templates/nestjs-api/Dockerfile
@@ -0,0 +1,16 @@
+FROM node:20-alpine AS builder
+WORKDIR /app
+COPY package*.json ./
+RUN npm ci
+COPY . .
+RUN npx prisma generate
+RUN npm run build
+
+FROM node:20-alpine AS runner
+WORKDIR /app
+ENV NODE_ENV=production
+COPY --from=builder /app/dist ./dist
+COPY --from=builder /app/node_modules ./node_modules
+COPY --from=builder /app/package.json ./
+EXPOSE 3000
+CMD ["node", "dist/main"]
diff --git a/claude-ops/templates/nestjs-api/README.md b/claude-ops/templates/nestjs-api/README.md
new file mode 100644
index 00000000..94ca92b7
--- /dev/null
+++ b/claude-ops/templates/nestjs-api/README.md
@@ -0,0 +1,89 @@
+# NestJS API Template
+
+Production-ready NestJS API starter with Fastify, JWT auth, BullMQ job queue, Redis, Prisma ORM, and health checks.
+
+## Features
+
+- **Fastify adapter** — faster than Express, drop-in replacement
+- **JWT authentication** — register/login endpoints, Passport JWT strategy
+- **BullMQ job queue** — Redis-backed queue with example processor
+- **Prisma ORM** — PostgreSQL with type-safe client and migrations
+- **Health endpoint** — `GET /health` with database liveness check via `@nestjs/terminus`
+- **Docker + docker-compose** — multi-stage build, PostgreSQL 16, Redis 7
+- **Config module** — environment variables validated at startup
+
+## Prerequisites
+
+- Node 20+
+- Docker (for local infrastructure)
+- PostgreSQL 16 (or use docker-compose)
+- Redis 7 (or use docker-compose)
+
+## Quick Start
+
+```bash
+# 1. Install dependencies
+npm install
+
+# 2. Copy environment file and fill in values
+cp .env.example .env
+
+# 3. Generate Prisma client and push schema
+npx prisma generate
+npx prisma db push
+
+# 4. Start development server
+npm run start:dev
+```
+
+## Environment Variables
+
+| Variable | Description | Example |
+| -------------- | ------------------------------------ | ---------------------------------------------------- |
+| `DATABASE_URL` | PostgreSQL connection string | `postgresql://postgres:postgres@localhost:5432/nestapp` |
+| `JWT_SECRET` | Secret for signing JWT tokens (32+ chars) | `change-me-to-a-random-secret-32-chars-min` |
+| `REDIS_HOST` | Redis hostname | `localhost` |
+| `PORT` | HTTP port (default 3000) | `3000` |
+
+## API Endpoints
+
+| Method | Path | Auth | Description |
+| ------ | ---------------- | -------- | ---------------------- |
+| POST | `/auth/register` | None | Create account, get JWT |
+| POST | `/auth/login` | None | Login, get JWT |
+| GET | `/health` | None | Database liveness check |
+
+### Register
+
+```bash
+curl -X POST http://localhost:3000/auth/register \
+ -H 'Content-Type: application/json' \
+ -d '{"email":"[email protected]","password":"secret"}'
+```
+
+### Login
+
+```bash
+curl -X POST http://localhost:3000/auth/login \
+ -H 'Content-Type: application/json' \
+ -d '{"email":"[email protected]","password":"secret"}'
+```
+
+## Docker
+
+Start the full stack (app + PostgreSQL + Redis):
+
+```bash
+docker-compose up --build
+```
+
+The API will be available at `http://localhost:3000`.
+
+## Deployment
+
+1. Set all environment variables in your hosting platform
+2. Run `npx prisma migrate deploy` before each release
+3. Build the Docker image: `docker build -t nestjs-api .`
+4. Run with `NODE_ENV=production`
+
+Recommended platforms: Railway, Render, AWS ECS Fargate, Fly.io.
diff --git a/claude-ops/templates/nestjs-api/docker-compose.yml b/claude-ops/templates/nestjs-api/docker-compose.yml
new file mode 100644
index 00000000..dcf33be4
--- /dev/null
+++ b/claude-ops/templates/nestjs-api/docker-compose.yml
@@ -0,0 +1,25 @@
+version: '3.8'
+services:
+ app:
+ build: .
+ ports:
+ - '3000:3000'
+ env_file: .env
+ depends_on:
+ - postgres
+ - redis
+ postgres:
+ image: postgres:16-alpine
+ environment:
+ POSTGRES_DB: nestapp
+ POSTGRES_USER: postgres
+ POSTGRES_PASSWORD: postgres
+ volumes:
+ - pgdata:/var/lib/postgresql/data
+ redis:
+ image: redis:7-alpine
+ volumes:
+ - redisdata:/data
+volumes:
+ pgdata:
+ redisdata:
diff --git a/claude-ops/templates/nestjs-api/prisma/schema.prisma b/claude-ops/templates/nestjs-api/prisma/schema.prisma
new file mode 100644
index 00000000..feff006b
--- /dev/null
+++ b/claude-ops/templates/nestjs-api/prisma/schema.prisma
@@ -0,0 +1,16 @@
+generator client {
+ provider = "prisma-client-js"
+}
+
+datasource db {
+ provider = "postgresql"
+ url = env("DATABASE_URL")
+}
+
+model User {
+ id String @id @default(uuid())
+ email String @unique
+ password String
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
+}
diff --git a/claude-ops/templates/nestjs-api/src/queue/processors/example.processor.ts b/claude-ops/templates/nestjs-api/src/queue/processors/example.processor.ts
new file mode 100644
index 00000000..5aa26051
--- /dev/null
+++ b/claude-ops/templates/nestjs-api/src/queue/processors/example.processor.ts
@@ -0,0 +1,13 @@
+import { Process, Processor } from '@nestjs/bull';
+import { Logger } from '@nestjs/common';
+import { Job } from 'bull';
+
+@Processor('example')
+export class ExampleProcessor {
+ private readonly logger = new Logger(ExampleProcessor.name);
+
+ @Process()
+ async handle(job: Job<{ message: string }>) {
+ this.logger.log(`Processing job ${job.id}: ${job.data.message}`);
+ }
+}