CLI tool that scaffolds a production-ready NestJS project with a pre-defined architecture, directory structure, and dependencies already installed.
- Node.js 18+
- NestJS CLI:
npm i -g @nestjs/cli - One of:
pnpm,npm, oryarn - Redis 6+ (required by the
cleanarchitecture for token blacklisting and rate limiting)
Clone this repository and make the scripts executable:
git clone <repo-url>
cd cnnp
chmod +x cnnp architectures/cleanOptionally, add it to your PATH so you can run it from anywhere:
echo 'export PATH="$PATH:/path/to/cnnp"' >> ~/.zshrc
source ~/.zshrccnnp --pn <project-name> --pk <package-manager> --a <architecture>| Flag | Alias | Description | Required |
|---|---|---|---|
--pn |
--project-name |
Project name | ✅ |
--pk |
--package |
Package manager: pnpm | npm | yarn |
✅ |
--a |
--architecture |
Architecture type: clean |
✅ |
--dir |
--directory |
Target directory (defaults to current) | ❌ |
--skip-install |
Skip dependency installation | ❌ | |
--skip-git |
Skip git initialization | ❌ |
cnnp --pn auth-api --pk pnpm --a clean
cnnp --pn users-service --pk npm --a clean --dir ./projects
cnnp --pn payment-api --pk yarn --a clean --skip-installHexagonal/Clean architecture focused on domain isolation. Includes a full auth flow out of the box.
Generates a pre-filled .env.example at the project root — copy it to .env and fill in your secrets.
Database: PostgreSQL. Uses a trn schema for transactional data. Create it before running the app.
Cache / session store: Redis. Used for JWT token blacklisting, refresh token rotation, verification codes, and rate-limit counters via @nestjs/throttler.
See docs/architecture-clean.md for the complete structure and conventions.
See docs/database-setup.md for database configuration and schema conventions.
Made with ❤️ by Melvin Colmenares
