Skip to main content

Introduction & Ecosystem Architecture

Welcome to NestJS-YALC (Yet Another Layer of Convenience for NestJS), the enterprise-grade foundation framework for building scalable, high-performance microservices and monorepo applications in TypeScript and Node.js.


1. What It Is & Architectural Purpose​

NestJS is an exceptional framework for structuring enterprise backend applications. However, when building distributed monorepos across multiple teams, developers spend hundreds of hours re-implementing core infrastructure: datagrid filter parsers, Avro/JSON Kafka deserializers, GraphQL federation directives, sentinel security headers, audit logging pipelines, and TypeORM connection lifecycle managers.

NestJS-YALC bridges this gap by offering a cohesive suite of modular packages that extend NestJS with battle-tested enterprise primitives. It provides standardized patterns that promote maintainability, strict security compliance, and zero-boilerplate development.

┌────────────────────────────────────────────────────────────────────────────────────────┐
│ YOUR ENTERPRISE APP │
├────────────────────────────────────────────────────────────────────────────────────────┤
│ AG-Grid │ CRUD-Gen │ Audit Log │ [Sentinel](/docs/nestjs-yalc/security/sentinel) Sec │ Kafka Bus │ GraphQL DataLoader │
├───────────┴────────────┴─────────────┴────────────────┴─────────────┴────────────────────┤
│ NESTJS-YALC KERNEL │
├────────────────────────────────────────────────────────────────────────────────────────┤
│ NestJS Core (Express / Fastify) │
└────────────────────────────────────────────────────────────────────────────────────────┘

2. Monorepo Package Ecosystem Breakdown​

PackagePurpose & DomainKey Feature
@nestjs-yalc/ag-gridServer-side data grid handlingAutomated TypeORM QueryBuilder filter & sort translation.
@nestjs-yalc/appApplication bootstrap kernelAutomated shutdown hooks, global exception bouncers, logger.
@nestjs-yalc/api-strategyResponse wrapping & versioningStandardized { success, data, meta } response envelopes.
@nestjs-yalc/auditAudit trail & change trackingEntity mutation diff logging with user context retention.
@nestjs-yalc/crud-genAutomated CRUD API generationAuto-generates REST/GraphQL CRUD routes from entity schemas.
@nestjs-yalc/data-loaderGraphQL DataLoader helperEliminates N+1 query problems automatically in TypeORM.
@nestjs-yalc/databaseMulti-tenant TypeORM engineDynamic database connection pooling & migration runner.
@nestjs-yalc/errorsEnterprise HTTP/RPC exceptionsUnified error code taxonomy with localized messages.
@nestjs-yalc/event-managerLocal & distributed event busHybrid in-memory EventEmitter2 + Kafka event outbox.
@nestjs-yalc/field-middlewareProperty access control & maskingGraphQL field-level masking & encryption decorators.
@nestjs-yalc/graphqlGraphQL Federation & UtilitiesSchema stitching, custom scalars, and Mercurius transport.
@nestjs-yalc/jestTesting utilities & mockersAutomated DB sandbox factories & mock repository providers.
@nestjs-yalc/kafkaHigh-throughput messagingAvro/JSON schema registry, DLQ retry routing, producer pool.
@nestjs-yalc/loggerStructured JSON loggingHigh-performance Pino logger with trace ID injection.
@nestjs-yalc/observabilityTelemetry & Health MonitoringPrometheus metrics export & OpenTelemetry trace propagation.
@nestjs-yalc/sentinelEdge security & bouncerCSP header protection, payload bouncer, CORS regex matchers.
@nestjs-yalc/utilsShared utilities & queue poolrunConcurrently() queue, deep object sanitizers.

3. Core Architectural Philosophy​

1. Zero Boilerplate Code​

Standardize repetitive operational routines (error mapping, logger initialization, request correlation tracking) into single-line module imports.

2. Strict Type Safety​

All packages enforce strict TypeScript contracts. From AG-Grid filter models to Kafka message payloads, raw any types are strictly prohibited.

3. High Performance & Low Overhead​

Built on top of Fastify, Pino, and native SQL query building, NestJS-YALC introduces minimal runtime overhead while preventing common memory leaks.


4. Architectural Sequence Flow​

sequenceDiagram
autonumber
participant Gateway as [Sentinel](/docs/nestjs-yalc/security/sentinel) Gateway
participant App as YalcAppModule
participant Controller as CRUD Controller
participant Audit as Audit Middleware
participant DB as TypeORM Engine
participant Event as Event Manager (Kafka)

Gateway->>App: Incoming Request HTTP/GraphQL
App->>App: Trace Correlation Context Attached
App->>Controller: Route to Target Handler
Controller->>Audit: Capture Pre-Mutation State
Controller->>DB: Execute QueryBuilder Operation
DB-->>Controller: Return Updated Entity
Controller->>Audit: Log Mutation Diff (Before/After)
Controller->>Event: Emit Transactional Outbox Event ('entity.updated')
Event->>Kafka Broker: Async Dispatch to Kafka
Controller-->>Gateway: Standard Response Envelope { success: true, data }
Gateway-->>User: Deliver Response

5. Next Steps​

  • Proceed to the Quickstart Guide to bootstrap your first NestJS-YALC microservice.
  • Explore individual package guides in the Monorepo Modules section.