Skip to content

P0ND4/cnnp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cnnp banner

cnnp — Create New NestJS Project

Version Shell Node NestJS Platform

CLI tool that scaffolds a production-ready NestJS project with a pre-defined architecture, directory structure, and dependencies already installed.

Prerequisites

  • Node.js 18+
  • NestJS CLI: npm i -g @nestjs/cli
  • One of: pnpm, npm, or yarn
  • Redis 6+ (required by the clean architecture for token blacklisting and rate limiting)

Installation

Clone this repository and make the scripts executable:

git clone <repo-url>
cd cnnp
chmod +x cnnp architectures/clean

Optionally, add it to your PATH so you can run it from anywhere:

echo 'export PATH="$PATH:/path/to/cnnp"' >> ~/.zshrc
source ~/.zshrc

Usage

cnnp --pn <project-name> --pk <package-manager> --a <architecture>

Options

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

Examples

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-install

Architectures

clean

Hexagonal/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

About

CLI tool that scaffolds a production-ready NestJS project with a pre-defined architecture, directory structure, and dependencies already installed.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages