nestjs-kafka
🚀 Features
- TurboRepo as a monorepo build tool.
- tsconfig/base.json for all modules and framework specific config tsconfig/nestjs.json for NestJS apps.
- Two NestJS microservices packaged with Docker.
- apps/api/ : REST API producing to Kafka
- apps/consumers/ : Service for consuming Kafka Events, see: Kafka | NestJS
- Strictly typed events via type definitions in packages/types/
- Kafka, Schema Registry and provectus/kafka-ui.
- For Schema Registry info, see: Kafka with AVRO, JSON and Protobuf | medium
- Monitoring using OpenTelemetry for metrics and traces, and Vector for logs.
- OpenTelemetry Collector using infra/opentelemetry-collector.yaml with andkafka-metrics-receiver, prometheus-exporter
- Vector Agent using infra/vector.toml listening to Docker logs and Kafka.
Usage
Start Kafka, Schema Registry and UI with:
docker-compose up -d
Optionally start OpenTelemetry and Vector as well:
docker-compose --profile telemetry up -d
Start the NestJS microservers with:
npx turbo run dev