A lightweight, ready-to-use boilerplate to jumpstart your Express.js + TypeScript + auth + security backend projects.
As a web developer, I got tired of retyping the same Express boilerplate for every new project. So I decided to build my own clean, modular, and secure template — a solid foundation to quickstart any backend without wasting time reinventing setup, structure, or config.
This template comes ready with TypeScript, Express, security middlewares, logging, and best practices. Clone it, configure it, and start coding your features immediately.
- 🧩 TypeScript support — modern syntax, type safety, and scalability
- ⚡ Express 4.18 — minimal and fast web framework for Node.js
- 🛡️ Security ready — Helmet, CORS, CSRF protection, rate limiting, and bcrypt
- 🧱 Clean structure — controllers, routes, services, middleware, config
- 🧰 Centralized config — manage everything via
.env - 📜 Logging — organized and centralized logs
- 🚀 Ready to deploy — easily adaptable for production environments
Make sure you have the following installed:
- Node.js ≥ 16
- npm or yarn
- MongoDB ≥ 5 (local or remote instance)
git clone https://github.com/Dev-Relax/express-template-quickstart.git
cd express-template-quickstartnpm installCopy .env.example to .env and fill it with your own values:
cp .env.example .envExample .env:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/your_database_name
JWT_SECRET=your_jwt_secret
JWT_REFRESH_SECRET=your_refresh_secret
CSRF_SECRET=your_csrf_secret
npm run devYour API is now running at http://localhost:5000 🚀
npm run build
npm start.
├── src/
│ ├── config/ # Configuration (env, db)
│ ├── controllers/ # Request handlers
│ ├── middleware/ # Auth, error handling, logging
│ ├── routes/ # API routes
│ ├── services/ # Business logic and data access
│ └── index.ts # App entry point
├── .env.example
├── package.json
├── tsconfig.json
└── nodemon.json
Contributions are welcome! If you have improvements, bug fixes, or feature ideas:
- Fork the repo
- Create a new branch (
feature/your-feature-name) - Make your changes
- Submit a pull request
Please follow the existing coding style and keep commits clean and descriptive.
This project is licensed under the MIT License.
“Start once, build faster every time.” Made with ❤️ by Dev-Relax