Skip to content

Latest commit

 

History

History
306 lines (217 loc) · 8.94 KB

File metadata and controls

306 lines (217 loc) · 8.94 KB

2.0.0 (2026-03-24)

Features

  • add enterprise features (4dc76ad)

BREAKING CHANGES

  • v2.0.0 release

Changelog

All notable changes to this project are documented in this file.

The format follows Keep a Changelog and this project follows Semantic Versioning.


[2.0.0] - 2026-03-24

Major Release

This release overhauls both the node-mongo-ts and node-mongo-js templates. It adds TypeScript-first patterns, structured logging, Redis caching, Docker multi-stage builds, CI/CD, database seeders, and project-level documentation.


Added — TypeScript Template (node-mongo-ts)

TypeScript

  • ✅ Path aliases (@/) via tsconfig-paths and tsc-alias
  • ✅ DTOs using class-validator and class-transformer
  • ✅ Generics, Utility Types, Discriminated Unions, Type Guards
  • ✅ Strict type checking across the project
  • ✅ Type-safe environment variable validation

Logging and Observability

  • ✅ Structured logging with Pino (JSON in production, pretty-print in dev)
  • ✅ Correlation IDs for distributed request tracing
  • ✅ Request logging middleware with duration tracking

Caching

  • ✅ Redis caching layer using ioredis
  • ✅ Type-safe cache service with TTL support
  • ✅ Graceful fallback when Redis is unavailable
  • ✅ Response compression middleware

Health Checks

  • /health/liveness — Kubernetes liveness probe
  • /health/readiness — Readiness probe with DB and cache checks
  • /health — System metrics (uptime, memory, connection status)

Database Seeders

  • ✅ Seeder infrastructure with idempotent design
  • ✅ User seeder with hashed passwords
  • npm run db:seed command

DevOps and CI/CD

  • ✅ Multi-stage Docker builds (~100MB images)
  • ✅ Docker Compose with MongoDB, Redis, and Mongo Express
  • ✅ GitHub Actions pipeline (lint, typecheck, build, security scan)
  • ✅ Husky + lint-staged for pre-commit hooks
  • ✅ Commitlint for conventional commits
  • ✅ Container health checks
  • ✅ Non-root Docker user

API Documentation

  • ✅ Swagger/OpenAPI configuration
  • ✅ Auto-generated API docs
  • ✅ Type-safe schemas and examples

Graceful Shutdown

  • ✅ Signal handling (SIGTERM, SIGINT)
  • ✅ Connection draining
  • ✅ Clean database and cache disconnection
  • ✅ 30-second timeout safeguard

Project Documentation

  • SKILLS.md — Coding standards and patterns
  • SEEDERS.md — Database seeding guide
  • CONTRIBUTING.md — Development workflow and standards
  • ARCHITECTURE.md — System architecture overview
  • TYPESCRIPT_GUIDE.md — TypeScript patterns and practices

Added — JavaScript Template (node-mongo-js)

Infrastructure

  • ✅ Structured logging with Pino
  • ✅ Redis caching using ioredis
  • ✅ Response compression middleware
  • ✅ Standardized HTTP status codes

Database Seeders

  • ✅ ES6+ seeder infrastructure
  • ✅ User seeder with bcrypt hashing
  • npm run db:seed command

DevOps and CI/CD

  • ✅ Multi-stage Docker builds
  • ✅ Docker Compose with MongoDB + Redis
  • ✅ GitHub Actions CI/CD pipeline
  • ✅ Husky + lint-staged
  • ✅ Commitlint for conventional commits

Project Documentation

  • SKILLS.md — JavaScript/ES6+ coding standards
  • SEEDERS.md — Database seeding guide
  • CONTRIBUTING.md — Development workflow

Dependencies Added

Both Templates

  • compression — Response compression
  • http-status-codes — Standardized HTTP status codes
  • ioredis — Redis client
  • nanoid — Unique ID generation
  • pino, pino-http, pino-pretty — Structured logging
  • @commitlint/cli, @commitlint/config-conventional — Commit message validation
  • husky — Git hooks
  • lint-staged — Pre-commit formatting
  • eslint-plugin-import — Import order linting

