How devmentors/messaging-pragmatycznie works
Project type and purpose
• TicketFlow is a full-stack, distributed microservices system for end-to-end ticket management with SLA reminders, alerts, live metrics, multilingual support, and anomaly injection.
• Back-end: .NET services communicating asynchronously via RabbitMQ (AMQP), each in its own bounded context (Inquiries, Tickets, Translations, Communication, SLA, SystemMetrics).
• Front-end: multiple Next.js UIs (Inquiries, Tickets, Technical dashboard) that consume REST APIs.
Main components
a. Front-end UIs (Next.js apps)
• “Inquiries”, “Tickets”, “Technical” apps run on Node.js, call back-end HTTP endpoints.
b. API Gateways / REST endpoints
• Each microservice exposes an ASP.NET Web API (Program.cs, appsettings.json).
c. Microservices & bounded contexts
• Inquiries Service
• Tickets Service
• Translations Service
• Communication Service (alerts, message API)
• SLA Service (deadline calc, reminders)
• SystemMetrics Service (live metrics hub & generator)
d. Message broker
• RabbitMQ, topologies defined in each service (TopologyInitializer, TopologyBuilder).
e. Data stores
• One database per service (.NET Migrations folders), e.g., InquiriesDb, TicketsDb, SLADb, CommunicationDb, DeduplicationDb, OutboxDb.
f. Shared libraries
• Shared/TicketFlow.Shared for messaging abstractions (outbox, deduplication, resiliency), anomaly generation, OpenAI, dependency injection, observability.
g. External services
• OpenAI APIs for language detection and translation.
Relationships & interactions
• Front-end → (REST/HTTP) → Microservice APIs
• Microservice APIs ⟷ (Entity Framework) ⟷ own relational DB
• Microservices ←→ (RabbitMQ) asynchronous events:
• Commands & events (e.g., InquirySubmitted → TicketCreated → SLA deadlines → Alerts → Notifications)
• Out-of-order detection, deduplication, transactional outbox ensure reliability
• SystemMetrics generator publishes metrics to SystemMetrics.Api or hub
• Anomaly web UI (Communication API or shared HTTP endpoints) injects anomalies into message flows.
Architectural patterns & design principles
• Microservices / bounded contexts
• Asynchronous messaging with RabbitMQ (publish/subscribe, topic exchanges)
• Transactional outbox + message deduplication
• CQRS-style separation of commands, queries, handlers
• Schedulers (background services for SLA reminders, deadline breaches)
• Observability (activity sources, headers)
• Synchronous integration paths where needed (e.g., CreateTicketSynchronously)
Technologies & frameworks
• .NET (C#), Entity Framework Core Migrations, ASP.NET Core Web API
• RabbitMQ client libraries & custom topology builders
• PostgreSQL (or other relational DB) for each service
• Next.js, React, Tailwind CSS, TypeScript for front end
• Docker Compose for local infra (Dockerfile, docker-compose.yaml scripts)
• Bash scripts to orchestrate migrations and start all services
Final checklist
• Clear, concise component labels
• Callouts for important patterns (Outbox, Deduplication, Schedulers)
This structure will accurately reflect TicketFlow’s distributed, asynchronous architecture, make dependencies clear, and highlight the key design principles.