create-nodets-app-nish
v1.0.8
Published
Command line tool to create a new Node.js + Express + MongoDB + TypeScript project template
Maintainers
Readme
create-nodets-app-nish
🚀 A command-line tool to create a new Node.js + Express + MongoDB + TypeScript project with best practices and sensible defaults.
Installation
npm create nodets-app-nishOr with a project name:
npm create nodets-app-nish my-appUsage
Interactive Mode
npm create nodets-app-nishYou'll be prompted to enter your project name.
With Project Name
npm create nodets-app-nish my-awesome-app
cd my-awesome-app
npm install
npm run devWhat's Included
The generated project includes:
- ✨ TypeScript - Full TypeScript support out of the box
- 🚀 Express.js - Fast and lightweight web framework
- 🗄️ MongoDB - Document database with Mongoose ODM
- 🔐 Authentication - JWT tokens with bcrypt password hashing
- 📧 Email Integration - Nodemailer for email sending
- 🏗️ Clean Architecture - Well-organized folder structure
- ♻️ Hot Reload - Nodemon for development
- 🏭 Production Ready - Build scripts for compilation
Package Contents
templates/
└── nodejs-typescript/
├── src/
│ ├── index.ts # Entry point
│ ├── app.ts # Express app config
│ ├── admin/ # Admin module
│ │ └── model.register.ts
│ ├── controllers/ # Route controllers
│ ├── db/ # Database setup
│ ├── interface/ # TypeScript interfaces
│ ├── middlewares/ # Custom middlewares
│ ├── models/ # Mongoose models
│ ├── routers/ # API routes
│ └── utils/ # Helper functions
├── package.json
├── tsconfig.json
├── .env.example
└── .gitignore
bin/
└── index.js # CLI entry pointGetting Started with Generated Project
cd my-app
npm install
cp .env.example .env
# Edit .env with your configuration
npm run devAvailable Scripts
npm run dev # Start development server with hot reload
npm run build # Build TypeScript to JavaScript
npm start # Run compiled applicationConfiguration
The generated project includes a .env.example file. Copy it to .env and configure:
PORT=3000
MONGODB_URI=mongodb://localhost:27017/your-app
JWT_SECRET=your-secret-key
CORS_ORIGIN=http://localhost:3000
# Email Configuration
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
[email protected]
SMTP_PASS=your-app-password
[email protected]Features
Admin Model with Authentication
- User registration with password hashing (bcrypt)
- JWT token generation
- Password verification
- MongoDB/Mongoose integration
Utility Functions
- apiResponse - Standardized API response formatter
- asyncHandler - Express async/await error handling
- login - Login utility for different models
- sendMail - Email sending via SMTP
Production Ready
- TypeScript strict mode enabled
- ESM modules support
- Comprehensive tsconfig setup
- Security best practices included
How It Works
- User runs
npm create nodets-app my-app - CLI prompts for project name
- Creates project directory
- Copies template files
- Updates package.json with project name
- Ready to install and develop!
Publishing to npm
- Create npm account at npmjs.com
- Login locally:
npm login - Publish:
npm publish
After publishing, users can use your template:
npx create-nodets-app my-projectLicense
ISC
Author
krish112407
Made with ❤️ for Node.js developers | Based on professional backend architecture
