nestjs-expert

Guides NestJS backend development with TypeORM, PostgreSQL multi-tenancy, and Jest testing.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/SleyiW/iWana-neXt --skill nestjs-expert-sleyiw
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nestjs-expert
Source: https://github.com/SleyiW/iWana-neXt/tree/main/.agents/skills/nestjs-expert
Command: npx skills add https://github.com/SleyiW/iWana-neXt --skill nestjs-expert-sleyiw

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building a consistent NestJS backend in a modulith monorepo requires enforcing module boundaries, tenant-aware data access, security controls, and testing discipline. This Skill encodes those architectural decisions so backend work stays aligned with the repository baseline instead of drifting into circular imports, unvalidated endpoints, or off-baseline ORMs. ## Core Features & Use Cases - Modulith boundary enforcement: Rules for module-per-feature structure, no cross-module table access, no circular imports, and typed interfaces or domain events for internal integration. - Data and security standards: TypeORM with versioned reversible migrations, PostgreSQL schema-per-tenant resolution, RS256 JWT configuration, DTO validation, and explicit authorization guards. - Testing and API contracts: Jest unit tests, Supertest integration tests, OpenAPI updates when HTTP contracts change, and an implementation checklist for every change. - Use Case: When adding a new customers module with a REST endpoint, apply this Skill to place providers in the correct boundary, validate payloads, wire RS256 authentication, update OpenAPI, and add Supertest coverage for unauthorized requests. ## Quick Start Ask the AI to create a new NestJS module with a controller, service, TypeORM entity, and integration tests following the repo's modulith and multi-tenant conventions.

Frequently Asked Questions about nestjs-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a NestJS module in a modulith architecture?

Create one module per feature with its own controller, service, repository, and TypeORM entities registered via TypeOrmModule.forFeature. Export only the service other modules need, and never import another module's internal tables or create circular dependencies.

How do I test NestJS controllers with Supertest?

Use Jest with Supertest against the application's HTTP server to verify controller contracts, such as expecting a 401 status for unauthenticated requests. Reserve mocks for genuinely external dependencies and run typecheck, unit, integration, then e2e tests in order.

How do I configure RS256 JWT authentication in NestJS?

Load the private and public PEM keys via ConfigService from JWT_PRIVATE_KEY and JWT_PUBLIC_KEY, normalizing literal \n sequences with replace. Configure JwtModule.registerAsync with signOptions algorithm RS256 and verifyOptions algorithms restricted to RS256.

Can I use Prisma or Mongoose instead of TypeORM in a NestJS project?

In this repository baseline, no. TypeORM is the approved ORM with versioned reversible migrations, and introducing Mongoose, Prisma, or MongoDB is an explicit anti-pattern that falls outside the backend's approved data layer.

How does PostgreSQL schema-per-tenant multi-tenancy work in NestJS?

Each authenticated request resolves to a tenant-specific PostgreSQL schema, and TypeORM queries are scoped to that schema per request. This isolates tenant data at the database level while keeping a single application deployment.

When should I not use a modulith backend approach?

Avoid forcing microservices when the repository is designed as a modulith with explicit module boundaries. Also skip this guidance for purely frontend tasks or infrastructure decisions that do not involve the NestJS backend itself.