quickstart-express-ts
v1.0.1
Published
One command to create Express + TypeScript + MongoDB + JWT Auth backend projects
Downloads
181
Maintainers
Readme
QuickStart Express TS
⚡ One command to launch your Express + TypeScript + MongoDB + JWT Auth backend in seconds!
🚀 Quick Start
npx quickstart-express-ts my-api
cd my-api
npm install
cp .env.example .env
npm run dev✨ Features
- Express.js with TypeScript setup
- MongoDB + Mongoose ODM integration
- JWT Authentication with register/login/profile
- Security Middleware (Helmet, CORS, rate limiting)
- Production-ready error handling & logging
- Environment configuration with validation
- ESLint & Prettier for code quality
- VSCode settings for optimal development
📦 Installation & Usage
Using npx (Recommended)
npx quickstart-express-ts project-nameGlobal Installation
npm install -g quickstart-express-ts
quickstart-express-ts project-name🏗️ Generated Project Structure
project-name/
├── src/
│ ├── app.ts # Express app configuration
│ ├── server.ts # Server entry point
│ ├── config/ # Environment & database config
│ ├── models/ # Mongoose models (User)
│ ├── controllers/ # Route controllers
│ ├── routes/ # Route definitions
│ ├── middleware/ # Auth & error middleware
│ └── utils/ # Token, logger utilities
├── package.json
├── tsconfig.json
├── .env.example
└── README.md🔐 Ready-to-Use API Endpoints
| Method | Endpoint | Description | Auth Required |
|--------|----------|-------------|---------------|
| POST | /api/v1/auth/register | Register new user | ❌ |
| POST | /api/v1/auth/login | Login user | ❌ |
| GET | /api/v1/auth/profile | Get user profile | ✅ |
| GET | /health | Health check | ❌ |
🛡️ Built-in Security
- ✅ Helmet.js - Security headers
- ✅ CORS - Cross-origin protection
- ✅ Rate Limiting - Prevent brute force attacks
- ✅ Data Sanitization - NoSQL & XSS protection
- ✅ JWT Tokens - Secure authentication
- ✅ Password Hashing - Bcrypt encryption
- ✅ Environment Validation - Required config checks
