Hey There! 🙌
🤾 that ⭐️ button if you like this boilerplate.
Welcome to the Express TypeScript Boilerplate 2024 – a streamlined, efficient, and scalable foundation for building powerful backend services with modern tools and practices in Express.js and TypeScript.
This boilerplate aims to:
- ✨ Reduce setup time for new projects
- 📊 Ensure code consistency and quality
- ⚡ Facilitate rapid development
- 🛡️ Encourage best practices in security, testing, and performance
- 📁 Modular Structure: Organized by feature for easy navigation and scalability
- 💨 Faster Execution with tsx: Rapid TypeScript execution with
tsx
and type checking withtsc
- 🌐 Stable Node Environment: Latest LTS Node version in
.nvmrc
- 🔧 Simplified Environment Variables: Managed with Envalid
- 🔗 Path Aliases: Cleaner code with shortcut imports
- 🔄 Renovate Integration: Automatic updates for dependencies
- 🔒 Security: Helmet for HTTP header security and CORS setup
- 📊 Logging: Efficient logging with
pino-http
- 🧪 Comprehensive Testing: Setup with Vitest and Supertest
- 🔑 Code Quality Assurance: Husky and lint-staged for consistent quality
- ✅ Unified Code Style:
Biomejs
for consistent coding standards - 📃 API Response Standardization:
ServiceResponse
class for consistent API responses - 🐳 Docker Support: Ready for containerization and deployment
- 📝 Input Validation with Zod: Strongly typed request validation using
Zod
- 🧩 Swagger UI: Interactive API documentation generated from Zod schemas
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-2024.git
- Navigate:
cd express-typescript-2024
- Install dependencies:
npm ci
- Create
.env
: Copy.env.template
to.env
- Update
.env
: Fill in necessary environment variables
- Development Mode:
npm run dev
- Building:
npm run build
- Production Mode: Set
.env
toNODE_ENV="production"
thennpm run build && npm run start
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!