create-nest-architect
v1.0.8
Published
A simple CLI that creates a new project for NestJS with an architecture of your choice and orm or odm configured
Maintainers
Readme
nest-architect
Generate NestJS applications with pre-configured architecture patterns and ready-to-use ORM/ODM setup.
Installation
npm create nest-architect@latest my-appQuick Start
# Create your project
npm create nest-architect@latest my-app
# Navigate to project
cd my-app
# Install dependencies
npm install
# Configure your database connection
# Edit .env file with your database credentials
# Start development
npm run start:devUsage
When you run the command, you'll be prompted to choose:
? Choose your project architecture:
❯ 🏷️ Featured Architecture
🏛️ Clean Architecture
? Select the database type for your project:
❯ 🗃️ SQL
📦 NoSQL
? Which ORM/ODM would you like to set up?
❯ 📦 Prisma (SQL)
📦 Mongoose (NoSQL)Architectures
🏷️ Featured Architecture
Organizes code by features/resources. Each feature contains all related files (controllers, services, entities) in its own folder.
Template: create-nest-architect-template-featured
🏛️ Clean Architecture
4-layer architecture that separates concerns and maintains independence from external tools and libraries.
Template: create-nest-architect-template-clean
What You Get
- ✅ Pre-configured NestJS project with chosen architecture
- ✅ ORM/ODM setup with examples and best practices
- ✅ ConfigService configured for environment variables
- ✅ Ready-to-use project structure
- ✅ Example models and basic CRUD operations
Requirements
- Node.js
- npm
- git
- Database (PostgreSQL, MySQL, MongoDB, etc.)
Database Setup
📦 Prisma (SQL)
- Configure your database provider in
prisma/schema.prisma - Add your entities to the schema
- Create
.envfile and set yourDATABASE_URL - Run migration:
npx prisma migrate dev - Start your application
📦 Mongoose (NoSQL)
- Create your entities using Mongoose decorators (see generated examples)
- Create modules with
MongooseModulefor each entity (see generated examples) - Create
.envfile and set yourDATABASE_URLfor MongoDB connection - Start your application
📚 NestJS Mongoose Documentation
Contributing
Contributions are welcome! Feel free to submit issues and pull requests.
Missing an architecture pattern or ORM/ODM? Open an issue or submit a PR.
Thanks
License
MIT ©
