TypeScript Express Starter provides a robust starting point for building secure, scalable, and maintainable RESTful APIs.
It blends the flexibility and simplicity of Express with TypeScriptβs type safety, supporting rapid development without compromising code quality or maintainability.
-
Clean architecture and modular structure
-
Built-in security, logging, validation, and developer tooling
-
Instantly ready for both prototyping and production
-
β‘ TypeScript + Express β Modern JS with full type safety
-
π API Docs β Swagger/OpenAPI ready out-of-the-box
-
π‘ Security β Helmet, CORS, HPP, rate limiting
-
π§© Validation β Zod schema-based runtime validation
-
π Dependency Injection β Lightweight DI with tsyringe
-
π Database Integrations β Sequelize, Prisma, Mongoose, TypeORM, Knex, Drizzle, etc.
-
π Developer Tools β ESLint, Prettier, Jest, Docker, PM2, NGINX, Makefile
-
π§± Modular Architecture β Easily extendable and maintainable
-
π Production Ready β Docker, PM2, NGINX support
# Install globally
npm install -g typescript-express-starter
# Scaffold a new project
typescript-express-starter
cd my-app
# Run in development mode
npm run dev
-
Access the app: http://localhost:3000/
-
Auto-generated API docs: http://localhost:3000/api-docs
src/
βββ config/ # Configuration files, environment settings
βββ controllers/ # Request handling & response logic
βββ dtos/ # Data Transfer Objects for request/response
βββ exceptions/ # Custom exception classes
βββ interfaces/ # TypeScript interfaces and type definitions
βββ middlewares/ # Middlewares (logging, auth, error handling, etc.)
βββ repositories/ # Database access logic
βββ routes/ # API route definitions
βββ services/ # Business logic
βββ utils/ # Utility/helper functions
βββ app.ts # Express app initialization
βββ server.ts # Server entry point
.env # Default environment variables
.env.development.local # Development-specific variables
.env.production.local # Production-specific variables
.env.test.local # Test-specific variables
nodemon.json # Nodemon variables
swagger.yaml # Swagger API documentation
tsconfig.jsnon # TypeScript variables
Category | Tools / Configs | Description |
---|---|---|
Code Formatter / Linter | biome , prettier, eslint |
Code formatting & linting rules |
Build / Bundler | swc , tsup |
Build & bundling configuration |
Testing | jest , vitest |
Unit & integration testing frameworks |
Process Manager | pm2 |
Manage and monitor Node.js processes |
CI/CD | github |
GitHub Actions workflow settings |
Git Hooks | husky |
Pre-commit / pre-push hooks for lint/test |
Containerization | docker |
Docker & docker-compose setup for deployment |
This categorization helps developers quickly understand what each tool is used for without checking every folder.
Choose your preferred stack during setup! Support for major databases and patterns via CLI:
Template | Stack / Integration |
---|---|
Default | Express + TypeScript |
Sequelize | Sequelize ORM |
Mongoose | MongoDB ODM (Mongoose) |
TypeORM | TypeORM |
Prisma | Prisma ORM |
Knex | SQL Query Builder |
GraphQL | GraphQL support |
Typegoose | TS-friendly Mongoose |
Mikro ORM | Data Mapper ORM (multi-DB) |
Node Postgres | PostgreSQL driver (pg) |
Drizzle | Drizzle |
More templates are regularly added and updated.
Criteria | TypeScript Express Starter | NestJS |
---|---|---|
Learning Curve | β Low β easy for anyone familiar with Express | Higher β requires OOP/DI/Decorators |
Flexibility | β Maximum β customize any part of the stack | Convention-based, opinionated structure |
Modularity | Middleware & modular pattern | π Strong built-in module system |
Type Safety | Full TypeScript support | Full TypeScript support |
Testing | β Supports Jest & Vitest β flexible choice | Built-in Jest E2E setup |
Scale | β Fast prototyping β mid-size apps | π Large-scale enterprise apps |
DI Framework | Lightweight tsyringe β minimal overhead | π Full-featured DI container |
Best Fit | β Microservices, quick MVPs, developer agility | π Complex, enterprise-grade applications |
When | Commit Message |
---|---|
Add Feature | β¨ Add Feature |
Fix Bug | π Fix Bug |
Refactor Code | π Refactor Code |
Install Package | π¦ Install Package |
Fix Readme | π Fix Readme |
Update Version | πΌ Update Version |
New Template | π New Template |
MIT(LICENSE) Β© AGUMON (ljlm0402)