Skip to content

akashd56/node-microservices

Repository files navigation

Node.js Microservices Ecosystem

A high-performance, type-safe microservices ecosystem built with Node.js 26+, Express 5, and TypeScript. The project leverages a modern Turborepo monorepo architecture with pnpm workspaces to handle autonomous services while reusing shared utilities through an internal core library.


Core Architecture

This repository uses a monorepo structure to decouple business domains into individual microservices, combined with a shared internal library:

node-micorservices/
├── apps/
│   ├── auth/          # Identity provider & authentication service
│   └── reservations/  # Core business service for booking management
└── libs/
    └── common/        # Shared middleware, logger, database, and validation

Current Status & Implementations

1. Monorepo & Tooling Foundation

  • Turborepo & pnpm Workspaces: Orchestrates build, caching, and dependency management across all packages.
  • Strict TypeScript: Enforces type safety across service boundaries with shared compilation profiles.
  • Docker-Compose Environment: Provides a containerized local database instance (MongoDB 8).

2. Centralized Infrastructure (@node-ms/common)

  • Database Utility: Standardized connection pool abstraction for MongoDB using Mongoose.
  • Structured Logging: Enterprise-grade observability implemented via Pino and Pino-HTTP.
  • Unified Middleware: Global error-handling interceptors and type-safe request validators powered by Zod.

3. Authentication & Security Service (@node-ms/auth)

  • Identity Provisioning: Full user registration flow with Mongoose model integration.
  • Cryptographic Protection: Industry-standard password hashing and verification using Argon2.
  • Passport.js Integration: Local strategy implemented for email/password authentication.

4. Reservations Domain Service (@node-ms/reservations)

  • Full CRUD Implementation: Completed RESTful endpoints for creating, retrieving, and searching reservations.
  • Input Validation: Strict request body enforcement using Zod DTOs.
  • Centralized Error Handling: Integrated with shared middleware for consistent API responses.

Tech Stack

  • Runtime/Language: Node.js (ESModules) / TypeScript 6+
  • Monorepo: Turborepo, pnpm Workspaces
  • Framework: Express 5
  • Database: MongoDB, Mongoose 9+
  • Security: Passport.js, Argon2, Zod
  • Observability: Pino, Pino-Pretty

Currently Learning & Future Roadmap

  • gRPC & GraphQL: Exploring high-performance inter-service communication via gRPC and building type-safe, flexible client-facing APIs with Apollo Server as complementary API layers.
  • RabbitMQ & Redis: Implementing async message queues for service decoupling with RabbitMQ, alongside pub/sub patterns and advanced caching strategies in Redis.
  • PostgreSQL: Deepening relational database skills with indexing, query optimization, and schema design (transitioning from MongoDB via Prisma).
  • GitHub Actions & AWS: Setting up CI/CD pipelines for automated testing and Docker image builds, alongside core AWS services for cloud deployment and infrastructure management.
  • Kubernetes: Understanding container orchestration, pod scheduling, and service deployment for scalable infrastructure.

About

This project is a modular Node.js microservices ecosystem built with Express 5, TypeScript, and MongoDB 8. Using a Turborepo monorepo architecture, it efficiently manages decoupled services for authentication and reservations while leveraging a shared internal library for core utilities. The Auth service handles security via Argon2 and Passport

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors