A production-ready, feature-rich template for building scalable Node.js applications with TypeScript. Built with modern best practices, security, and monitoring in mind.
-
Core
- 🚀 TypeScript 5.x
- ⚡️ Express.js with modern setup
- 🔄 Hot reload development
- 📝 Environment management
-
Security & Monitoring
- 🔒 Helmet.js security headers
- 🌐 Configurable CORS
- 💪 Health check endpoint
- 🛡️ Production-ready error handling
-
Developer Experience
- 🔥 Hot reload with tsx
- 📊 Request parsing (JSON, URL-encoded)
- 🍪 Cookie handling
- 🎯 TypeScript types included
- Node.js (16.x or higher)
- pnpm (or npm/yarn)
- nodemon (global)
pnpm add -g nodemon
- Clone and install:
git clone https://github.com/RattyJhay/nodejs_ts_starter_template_pro.git
cd nodejs_ts_starter_template_pro
pnpm install
- Set up environment:
cp .env.example .env
- Start development:
pnpm start
src/
├── index.ts # Server entry
├── app.ts # Express setup
├── routes/ # API routes
├── controllers/ # Route handlers
├── middleware/ # Custom middleware
└── config/ # Configurations
.env
file setup:
PORT=5000
NODE_ENV=development
CORS_ORIGIN=http://localhost:5173
pnpm start
- Development with hot reloadpnpm build
- Production buildpnpm test
- Run tests
Built-in health endpoint at /health
providing:
- System uptime
- Memory usage
- Server timestamp
- Resource metrics
Perfect for:
- Kubernetes probes
- Load balancer checks
- Uptime monitoring
- Helmet.js HTTP security headers
- CORS with configurable origins
- Environment-based error responses
- Secure cookie handling
- Production error sanitization
Start the dev server:
pnpm start
Build for production:
pnpm build
Production:
express
- Web frameworkhelmet
- Security headerscors
- CORS handlingcookie-parser
- Cookie handlingdotenv
- Environment management
Development:
typescript
- Type supporttsx
- TypeScript executionts-node
- TypeScript runtime@types/*
- Type definitions
- Fork it
- Create your feature branch (
git checkout -b feature/amazing
) - Commit changes (
git commit -m 'Add amazing feature'
) - Push to branch (
git push origin feature/amazing
) - Open a Pull Request
ISC
Built with 💙 by Ratty Jhay