A powerful and customizable Express application generator with full TypeScript support.
- Express Generator TypeScript
Express Generator TypeScript creates new Express applications configured with TypeScript, similar to the official express-generator but with modern best practices, TypeScript integration, and additional features.
The generated application includes:
- Complete TypeScript configuration
- Modern project structure with proper separation of concerns
- ESLint with TypeScript support
- Built-in development tools (hot reloading, testing)
- Optional database integration
- Optional authentication support
- Optional websocket support
- Optional view engine integration
- Type Safety: Full TypeScript integration for robust application development
- Modular Architecture: Clean separation of routes, controllers, services, and models
- Developer Experience: Hot reloading for rapid development cycles
- Flexibility: Customizable configurations to match project requirements
- Production Ready: Optimized build configurations for deployment
- Testing Setup: Pre-configured testing environment
# No installation needed, run directly with npx
npx express-generator-typescript# Install globally using yarn (recommended)
yarn global add express-generator-typescript
# Or using npm
npm install -g express-generator-typescriptWith default options:
npx express-generator-typescriptWith a custom project name:
npx express-generator-typescript "my-express-app"The generator will prompt you for various options to customize your project:
- Project name
- Database support (Sequelize, TypeORM, Prisma, Mongoose)
- Authentication (Passport, JWT, Express-session)
- WebSockets (Socket.io, WS)
- View engines (EJS, Pug, Handlebars)
# Navigate to your project
cd my-express-app
# Install dependencies
yarn
# Start development server with hot reloading
yarn devYour application will be available at http://localhost:3000/.
The generator creates a well-organized project structure with proper separation of concerns:
my-express-app/
├── src/
│ ├── bin/ # Application startup
│ ├── config/ # Configuration files
│ ├── controllers/ # Route controllers
│ ├── middleware/ # Express middlewares
│ ├── migrations/ # Database migrations
│ ├── models/ # Data models
│ ├── public/ # Static assets
│ │ ├── css/ # Stylesheets
│ │ ├── js/ # Client-side JavaScript
│ │ └── images/ # Images
│ ├── routes/ # Express routes
│ ├── services/ # Business logic services
│ ├── sockets/ # WebSocket handlers (if enabled)
│ └── utils/ # Utility functions
├── .env # Environment variables
├── .gitignore # Git ignore file
├── package.json # Project dependencies and scripts
├── README.md # Project documentation
├── server.ts # Application entry point
└── tsconfig.json # TypeScript configuration
Additional directories may be generated based on your selected options:
- Database integration: Creates appropriate configuration files and model examples
- Authentication: Generates auth middleware, strategies, and controllers
- WebSockets: Sets up Socket.io or WS configuration
- View Engine: Configures template directories for EJS, Pug, or Handlebars
Choose from:
- Sequelize: SQL ORM with support for PostgreSQL, MySQL, SQLite, and more
- TypeORM: TypeScript-first ORM for SQL databases
- Prisma: Next-generation ORM with type-safety and auto-generated queries
- Mongoose: MongoDB ODM for Node.js
Choose from:
- Passport.js: Comprehensive authentication middleware
- JWT: JSON Web Token authentication
- Express-session: Session-based authentication
Choose from:
- Socket.io: Feature-rich real-time communication
- WS: Lightweight WebSocket implementation
Choose from:
- EJS: Embedded JavaScript templates
- Pug: High-performance template engine (formerly Jade)
- Handlebars: Minimal templating on steroids
In your generated project, you can use these scripts:
# Start development server with hot reloading
yarn dev
# Build for production
yarn build
# Start production server
yarn start
# Run tests
yarn test
# Lint code
yarn lint
# Check TypeScript errors
yarn type-checkContributions are welcome! Please feel free to submit a Pull Request.
For detailed information on project setup and development workflow, please see SETUP.md.
This project is licensed under the MIT License - see the LICENSE file for details.
