$ show A3S-Lab/nestify
Nestify is a monorepo that provides a framework for building NestJS applications with a sample order management system demonstrating its use. The repository separates reusable framework capabilities (in packages/) from application-specific code (in apps/api/). The framework provides building blocks for DDD-style NestJS APIs including database integrations (Kysely, ClickHouse), messaging (BullMQ, NATS), caching (Redis/Redisson), observability, resilience patterns, and DDD primitives. The sample application implements an order management system with REST endpoints, PostgreSQL database, Redis integration, and Clean Architecture layers using CQRS pattern. The framework emphasizes separation of concerns, with explicit rules against placing business logic in framework packages.
The LLM identified 5 files worth highlighting for reuse:
Provides core DDD building blocks including Entity, AggregateRoot, ValueObject, DomainEvent, and Repository patterns. These are framework-agnostic implementations that can be extracted and used in any TypeScript project with minimal modification. The code demonstrates proper encapsulation, immutability for value objects, and domain event publishing.
Implements a NestJS-integrated domain event publisher that handles event batching and asynchronous publishing. This component decouples domain events from immediate publishing, allowing for better performance and reliability. It's highly reusable as it only depends on the DDD package and NestJS core, making it easy to extract for other CQRS implementations.
Implements a robust circuit breaker pattern with state management (closed/open/half-open), failure thresholds, and automatic recovery testing. The implementation is framework-agnostic and could be used in any JavaScript/TypeScript application. It demonstrates sophisticated state handling and error filtering capabilities.
Provides a Prometheus-compatible metrics service with histogram and counter implementations that automatically handle cardinality bounds. The module is designed for easy extraction and use in other Node.js applications, demonstrating proper metric labeling, aggregation, and export functionality.
Implements a SQL query logger for Kysely that safely logs queries and parameters with automatic redaction of sensitive information. This reusable component demonstrates proper SQL formatting, duration tracking, and security-conscious logging practices that could be adapted for other SQL builders.