1.5.0 โข Published 6 months ago
@shuvamk/create-node-server v1.5.0
Express TypeScript Starter
A production-ready Express.js starter template with TypeScript, featuring comprehensive tooling, security best practices, and monitoring capabilities.
Features
- ๐ TypeScript - Write better, more maintainable code
- ๐ OpenTelemetry - Distributed tracing out of the box
- ๐ Security - Helmet, CORS, and rate limiting preconfigured
- ๐ API Documentation - Swagger/OpenAPI integration
- ๐ชต Logging - Structured logging with Pino
- ๐ Error Tracking - Sentry integration
- โก Performance - Response compression
- ๐งช Testing - Jest setup for unit tests
- ๐ Code Quality - ESLint, Prettier, and Git hooks
Quick Start
npx create-express-ts-starter my-app
cd my-app
npm install
npm run dev
Available Scripts
npm run dev
- Start development server with hot reloadnpm run build
- Build for productionnpm start
- Start production servernpm run lint
- Lint code with ESLintnpm run format
- Format code with Prettiernpm test
- Run tests
Environment Variables
Copy .env.example
to .env
and configure:
cp .env.example .env
See .env.example
for all available options.
Project Structure
src/
โโโ config/ # Configuration files
โโโ controllers/ # Route controllers
โโโ middleware/ # Express middleware
โโโ models/ # Database models
โโโ routes/ # Route definitions
โโโ services/ # Business logic
โโโ types/ # TypeScript types
โโโ utils/ # Utility functions
โโโ index.ts # App entry point
API Documentation
Swagger documentation is available at /api-docs
when running the server.
Monitoring & Observability
Sentry
Error tracking and performance monitoring. Configure via SENTRY_DSN
in .env
.
OpenTelemetry
Distributed tracing enabled by default. Configure endpoint via OTEL_EXPORTER_OTLP_ENDPOINT
.
Security
- Helmet for security headers
- CORS protection
- Rate limiting
- Request validation
Contributing
- Fork the repository
- Create your feature branch
- Commit using conventional commits
- Push to your branch
- Create a pull request
License
MIT