# santer1/coreevents architecture

> Architecture diagram of the GitHub repository santer1/coreevents, 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/santer1/coreevents
- Repository: https://github.com/santer1/coreevents

## Overview

CoreEvents is an events-and-bookings platform with a React SPA, a BFF-style API gateway, and independent Users, Events, and Bookings services. The user journey is: authenticate, browse or manage events, request a booking, and check its status; booking confirmation and seat reservation cross service boundaries asynchronously through Kafka. The map includes documented storage, caching, and messaging capabilities. Some backend internals were not sampled, so their links rely on README descriptions rather than inspected call sites.

Main entry points: [`Gateway/Gateway.Api/Extensions/ServiceCollectionExtensions.cs`](https://github.com/santer1/coreevents/blob/main/Gateway/Gateway.Api/Extensions/ServiceCollectionExtensions.cs) (Reverse proxy), [`Frontend/react-web/src/app/App.tsx`](https://github.com/santer1/coreevents/blob/main/Frontend/react-web/src/app/App.tsx) (React SPA), [`Services/Events/Events.Application/Services/EventService.cs`](https://github.com/santer1/coreevents/blob/main/Services/Events/Events.Application/Services/EventService.cs) (Event operations), [`Frontend/react-web/src/features/auth/api/authApi.ts`](https://github.com/santer1/coreevents/blob/main/Frontend/react-web/src/features/auth/api/authApi.ts) (Auth UI and API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web client"]
  node_spa["React SPA<br/>[App.tsx]"]
  node_web_auth["Auth UI and API<br/>[authApi.ts]"]
  node_web_events["Events UI and API<br/>[eventsApi.ts]"]
  node_web_bookings["Bookings UI and API<br/>[bookingsApi.ts]"]
  node_session["Session state<br/>[sessionStore.ts]"]
end

subgraph group_edge["Gateway"]
  node_gateway["Reverse proxy"]
  node_cookie_transform["Cookie transform"]
  node_gateway_docs["API documentation"]
end

subgraph group_identity["User identity"]
  node_user_api["Auth and profile API<br/>[AuthController.cs]"]
  node_cookie_service["Session cookies"]
  node_user_app["User application<br/>[UserService.cs]"]
  node_user_domain["User and tokens<br/>[User.cs]"]
  node_user_store[("Users database<br/>[UsersDbContext.cs]")]
end

subgraph group_events["Events service"]
  node_event_api["Events API"]
  node_event_app["Event operations<br/>[EventService.cs]"]
  node_event_domain["Event and seats<br/>[Event.cs]"]
  node_event_store[("Events database<br/>[EventsDbContext.cs]")]
  node_event_cache[("Event cache")]
  node_event_consumer["Booking event consumer"]
end

subgraph group_booking["Bookings service"]
  node_booking_api["Bookings API"]
  node_booking_app["Booking commands and queries"]
  node_booking_domain["Booking status<br/>[Booking.cs]"]
  node_booking_store[("Bookings database")]
  node_outbox["Outbox dispatcher"]
end

node_visitor(("Web user"))
node_kafka["Kafka broker"]
node_users_db[("Users PostgreSQL")]
node_events_db[("Events PostgreSQL")]
node_redis[("Redis")]
node_booking_db[("Bookings PostgreSQL")]

node_visitor -->|"uses"| node_spa
node_spa -->|"renders"| node_web_auth
node_spa -->|"renders"| node_web_events
node_spa -->|"renders"| node_web_bookings
node_web_auth -->|"updates"| node_session
node_web_auth -->|"calls auth"| node_gateway
node_web_events -->|"calls events"| node_gateway
node_web_bookings -->|"calls bookings"| node_gateway
node_gateway -->|"applies"| node_cookie_transform
node_gateway -->|"proxies auth"| node_user_api
node_gateway -->|"proxies events"| node_event_api
node_gateway -->|"proxies bookings"| node_booking_api
node_gateway -->|"serves docs"| node_gateway_docs
node_user_api -->|"calls"| node_user_app
node_user_api -->|"sets cookies"| node_cookie_service
node_user_app -.->|"manages"| node_user_domain
node_user_app -.->|"persists"| node_user_store
node_user_store -.->|"stores"| node_users_db
node_event_api -->|"calls"| node_event_app
node_event_app -.->|"manages"| node_event_domain
node_event_app -.->|"persists"| node_event_store
node_event_app -.->|"caches events"| node_event_cache
node_event_store -.->|"stores"| node_events_db
node_event_cache -.->|"reads and writes"| node_redis
node_booking_api -->|"dispatches"| node_booking_app
node_booking_app -.->|"creates booking"| node_booking_domain
node_booking_app -.->|"persists"| node_booking_store
node_booking_store -.->|"stores"| node_booking_db
node_booking_store -.->|"feeds outbox"| node_outbox
node_outbox -->|"publishes events"| node_kafka
node_kafka -->|"delivers events"| node_event_consumer
node_event_consumer -->|"reserves seats"| node_event_store

click node_spa "https://github.com/santer1/coreevents/blob/main/Frontend/react-web/src/app/App.tsx"
click node_web_auth "https://github.com/santer1/coreevents/blob/main/Frontend/react-web/src/features/auth/api/authApi.ts"
click node_web_events "https://github.com/santer1/coreevents/blob/main/Frontend/react-web/src/features/events/api/eventsApi.ts"
click node_web_bookings "https://github.com/santer1/coreevents/blob/main/Frontend/react-web/src/features/bookings/api/bookingsApi.ts"
click node_session "https://github.com/santer1/coreevents/blob/main/Frontend/react-web/src/shared/lib/auth/sessionStore.ts"
click node_gateway "https://github.com/santer1/coreevents/blob/main/Gateway/Gateway.Api/Extensions/ServiceCollectionExtensions.cs"
click node_cookie_transform "https://github.com/santer1/coreevents/blob/main/Gateway/Gateway.Api/Transforms/CookieToBearerTransformProvider.cs"
click node_gateway_docs "https://github.com/santer1/coreevents/blob/main/Gateway/Gateway.Api/Configuration/OpenApiDocConfig.cs"
click node_user_api "https://github.com/santer1/coreevents/blob/main/Services/Users/Users.Api/Controllers/AuthController.cs"
click node_cookie_service "https://github.com/santer1/coreevents/blob/main/Services/Users/Users.Api/Services/AuthCookieService.cs"
click node_user_app "https://github.com/santer1/coreevents/blob/main/Services/Users/Users.Application/Services/UserService.cs"
click node_user_domain "https://github.com/santer1/coreevents/blob/main/Services/Users/Users.Domain/Entities/User.cs"
click node_user_store "https://github.com/santer1/coreevents/blob/main/Services/Users/Users.Infrastructure/Data/UsersDbContext.cs"
click node_event_api "https://github.com/santer1/coreevents/blob/main/Services/Events/Events.Api/Controllers/EventsController.cs"
click node_event_app "https://github.com/santer1/coreevents/blob/main/Services/Events/Events.Application/Services/EventService.cs"
click node_event_domain "https://github.com/santer1/coreevents/blob/main/Services/Events/Events.Domain/Entities/Event.cs"
click node_event_store "https://github.com/santer1/coreevents/blob/main/Services/Events/Events.Infrastructure/Data/EventsDbContext.cs"
click node_event_cache "https://github.com/santer1/coreevents/blob/main/Services/Events/Events.Infrastructure/Caching/RedisCacheService.cs"
click node_booking_api "https://github.com/santer1/coreevents/blob/main/Services/Bookings/Bookings.Api/Controllers/BookingsController.cs"
click node_booking_app "https://github.com/santer1/coreevents/blob/main/Services/Bookings/Bookings.Application/Commands/CreateBookingCommand.cs"
click node_booking_domain "https://github.com/santer1/coreevents/blob/main/Services/Bookings/Bookings.Domain/Entities/Booking.cs"
click node_booking_store "https://github.com/santer1/coreevents/blob/main/Services/Bookings/Bookings.Infrastructure/Data/BookingsDbContext.cs"
click node_outbox "https://github.com/santer1/coreevents/blob/main/Services/Bookings/Bookings.Infrastructure/Messaging/OutboxBackgroundWorker.cs"
click node_event_consumer "https://github.com/santer1/coreevents/blob/main/Services/Events/Events.Infrastructure/Messaging/KafkaConsumerBackgroundService.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_spa,node_web_auth,node_web_events,node_web_bookings,node_session,node_visitor toneBlue
class node_gateway,node_cookie_transform,node_gateway_docs,node_users_db,node_events_db,node_redis,node_booking_db toneAmber
class node_user_api,node_cookie_service,node_user_app,node_user_domain,node_user_store toneMint
class node_event_api,node_event_app,node_event_domain,node_event_store,node_event_cache,node_event_consumer toneRose
class node_booking_api,node_booking_app,node_booking_domain,node_booking_store,node_outbox,node_kafka toneIndigo
```

## Components

### Web client

- [React SPA](https://github.com/santer1/coreevents/blob/main/Frontend/react-web/src/app/App.tsx): `Frontend/react-web/src/app/App.tsx`
- [Auth UI and API](https://github.com/santer1/coreevents/blob/main/Frontend/react-web/src/features/auth/api/authApi.ts): `Frontend/react-web/src/features/auth/api/authApi.ts`
- [Events UI and API](https://github.com/santer1/coreevents/blob/main/Frontend/react-web/src/features/events/api/eventsApi.ts): `Frontend/react-web/src/features/events/api/eventsApi.ts`
- [Bookings UI and API](https://github.com/santer1/coreevents/blob/main/Frontend/react-web/src/features/bookings/api/bookingsApi.ts): `Frontend/react-web/src/features/bookings/api/bookingsApi.ts`
- [Session state](https://github.com/santer1/coreevents/blob/main/Frontend/react-web/src/shared/lib/auth/sessionStore.ts): `Frontend/react-web/src/shared/lib/auth/sessionStore.ts`

### Gateway

- [Reverse proxy](https://github.com/santer1/coreevents/blob/main/Gateway/Gateway.Api/Extensions/ServiceCollectionExtensions.cs): `Gateway/Gateway.Api/Extensions/ServiceCollectionExtensions.cs`
- [Cookie transform](https://github.com/santer1/coreevents/blob/main/Gateway/Gateway.Api/Transforms/CookieToBearerTransformProvider.cs): `Gateway/Gateway.Api/Transforms/CookieToBearerTransformProvider.cs`
- [API documentation](https://github.com/santer1/coreevents/blob/main/Gateway/Gateway.Api/Configuration/OpenApiDocConfig.cs): `Gateway/Gateway.Api/Configuration/OpenApiDocConfig.cs`

### User identity

- [Auth and profile API](https://github.com/santer1/coreevents/blob/main/Services/Users/Users.Api/Controllers/AuthController.cs): `Services/Users/Users.Api/Controllers/AuthController.cs`
- [Session cookies](https://github.com/santer1/coreevents/blob/main/Services/Users/Users.Api/Services/AuthCookieService.cs): `Services/Users/Users.Api/Services/AuthCookieService.cs`
- [User application](https://github.com/santer1/coreevents/blob/main/Services/Users/Users.Application/Services/UserService.cs): `Services/Users/Users.Application/Services/UserService.cs`
- [User and tokens](https://github.com/santer1/coreevents/blob/main/Services/Users/Users.Domain/Entities/User.cs): `Services/Users/Users.Domain/Entities/User.cs`
- [Users database](https://github.com/santer1/coreevents/blob/main/Services/Users/Users.Infrastructure/Data/UsersDbContext.cs): `Services/Users/Users.Infrastructure/Data/UsersDbContext.cs`

### Events service

- [Events API](https://github.com/santer1/coreevents/blob/main/Services/Events/Events.Api/Controllers/EventsController.cs): `Services/Events/Events.Api/Controllers/EventsController.cs`
- [Event operations](https://github.com/santer1/coreevents/blob/main/Services/Events/Events.Application/Services/EventService.cs): `Services/Events/Events.Application/Services/EventService.cs`
- [Event and seats](https://github.com/santer1/coreevents/blob/main/Services/Events/Events.Domain/Entities/Event.cs): `Services/Events/Events.Domain/Entities/Event.cs`
- [Events database](https://github.com/santer1/coreevents/blob/main/Services/Events/Events.Infrastructure/Data/EventsDbContext.cs): `Services/Events/Events.Infrastructure/Data/EventsDbContext.cs`
- [Event cache](https://github.com/santer1/coreevents/blob/main/Services/Events/Events.Infrastructure/Caching/RedisCacheService.cs): `Services/Events/Events.Infrastructure/Caching/RedisCacheService.cs`
- [Booking event consumer](https://github.com/santer1/coreevents/blob/main/Services/Events/Events.Infrastructure/Messaging/KafkaConsumerBackgroundService.cs): `Services/Events/Events.Infrastructure/Messaging/KafkaConsumerBackgroundService.cs`

### Bookings service

- [Bookings API](https://github.com/santer1/coreevents/blob/main/Services/Bookings/Bookings.Api/Controllers/BookingsController.cs): `Services/Bookings/Bookings.Api/Controllers/BookingsController.cs`
- [Booking commands and queries](https://github.com/santer1/coreevents/blob/main/Services/Bookings/Bookings.Application/Commands/CreateBookingCommand.cs): `Services/Bookings/Bookings.Application/Commands/CreateBookingCommand.cs`
- [Booking status](https://github.com/santer1/coreevents/blob/main/Services/Bookings/Bookings.Domain/Entities/Booking.cs): `Services/Bookings/Bookings.Domain/Entities/Booking.cs`
- [Bookings database](https://github.com/santer1/coreevents/blob/main/Services/Bookings/Bookings.Infrastructure/Data/BookingsDbContext.cs): `Services/Bookings/Bookings.Infrastructure/Data/BookingsDbContext.cs`
- [Outbox dispatcher](https://github.com/santer1/coreevents/blob/main/Services/Bookings/Bookings.Infrastructure/Messaging/OutboxBackgroundWorker.cs): `Services/Bookings/Bookings.Infrastructure/Messaging/OutboxBackgroundWorker.cs`

### Other components

- **Web user**
- **Kafka broker**
- **Users PostgreSQL**
- **Events PostgreSQL**
- **Redis**
- **Bookings PostgreSQL**

## Connections

- Web user → React SPA: uses
- React SPA → Auth UI and API: renders
- React SPA → Events UI and API: renders
- React SPA → Bookings UI and API: renders
- Auth UI and API → Session state: updates
- Auth UI and API → Reverse proxy: calls auth
- Events UI and API → Reverse proxy: calls events
- Bookings UI and API → Reverse proxy: calls bookings
- Reverse proxy → Cookie transform: applies (evidence: `Gateway/Gateway.Api/Extensions/ServiceCollectionExtensions.cs`)
- Reverse proxy → Auth and profile API: proxies auth
- Reverse proxy → Events API: proxies events
- Reverse proxy → Bookings API: proxies bookings
- Reverse proxy → API documentation: serves docs (evidence: `Gateway/Gateway.Api/Extensions/ServiceCollectionExtensions.cs`)
- Auth and profile API → User application: calls (evidence: `Services/Users/Users.Api/Controllers/AuthController.cs`)
- Auth and profile API → Session cookies: sets cookies (evidence: `Services/Users/Users.Api/Controllers/AuthController.cs`)
- User application → User and tokens: manages
- User application → Users database: persists
- Users database → Users PostgreSQL: stores
- Events API → Event operations: calls (evidence: `Services/Events/Events.Api/Controllers/EventsController.cs`)
- Event operations → Event and seats: manages
- Event operations → Events database: persists
- Event operations → Event cache: caches events
- Events database → Events PostgreSQL: stores
- Event cache → Redis: reads and writes
- Bookings API → Booking commands and queries: dispatches (evidence: `Services/Bookings/Bookings.Api/Controllers/BookingsController.cs`)
- Booking commands and queries → Booking status: creates booking (evidence: `Services/Bookings/Bookings.Application/Commands/CreateBookingCommand.cs`)
- Booking commands and queries → Bookings database: persists
- Bookings database → Bookings PostgreSQL: stores
- Bookings database → Outbox dispatcher: feeds outbox
- Outbox dispatcher → Kafka broker: publishes events
- Kafka broker → Booking event consumer: delivers events
- Booking event consumer → Events database: reserves seats
