1.0.4 • Published 7 months ago
@saikat7679dev/create-express-ts-app v1.0.4
Create Express TypeScript App
A CLI tool to scaffold a production-ready Express.js application with TypeScript, following best practices.
Features
- TypeScript with proper configuration
- Express.js with a well-structured architecture
- MongoDB integration with Mongoose (optional)
- Authentication with JWT
- Error Handling middleware
- Request Validation using Zod
- Logging system
- Environment Configuration
- API Documentation with Swagger/OpenAPI (optional)
- Testing setup with Jest
- Docker support (optional)
- ESLint and Prettier configuration
Quick Start
# Using npx (recommended)
npx create-express-ts-app my-api
# Or install globally
npm install -g create-express-ts-app
create-express-ts-app my-apiFollow the interactive prompts to configure your project.
Project Structure
The generated project follows a clean architecture:
my-api/
├── src/
│ ├── config/ # Application configuration
│ ├── controllers/ # Request handlers
│ ├── middleware/ # Express middleware
│ ├── models/ # Data models
│ ├── routes/ # Route definitions
│ ├── services/ # Business logic
│ ├── types/ # TypeScript type definitions
│ ├── utils/ # Utility functions
│ ├── app.ts # Express app setup
│ └── server.ts # Entry point
├── tests/ # Test files
├── .env.example # Environment variables example
├── .eslintrc.js # ESLint configuration
├── .prettierrc # Prettier configuration
├── jest.config.js # Jest configuration
├── package.json # Dependencies and scripts
└── tsconfig.json # TypeScript configurationOptions
During the setup, you can choose to:
- Enable/disable MongoDB integration
- Enable/disable Swagger documentation
- Enable/disable Docker support
Available Scripts
In your generated project, you can run:
npm run dev- Start development server with hot-reloadnpm run build- Build for productionnpm start- Run production buildnpm test- Run testsnpm run lint- Lint code
License
MIT