Shared communication and messaging service built with NestJS + TypeORM. This module supports conversation APIs, websocket broadcasting, queue-based async workflows, and confirmation synchronization.
- Framework: NestJS (modular architecture)
- Transport: REST + WebSocket gateway
- Persistence: PostgreSQL via TypeORM
- Queueing: RabbitMQ integration
- Validation: Global validation pipe with transform + whitelist
- Pagination bounds to prevent unbounded queries
- Request validation hardening
- Conversation mapping consistency fixes
- Authorization hardening for actor-sensitive messaging routes
- Containerized deployment for predictable runtime
npm install
cp .env.example .env
npm run build
npm run start:devDefined in .env.example:
NODE_ENVPORTDATABASE_URLRABBITMQ_URLINTERNAL_API_KEY
docker compose up --buildCompose includes:
common-servicepostgresrabbitmq
npm run start:dev- watch modenpm run build- compile Nest appnpm run start:prod- run compiled appnpm run lint- lint and auto-fix
src/modules/messeging- conversations/messages/gatewaysrc/modules/confirmation- confirmation broadcast endpointssrc/modules/queue- queue producer utilitiessrc/modules/email- email workflows
- Keep
INTERNAL_API_KEYprivate and rotate regularly. - Restrict ingress to trusted services for broadcast endpoints.
- Run with managed Postgres and managed queue in production.
This repository is proprietary/unlicensed. See LICENSE.