Hey There! 🙌
🤾 that ⭐️ button if you like this boilerplate.
Welcome to Express TypeScript Boilerplate 2025 – a simple and ready-to-use starting point for building backend web services with Express.js and TypeScript.
This starter kit helps you:
- ✨ Start new projects faster
- 📊 Write clean, consistent code
- ⚡ Build things quickly
- 🛡️ Follow best practices for security and testing
- 📁 Well-organized folders: Files grouped by feature so you can find things easily
- 💨 Fast development: Quick code running with
tsx
and error checking withtsc
- 🌐 Latest Node.js: Uses the newest stable Node.js version from
.tool-versions
- 🔧 Safe settings: Environment settings checked with Zod to prevent errors
- 🔗 Short import paths: Clean code with easy imports using path shortcuts
- 🔄 Auto-updates: Keeps dependencies up-to-date with Renovate
- 🔒 Better security: Built-in protection with Helmet and CORS settings
- 📊 Easy tracking: Built-in logging with
pino-http
- 🧪 Ready-to-test: Testing tools with Vitest and Supertest already set up
- ✅ Clean code: Consistent coding style with
Biomejs
- 📃 Standard responses: Unified API responses using
ServiceResponse
- 🐳 Easy deployment: Ready for Docker containers
- 📝 Input checking: Request validation using Zod
- 🧩 API browser: Interactive API docs with Swagger UI
For a visual guide, watch the video demo to see the setup and running of the project.
- Clone the repository:
git clone https://github.com/edwinhern/express-typescript.git
- Navigate:
cd express-typescript
- Install dependencies:
pnpm install
- Create
.env
: Copy.env.template
to.env
- Update
.env
: Fill in necessary environment variables
- Development Mode:
pnpm start:dev
- Building:
pnpm build
- Production Mode: Set
NODE_ENV="production"
in.env
thenpnpm build && pnpm start:prod
We'd love to hear your feedback and suggestions for further improvements. Feel free to contribute and join us in making backend development cleaner and faster!
🎉 Happy coding!
├── biome.json
├── Dockerfile
├── LICENSE
├── package.json
├── pnpm-lock.yaml
├── README.md
├── src
│ ├── api
│ │ ├── healthCheck
│ │ │ ├── __tests__
│ │ │ │ └── healthCheckRouter.test.ts
│ │ │ └── healthCheckRouter.ts
│ │ └── user
│ │ ├── __tests__
│ │ │ ├── userRouter.test.ts
│ │ │ └── userService.test.ts
│ │ ├── userController.ts
│ │ ├── userModel.ts
│ │ ├── userRepository.ts
│ │ ├── userRouter.ts
│ │ └── userService.ts
│ ├── api-docs
│ │ ├── __tests__
│ │ │ └── openAPIRouter.test.ts
│ │ ├── openAPIDocumentGenerator.ts
│ │ ├── openAPIResponseBuilders.ts
│ │ └── openAPIRouter.ts
│ ├── common
│ │ ├── __tests__
│ │ │ ├── errorHandler.test.ts
│ │ │ └── requestLogger.test.ts
│ │ ├── middleware
│ │ │ ├── errorHandler.ts
│ │ │ ├── rateLimiter.ts
│ │ │ └── requestLogger.ts
│ │ ├── models
│ │ │ └── serviceResponse.ts
│ │ └── utils
│ │ ├── commonValidation.ts
│ │ ├── envConfig.ts
│ │ └── httpHandlers.ts
│ ├── index.ts
│ └── server.ts
├── tsconfig.json
└── vite.config.mts