How ryadevx/event-flow works
Even is a database-per-service ticketing backend: clients enter through the API gateway, which forwards requests to authentication, event-catalog, and ticket-purchase services. Purchases atomically reserve inventory, create tickets, and record outbox events; Kafka carries domain events to ticket synchronization and notification consumers. The README documents the outbox, idempotency, inbox retries, and DLQ capabilities. Some worker and consumer internals were not sampled, so those links rely on the README rather than inspected implementation.
Main entry points: app.service.ts HTTP forwarding · auth.service.ts Authentication · kafka.consumer.ts Notification consumer · app.controller.ts API gateway
Components 24
API edge
- API gateway
apps/api-gateway/src/app.controller.ts - HTTP forwarding
apps/api-gateway/src/app.service.ts - Role authorization
apps/api-gateway/src/auth/roles.guard.ts
Ticketing services
- Authentication
apps/auth/src/auth/auth.service.ts - Auth endpoints
apps/auth/src/auth/auth.controller.ts - Event catalog
apps/events/src/events/events.service.ts - Event endpoints
apps/events/src/events/events.controller.ts - Ticket purchase
apps/tickets/src/tickets/tickets.service.ts - Ticket endpoints
apps/tickets/src/tickets/tickets.controller.ts
Event delivery
- Auth outbox publisher
apps/auth/src/messaging/outbox.publisher.ts - Events outbox publisher
apps/events/src/messaging/outbox.publisher.ts - Tickets outbox publisher
apps/tickets/src/messaging/outbox.publisher.ts - Kafka / Redpanda
- Ticket event consumer
apps/tickets/src/messaging/kafka.consumer.ts - Notification consumer
apps/notifications/src/messaging/kafka.consumer.ts - Notification dispatch
apps/notifications/src/notifications.service.ts - Purchase-event DLQ
Service data
- Auth database
apps/auth/src/database/schema.ts - Events database
apps/events/src/database/schema.ts - Tickets database
apps/tickets/src/database/schema.ts - Notifications database
apps/notifications/src/database/schema.ts
Shared runtime
- Shared topic constants
libs/shared/src/messaging/topics.ts - JWT authentication guard
libs/shared/src/auth/jwt-auth.guard.ts
Other components
- Web / mobile clients
Connections 25
- Web / mobile clients → API gateway: sends HTTP
- API gateway → HTTP forwarding: forwards requests
apps/api-gateway/src/app.controller.ts - HTTP forwarding → Auth endpoints: routes auth
- HTTP forwarding → Event endpoints: routes events
- HTTP forwarding → Ticket endpoints: routes tickets
- API gateway → Role authorization: applies guards
apps/api-gateway/src/app.controller.ts - Auth endpoints → Authentication: calls
apps/auth/src/auth/auth.controller.ts - Event endpoints → Event catalog: calls
apps/events/src/events/events.controller.ts - Ticket endpoints → Ticket purchase: calls
apps/tickets/src/tickets/tickets.controller.ts - Authentication → Auth database: reads and writes
apps/auth/src/auth/auth.service.ts - Event catalog → Events database: reads and writes
apps/events/src/events/events.service.ts - Ticket purchase → Tickets database: reserves inventory
apps/tickets/src/tickets/tickets.service.ts - Authentication → Shared topic constants: uses topics
apps/auth/src/auth/auth.service.ts - Event catalog → Shared topic constants: uses topics
apps/events/src/events/events.service.ts - Ticket purchase → Shared topic constants: uses topics
apps/tickets/src/tickets/tickets.service.ts - Authentication → JWT authentication guard: issues JWTs
- Auth outbox publisher → Kafka / Redpanda: publishes events
- Events outbox publisher → Kafka / Redpanda: publishes events
- Tickets outbox publisher → Kafka / Redpanda: publishes events
- Kafka / Redpanda → Ticket event consumer: delivers event changes
- Ticket event consumer → Tickets database: syncs event data
- Kafka / Redpanda → Notification consumer: delivers purchases
- Notification consumer → Notifications database: deduplicates and tracks retries
- Notification consumer → Notification dispatch: dispatches alerts
- Notification consumer → Purchase-event DLQ: routes after retries