TypeScript Template Only

  • class-validator — DTO validation
  • class-transformer — DTO transformation
  • reflect-metadata — Decorator metadata
  • tsconfig-paths — Path alias resolution (runtime)
  • tsc-alias — Path alias resolution (build time)

Changed

Package Scripts

  • Added db:seed — Run database seeders
  • Added prepare — Set up git hooks
  • Added docker:build — Build Docker image
  • Added docker:run — Start containers
  • Added docker:stop — Stop containers
  • Added typecheck — Run TypeScript type checking (TS template)

Docker Configuration

  • Switched to multi-stage builds for smaller images
  • Added container health checks
  • Added Redis service
  • Added Mongo Express for development use
  • Containers now run as non-root users

Project Structure

  • Added src/database/seeders/
  • Added src/dtos/ (TS template)
  • Added src/services/CacheService.ts (TS template)
  • Added src/utils/logger.util.ts (TS template)
  • Added src/utils/gracefulShutdown.ts (TS template)
  • Added .github/workflows/ for CI/CD
  • Added .husky/ for git hooks

Security

  • ✅ Environment variable validation at startup
  • ✅ Type-safe environment access
  • ✅ Non-root Docker users
  • ✅ Security headers via Helmet
  • ✅ Input validation with DTOs (TS) / Joi (JS)
  • ✅ Password hashing in seeders
  • ✅ Per-IP/user rate limiting

Breaking Changes

None. This is a new major version, but all changes are additive. Existing projects can adopt new features incrementally.


Migration Guide

For existing users:

  1. Install new dependencies: npm install
  2. Set up git hooks: npm run prepare
  3. Review new docs: SKILLS.md, SEEDERS.md, CONTRIBUTING.md
  4. Optionally adopt seeders, caching, and structured logging
  5. Optionally update your Docker setup with the new multi-stage builds

Acknowledgments

Conventions and patterns in this release are influenced by practices at Vercel, Linear, GitHub, and Google.


1.2.1 (2026-03-05)

Bug Fixes

  • Publish to npm registry instead of GitHub registry (ce40a7c)

1.2.0 (2026-03-05)

Features

1.1.0 (2026-03-05)

Features

  • docker: Rename dockerignore during init and add docs guide (8143b41)

1.0.0 (2026-03-05)

Features

  • Add Node.js MongoDB template with authentication, testing, Docker, CI/CD, and updated CLI commands (3dd6783)

[Unreleased]

Added

Authentication

  • User registration and login
  • Token generation for authenticated sessions
  • OTP verification for phone and email
  • Password reset via OTP
  • Joi validation for auth and OTP routes

Testing

  • Jest and Supertest for API testing
  • tests/ directory with base configuration
  • Example tests (e.g., health.test.js)

Security

  • Helmet middleware for HTTP header protection
  • express-rate-limit for request throttling
  • mongo-sanitize and xss-clean to prevent injection attacks
  • Configurable CORS middleware

Docker

  • Dockerfile for containerized deployments
  • docker-compose for local API + MongoDB setup
  • .dockerignore for optimized builds

Monitoring

  • /health endpoint for service status
  • /health/ready endpoint for readiness checks

Changed

CLI

  • Improved output readability
  • Removed unnecessary visual elements
  • Moved CLI messages to a centralized constants file

API Messages

  • Added src/constants/Messages.js for centralized API response messages
  • Controllers and services reference constants instead of inline strings

Logging

  • Internal logs now use a structured format:
[FileUpload] Upload started
[Cloudinary] File uploaded successfully

Environment Variables

Renamed Cloudinary environment variables:

Old Name New Name
CLOUD_NAME CLOUDINARY_NAME
CLOUD_API_KEY CLOUDINARY_API_KEY

Documentation

Added docs in the docs/ directory:

  • setup.md — Project setup instructions
  • authentication.md — Authentication and OTP usage
  • services.md — Email, AWS S3, and Cloudinary configuration
  • cli-usage.md — CLI command reference

Updated root README.md with clearer setup instructions.


Fixed

  • Fixed inquirer prompt structure issue in the init command
  • Removed duplicate documentation paths
  • Cleaned up formatting in documentation files