What the generated NestJS app contains
Module architecture
src/
├── app.module.ts # root module
├── auth/
│ ├── auth.module.ts
│ ├── auth.controller.ts # login, register, refresh, logout
│ ├── auth.service.ts
│ ├── guards/
│ │ ├── jwt.guard.ts # JwtAuthGuard
│ │ └── roles.guard.ts # RolesGuard
│ └── strategies/
│ └── jwt.strategy.ts # PassportJS JWT strategy
├── users/
│ ├── users.module.ts
│ ├── users.controller.ts
│ ├── users.service.ts
│ ├── dto/
│ │ ├── create-user.dto.ts
│ │ └── update-user.dto.ts
│ └── entities/
│ └── user.entity.ts # TypeORM entity
└── {entity}/ # one module per entity in your PRD
├── {entity}.module.ts
├── {entity}.controller.ts
├── {entity}.service.ts
├── dto/
└── entities/
TypeORM entities and migrations
- TypeORM entity for every entity in your PRD
- Relationship decorators:
@OneToMany,@ManyToOne,@ManyToMany - Column definitions matching your data model: types, nullability, indexes
- TypeORM migration for every entity and field change
workspace_id/organization_idon every multi-tenant entity- Repository pattern with workspace-scoped
findAll()andfindOne()methods
Authentication and authorization
JwtAuthGuard(PassportJS +@nestjs/jwt) — protects every controller method@Roles()decorator +RolesGuardfor role-based access- JWT in httpOnly cookies — not in Authorization headers, not in localStorage
- Refresh token rotation
@UseGuards(JwtAuthGuard, RolesGuard)applied at controller level — no unguarded routes
DTOs and validation
class-validatordecorators on all DTO classesValidationPipeglobally applied — invalid input returns 422- Swagger decorators (
@ApiProperty,@ApiResponse) on all DTOs and controllers - Auto-generated Swagger UI at
/api/docs
Error handling
- Global
HttpExceptionFilter— consistent error response format {"error": "snake_case_code", "message": "Human readable description."}- Correct HTTP status codes: 201 creation, 422 validation, 403 auth, 404 not found
Tests
- Jest test suite
- Unit tests for each service (mocked TypeORM repositories)
- E2E tests for each controller (using
supertestand a test database) - Auth test: login → get token → protected route → assert 200; no token → assert 401
Infrastructure
- Multi-stage Dockerfile (Node base → build → production)
docker-compose.yml: NestJS app + PostgreSQL + Redis (when queues included)- GitHub Actions: ESLint → tsc → jest → build → deploy
TypeScript strict mode
The generated NestJS code compiles with strict: true in tsconfig.json:
- No
anytypes - No implicit
any - Strict null checks
tsc --noEmitpasses clean
vs Nest CLI boilerplate and nestjs-boilerplate GitHub repos
nest new my-app gives you an application scaffold in 60 seconds. Popular GitHub NestJS boilerplates add auth, TypeORM, and a module structure. These solve the framework setup problem.
What they don't give you: your specific entities, your business logic, your API routes matched to your OpenAPI spec, your migrations, your product-specific tests. Archiet generates the product layer on top of the framework setup — and does it from your requirements document.
CTA
Generate a complete NestJS + Next.js application from your requirements — free plan, no credit card.
Describe your product or upload a PRD, pick NestJS + Next.js, get a production-ready TypeScript codebase in 90 seconds.
Start free at archiet.com.