# idzer0/eventmanagementservice architecture

> Architecture diagram of the GitHub repository idzer0/eventmanagementservice, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/idzer0/eventmanagementservice
- Repository: https://github.com/idzer0/eventmanagementservice

## Overview

EventMS is a multi-service event management and booking system. Users authenticate for JWTs, browse or manage events, and submit bookings; booking processing is asynchronous through Kafka, where event-side handling can reserve or release seats. The graph preserves the separate auth, event, booking, and messaging subsystems, including their principal persistence and cache layers. Source excerpts show the API-to-service paths and selected service dependencies; some background-consumer behavior is only identified by registration and file names, so those runtime links are left unasserted or marked unverified.

Main entry points: [`EventMS/Events/Application/Services/EventService.cs`](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Events/Application/Services/EventService.cs) (Event service), [`EventMS/Auth/Infrastructure/Services/AuthService.cs`](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Auth/Infrastructure/Services/AuthService.cs) (Auth service), [`EventMS/Bookings/Application/Services/BookingService.cs`](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Bookings/Application/Services/BookingService.cs) (Booking service), [`EventMS/Auth/Presentation/Controllers/AuthController.cs`](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Auth/Presentation/Controllers/AuthController.cs) (Auth API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Authentication"]
  node_auth_api["Auth API<br/>[AuthController.cs]"]
  node_auth_service["Auth service<br/>[AuthService.cs]"]
  node_jwt["JWT generator"]
  node_user_repo["User repository<br/>[UserRepository.cs]"]
  node_auth_db[("Auth database<br/>[AppDbContext.cs]")]
end

subgraph group_events["Event management"]
  node_event_api["Event API<br/>[EventController.cs]"]
  node_event_service["Event service<br/>[EventService.cs]"]
  node_event_repo["Event repository<br/>[EventRepository.cs]"]
  node_event_db[("Event database<br/>[AppDbContext.cs]")]
  node_event_cache[("Event cache")]
  node_booking_requests["Request consumer"]
end

subgraph group_bookings["Booking workflow"]
  node_booking_api["Booking API"]
  node_booking_service["Booking service<br/>[BookingService.cs]"]
  node_booking_repo["Booking repository"]
  node_booking_db[("Booking database<br/>[AppDbContext.cs]")]
  node_booking_results["Result consumer"]
end

subgraph group_messaging["Messaging"]
  node_publisher["Kafka publisher"]
  node_consumer["Kafka consumer"]
  node_kafka["Kafka broker"]
end

node_user(("User"))

node_user -->|"authenticates"| node_auth_api
node_auth_api -->|"calls"| node_auth_service
node_auth_service -->|"reads/writes users"| node_user_repo
node_auth_service -->|"generates token"| node_jwt
node_user_repo -.->|"persists users"| node_auth_db
node_user -->|"browses/manages"| node_event_api
node_event_api -->|"calls"| node_event_service
node_event_service -->|"queries/updates"| node_event_repo
node_event_service -->|"reads/writes cache"| node_event_cache
node_event_repo -.->|"persists events"| node_event_db
node_user -->|"books/manages"| node_booking_api
node_booking_api -->|"calls"| node_booking_service
node_booking_service -->|"reads/writes bookings"| node_booking_repo
node_booking_service -->|"publishes request"| node_publisher
node_booking_repo -.->|"persists bookings"| node_booking_db
node_publisher -.->|"publishes messages"| node_kafka
node_kafka -.->|"delivers results"| node_booking_results
node_kafka -.->|"delivers requests"| node_booking_requests
node_booking_requests -.->|"invokes seat handling"| node_event_service
node_consumer -.->|"consumes messages"| node_kafka

click node_auth_api "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Auth/Presentation/Controllers/AuthController.cs"
click node_auth_service "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Auth/Infrastructure/Services/AuthService.cs"
click node_jwt "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Auth/Infrastructure/Services/JwtTokenGenerator.cs"
click node_user_repo "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Auth/Infrastructure/Repositories/UserRepository.cs"
click node_auth_db "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Auth/Infrastructure/DataAccess/AppDbContext.cs"
click node_event_api "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Events/Presentation/Controllers/EventController.cs"
click node_event_service "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Events/Application/Services/EventService.cs"
click node_event_repo "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Events/Infrastructure/Repositories/EventRepository.cs"
click node_event_db "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Events/Infrastructure/DataAccess/AppDbContext.cs"
click node_event_cache "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Events/Infrastructure/Services/RedisCacheService.cs"
click node_booking_api "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Bookings/Presentation/Controllers/BookingController.cs"
click node_booking_service "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Bookings/Application/Services/BookingService.cs"
click node_booking_repo "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Bookings/Infrastructure/Repositories/BookingRepository.cs"
click node_booking_db "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Bookings/Infrastructure/DataAccess/AppDbContext.cs"
click node_booking_results "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Bookings/Application/ServicesBackground/BookingResultConsumer.cs"
click node_booking_requests "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Events/Application/ServicesBackground/BookingRequestConsumer.cs"
click node_publisher "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Shared/KafkaSettings/Services/KafkaEventPublisher.cs"
click node_consumer "https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Shared/KafkaSettings/Services/KafkaConsumerService.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_auth_api,node_auth_service,node_jwt,node_user_repo,node_auth_db,node_user toneBlue
class node_event_api,node_event_service,node_event_repo,node_event_db,node_event_cache,node_booking_requests toneAmber
class node_booking_api,node_booking_service,node_booking_repo,node_booking_db,node_booking_results toneMint
class node_publisher,node_consumer,node_kafka toneRose
```

## Components

### Authentication

- [Auth API](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Auth/Presentation/Controllers/AuthController.cs): `EventMS/Auth/Presentation/Controllers/AuthController.cs`
- [Auth service](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Auth/Infrastructure/Services/AuthService.cs): `EventMS/Auth/Infrastructure/Services/AuthService.cs`
- [JWT generator](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Auth/Infrastructure/Services/JwtTokenGenerator.cs): `EventMS/Auth/Infrastructure/Services/JwtTokenGenerator.cs`
- [User repository](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Auth/Infrastructure/Repositories/UserRepository.cs): `EventMS/Auth/Infrastructure/Repositories/UserRepository.cs`
- [Auth database](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Auth/Infrastructure/DataAccess/AppDbContext.cs): `EventMS/Auth/Infrastructure/DataAccess/AppDbContext.cs`

### Event management

- [Event API](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Events/Presentation/Controllers/EventController.cs): `EventMS/Events/Presentation/Controllers/EventController.cs`
- [Event service](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Events/Application/Services/EventService.cs): `EventMS/Events/Application/Services/EventService.cs`
- [Event repository](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Events/Infrastructure/Repositories/EventRepository.cs): `EventMS/Events/Infrastructure/Repositories/EventRepository.cs`
- [Event database](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Events/Infrastructure/DataAccess/AppDbContext.cs): `EventMS/Events/Infrastructure/DataAccess/AppDbContext.cs`
- [Event cache](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Events/Infrastructure/Services/RedisCacheService.cs): `EventMS/Events/Infrastructure/Services/RedisCacheService.cs`
- [Request consumer](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Events/Application/ServicesBackground/BookingRequestConsumer.cs): `EventMS/Events/Application/ServicesBackground/BookingRequestConsumer.cs`

### Booking workflow

- [Booking API](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Bookings/Presentation/Controllers/BookingController.cs): `EventMS/Bookings/Presentation/Controllers/BookingController.cs`
- [Booking service](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Bookings/Application/Services/BookingService.cs): `EventMS/Bookings/Application/Services/BookingService.cs`
- [Booking repository](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Bookings/Infrastructure/Repositories/BookingRepository.cs): `EventMS/Bookings/Infrastructure/Repositories/BookingRepository.cs`
- [Booking database](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Bookings/Infrastructure/DataAccess/AppDbContext.cs): `EventMS/Bookings/Infrastructure/DataAccess/AppDbContext.cs`
- [Result consumer](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Bookings/Application/ServicesBackground/BookingResultConsumer.cs): `EventMS/Bookings/Application/ServicesBackground/BookingResultConsumer.cs`

### Messaging

- [Kafka publisher](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Shared/KafkaSettings/Services/KafkaEventPublisher.cs): `EventMS/Shared/KafkaSettings/Services/KafkaEventPublisher.cs`
- [Kafka consumer](https://github.com/idzer0/eventmanagementservice/blob/main/EventMS/Shared/KafkaSettings/Services/KafkaConsumerService.cs): `EventMS/Shared/KafkaSettings/Services/KafkaConsumerService.cs`
- **Kafka broker**

### Other components

- **User**

## Connections

- User → Auth API: authenticates (evidence: `EventMS/Auth/Presentation/Controllers/AuthController.cs`)
- Auth API → Auth service: calls (evidence: `EventMS/Auth/Presentation/Controllers/AuthController.cs`)
- Auth service → User repository: reads/writes users (evidence: `EventMS/Auth/Infrastructure/Services/AuthService.cs`)
- Auth service → JWT generator: generates token (evidence: `EventMS/Auth/Infrastructure/Services/AuthService.cs`)
- User repository → Auth database: persists users
- User → Event API: browses/manages (evidence: `EventMS/Events/Presentation/Controllers/EventController.cs`)
- Event API → Event service: calls (evidence: `EventMS/Events/Presentation/Controllers/EventController.cs`)
- Event service → Event repository: queries/updates (evidence: `EventMS/Events/Application/Services/EventService.cs`)
- Event service → Event cache: reads/writes cache (evidence: `EventMS/Events/Application/Services/EventService.cs`)
- Event repository → Event database: persists events
- User → Booking API: books/manages (evidence: `EventMS/Bookings/Presentation/Controllers/BookingController.cs`)
- Booking API → Booking service: calls (evidence: `EventMS/Bookings/Presentation/Controllers/BookingController.cs`)
- Booking service → Booking repository: reads/writes bookings (evidence: `EventMS/Bookings/Application/Services/BookingService.cs`)
- Booking service → Kafka publisher: publishes request (evidence: `EventMS/Bookings/Application/Services/BookingService.cs`)
- Booking repository → Booking database: persists bookings
- Kafka publisher → Kafka broker: publishes messages
- Kafka broker → Result consumer: delivers results
- Kafka broker → Request consumer: delivers requests
- Request consumer → Event service: invokes seat handling
- Kafka consumer → Kafka broker: consumes messages
