README.md
March 23, 2026 ยท View on GitHub
๐ Ultimate TypeScript Express Boilerplate
A production-ready, industry-standard backend boilerplate designed for scale and developer experience.
โจ Features
- Unified Message Bus with transport-aware routing for BullMQ, Kafka, and RabbitMQ.
- Parallel Worker Runtime with dedicated worker entrypoints for queue/event/command processing.
- BullMQ by Default for delayed/retryable jobs with optional Kafka and RabbitMQ integrations.
- Authentication + Security with JWT access/refresh rotation, refresh reuse detection, RBAC guard, and Redis-backed rate limiting.
- Stripe Webhooks with signature verification, idempotency protection, and async dispatch via queue workflows.
- Observability with OpenTelemetry tracing, Prometheus metrics, structured logging, and capability diagnostics.
- OpenAPI + Contract Checks with Swagger docs export and Spectral linting.
- Strict CI Quality Gate covering typecheck, lint, tests, contracts, and security audit.
- Migration + Seeding Support with
migrate-mongoand seed scripts. - Docker + Kubernetes Ready with local stack orchestration and production manifests.
โก Quick Start
1. Prerequisites
Install the following:
- Node.js (v20+ recommended)
- npm
- Docker Desktop for
dev:stack(optional but recommended)
2. Clone
git clone https://github.com/Nayem-Dev/TS_Backend.git
cd TS_Backend/TS_Boiler_Plate
3. Install
npm install
4. Configure Environment
cp .env.example .env
Set required values in .env:
DB_TYPE=mongodb
MONGODB_URL=mongodb://localhost:27017/ts_boilerplate
REDIS_URL=redis://localhost:6379
BULLMQ_ENABLED=true
KAFKA_ENABLED=true
RABBITMQ_ENABLED=true
STRIPE_ENABLED=false
5. Run
- API only:
npm run dev
- Full local stack (API + workers + infra via Docker):
npm run dev:stack
๐ Project Structure
TS_Boiler_Plate/
โโโ src/
โ โโโ app.ts
โ โโโ server.ts
โ โโโ auth/
โ โโโ config/
โ โโโ database/
โ โโโ jobs/
โ โโโ lib/
โ โโโ messaging/ # Unified message bus
โ โโโ modules/
โ โโโ observability/
โ โโโ payments/
โ โโโ queues/
โ โโโ routes/
โ โโโ workers/ # Dedicated worker entrypoints
โ โโโ utils/
โโโ docker-compose.yml
โโโ k8s/
โโโ scripts/
๐ ๏ธ Scripts Overview
| Command | Description |
|---|---|
npm run dev | Start API in dev mode |
npm run dev:stack | Start API + workers + infra (Docker Compose) |
npm run worker:bullmq | Run BullMQ worker |
npm run worker:kafka | Run Kafka consumer worker |
npm run worker:rabbitmq | Run RabbitMQ consumer worker |
npm run typecheck | Run strict TypeScript checks |
npm run lint | Run ESLint |
npm run test | Run Vitest suites |
npm run check:contracts | Export OpenAPI + run Spectral lint |
npm run check:security | Run npm audit gate |
npm run check:all | Run full quality gate |
npm run migrate:up | Apply Mongo migrations |
npm run seed | Run seed data |
๐ Diagnostics Endpoints
GET /api/v1/healthGET /api/v1/readyGET /api/v1/system/capabilitiesGET /api/v1/system/pipeline-readyGET /metrics
๐ค Contributing
Contributions are welcome. Please ensure npm run check:all passes before opening a PR.
Built with โค๏ธ by the community. Stay awesome! ๐