# ashjha75/ticketing-system architecture

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

- Interactive diagram: https://gitdiagram.com/ashjha75/ticketing-system
- Repository: https://github.com/ashjha75/ticketing-system

## Overview

This is an Angular client and Spring modular-monolith API for event ticket sales. Users authenticate, browse published events, reserve tickets, manage bookings, and view profiles; administrators manage events and inspect booking/revenue metrics. The backend’s booking service owns validation, inventory reservation, persistence, and confirmation notification, while inventory locking protects concurrent stock changes. The README documents PostgreSQL, Redis caching, and rate limiting; source excerpts were sampled selectively, so links for unsampled feature wiring are limited to documented capabilities and evident module boundaries.

Main entry points: [`ticketing-system/src/main/java/com/ashish/ticketing/modules/booking/service/BookingService.java`](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/booking/service/BookingService.java) (Booking orchestration), [`ticketing-system-ui/src/app/app.module.ts`](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system-ui/src/app/app.module.ts) (Angular app), [`ticketing-system/src/main/java/com/ashish/ticketing/modules/event/service/EventQueryService.java`](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/event/service/EventQueryService.java) (Event search), [`ticketing-system/src/main/java/com/ashish/ticketing/modules/auth/service/AuthService.java`](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/auth/service/AuthService.java) (Auth orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Angular client"]
  node_app["Angular app<br/>[app.module.ts]"]
  node_authui["Login and register<br/>[login.component.ts]"]
  node_eventui["Event browsing"]
  node_detailui["Event details"]
  node_bookingui["Bookings view"]
  node_adminui["Admin dashboard"]
  node_userui["Profile"]
end

subgraph group_identity["Identity and users"]
  node_authsvc["Auth service<br/>[auth.service.ts]"]
  node_authapi["Auth endpoints"]
  node_authservice["Auth orchestration<br/>[AuthService.java]"]
  node_users["User management<br/>[UserService.java]"]
  node_security["JWT security"]
end

subgraph group_catalog["Events and catalog"]
  node_eventapi["Event endpoints"]
  node_eventquery["Event search"]
  node_eventadmin["Event administration"]
  node_eventcommands["Event commands"]
end

subgraph group_sales["Booking and inventory"]
  node_bookingapi["Booking endpoints"]
  node_bookingservice["Booking orchestration"]
  node_bookingquery["Booking queries"]
  node_inventory["Inventory control"]
end

subgraph group_operations["Operations"]
  node_adminapi["Admin endpoints"]
  node_adminservice["Dashboard metrics<br/>[AdminService.java]"]
  node_notification["Email notifications"]
  node_scheduler["Retry and expiry jobs"]
  node_audit["Audit logging<br/>[AuditService.java]"]
end

node_visitor(("User or admin"))
node_postgres[("PostgreSQL")]
node_redis[("Redis cache")]
node_email["Email provider"]

node_visitor -->|"uses"| node_app
node_app -->|"renders"| node_authui
node_app -->|"renders"| node_eventui
node_app -->|"renders"| node_bookingui
node_app -->|"renders"| node_adminui
node_authui -->|"authenticates"| node_authsvc
node_authsvc -->|"HTTP requests"| node_authapi
node_authapi -->|"dispatches"| node_authservice
node_authservice -->|"validates users"| node_users
node_authservice -->|"persists tokens and users"| node_postgres
node_security -->|"secures routes"| node_authapi
node_eventui -->|"browses events"| node_eventapi
node_detailui -->|"loads details"| node_eventapi
node_eventapi -->|"dispatches queries"| node_eventquery
node_eventquery -->|"reads events"| node_postgres
node_eventadmin -->|"manages events"| node_eventcommands
node_eventcommands -->|"writes events"| node_postgres
node_bookingui -->|"manages bookings"| node_bookingapi
node_bookingapi -->|"dispatches"| node_bookingservice
node_bookingservice -->|"loads active user"| node_users
node_bookingservice -->|"loads published event"| node_eventquery
node_bookingservice -->|"reserves or releases"| node_inventory
node_bookingservice -->|"reads bookings"| node_bookingquery
node_bookingservice -->|"saves booking"| node_postgres
node_bookingservice -->|"requests confirmation"| node_notification
node_inventory -->|"locks and updates stock"| node_postgres
node_adminui -->|"requests metrics"| node_adminapi
node_adminapi -->|"dispatches"| node_adminservice
node_adminservice -->|"aggregates metrics"| node_postgres
node_notification -.->|"sends email"| node_email
node_scheduler -->|"retries failures"| node_notification
node_audit -->|"writes audit logs"| node_postgres
node_eventquery -.->|"caches reads"| node_redis

click node_app "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system-ui/src/app/app.module.ts"
click node_authui "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system-ui/src/app/components/auth/login/login.component.ts"
click node_eventui "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system-ui/src/app/components/events/event-list/event-list.component.ts"
click node_detailui "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system-ui/src/app/components/events/event-detail/event-detail.component.ts"
click node_bookingui "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system-ui/src/app/components/bookings/booking-list/booking-list.component.ts"
click node_adminui "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system-ui/src/app/components/admin/dashboard/dashboard.component.ts"
click node_authsvc "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system-ui/src/app/services/auth.service.ts"
click node_authapi "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/auth/controller/AuthController.java"
click node_authservice "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/auth/service/AuthService.java"
click node_users "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/user/service/UserService.java"
click node_userui "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system-ui/src/app/components/profile/profile.component.ts"
click node_eventapi "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/event/controller/EventController.java"
click node_eventquery "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/event/service/EventQueryService.java"
click node_eventadmin "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/event/service/EventCommandService.java"
click node_adminapi "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/admin/controller/AdminController.java"
click node_adminservice "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/admin/service/AdminService.java"
click node_bookingapi "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/booking/controller/BookingController.java"
click node_bookingservice "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/booking/service/BookingService.java"
click node_bookingquery "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/booking/service/BookingQueryService.java"
click node_inventory "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/inventory/service/InventoryService.java"
click node_eventcommands "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/event/service/EventCommandService.java"
click node_notification "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/notification/service/NotificationService.java"
click node_scheduler "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/scheduler/NotificationRetryScheduler.java"
click node_audit "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/audit/service/AuditService.java"
click node_security "https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/config/SecurityConfig.java"

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_app,node_authui,node_eventui,node_detailui,node_bookingui,node_adminui,node_userui,node_visitor toneBlue
class node_authsvc,node_authapi,node_authservice,node_users,node_security,node_postgres,node_redis toneAmber
class node_eventapi,node_eventquery,node_eventadmin,node_eventcommands toneMint
class node_bookingapi,node_bookingservice,node_bookingquery,node_inventory toneRose
class node_adminapi,node_adminservice,node_notification,node_scheduler,node_audit,node_email toneIndigo
```

## Components

### Angular client

- [Angular app](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system-ui/src/app/app.module.ts): `ticketing-system-ui/src/app/app.module.ts`
- [Login and register](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system-ui/src/app/components/auth/login/login.component.ts): `ticketing-system-ui/src/app/components/auth/login/login.component.ts`
- [Event browsing](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system-ui/src/app/components/events/event-list/event-list.component.ts): `ticketing-system-ui/src/app/components/events/event-list/event-list.component.ts`
- [Event details](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system-ui/src/app/components/events/event-detail/event-detail.component.ts): `ticketing-system-ui/src/app/components/events/event-detail/event-detail.component.ts`
- [Bookings view](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system-ui/src/app/components/bookings/booking-list/booking-list.component.ts): `ticketing-system-ui/src/app/components/bookings/booking-list/booking-list.component.ts`
- [Admin dashboard](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system-ui/src/app/components/admin/dashboard/dashboard.component.ts): `ticketing-system-ui/src/app/components/admin/dashboard/dashboard.component.ts`
- [Profile](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system-ui/src/app/components/profile/profile.component.ts): `ticketing-system-ui/src/app/components/profile/profile.component.ts`

### Identity and users

- [Auth service](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system-ui/src/app/services/auth.service.ts): `ticketing-system-ui/src/app/services/auth.service.ts`
- [Auth endpoints](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/auth/controller/AuthController.java): `ticketing-system/src/main/java/com/ashish/ticketing/modules/auth/controller/AuthController.java`
- [Auth orchestration](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/auth/service/AuthService.java): `ticketing-system/src/main/java/com/ashish/ticketing/modules/auth/service/AuthService.java`
- [User management](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/user/service/UserService.java): `ticketing-system/src/main/java/com/ashish/ticketing/modules/user/service/UserService.java`
- [JWT security](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/config/SecurityConfig.java): `ticketing-system/src/main/java/com/ashish/ticketing/config/SecurityConfig.java`

### Events and catalog

- [Event endpoints](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/event/controller/EventController.java): `ticketing-system/src/main/java/com/ashish/ticketing/modules/event/controller/EventController.java`
- [Event search](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/event/service/EventQueryService.java): `ticketing-system/src/main/java/com/ashish/ticketing/modules/event/service/EventQueryService.java`
- [Event administration](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/event/service/EventCommandService.java): `ticketing-system/src/main/java/com/ashish/ticketing/modules/event/service/EventCommandService.java`
- [Event commands](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/event/service/EventCommandService.java): `ticketing-system/src/main/java/com/ashish/ticketing/modules/event/service/EventCommandService.java`

### Booking and inventory

- [Booking endpoints](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/booking/controller/BookingController.java): `ticketing-system/src/main/java/com/ashish/ticketing/modules/booking/controller/BookingController.java`
- [Booking orchestration](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/booking/service/BookingService.java): `ticketing-system/src/main/java/com/ashish/ticketing/modules/booking/service/BookingService.java`
- [Booking queries](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/booking/service/BookingQueryService.java): `ticketing-system/src/main/java/com/ashish/ticketing/modules/booking/service/BookingQueryService.java`
- [Inventory control](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/inventory/service/InventoryService.java): `ticketing-system/src/main/java/com/ashish/ticketing/modules/inventory/service/InventoryService.java`

### Operations

- [Admin endpoints](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/admin/controller/AdminController.java): `ticketing-system/src/main/java/com/ashish/ticketing/modules/admin/controller/AdminController.java`
- [Dashboard metrics](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/admin/service/AdminService.java): `ticketing-system/src/main/java/com/ashish/ticketing/modules/admin/service/AdminService.java`
- [Email notifications](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/notification/service/NotificationService.java): `ticketing-system/src/main/java/com/ashish/ticketing/modules/notification/service/NotificationService.java`
- [Retry and expiry jobs](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/scheduler/NotificationRetryScheduler.java): `ticketing-system/src/main/java/com/ashish/ticketing/modules/scheduler/NotificationRetryScheduler.java`
- [Audit logging](https://github.com/ashjha75/ticketing-system/blob/dev_v1/ticketing-system/src/main/java/com/ashish/ticketing/modules/audit/service/AuditService.java): `ticketing-system/src/main/java/com/ashish/ticketing/modules/audit/service/AuditService.java`

### Other components

- **User or admin**
- **PostgreSQL**
- **Redis cache**
- **Email provider**

## Connections

- User or admin → Angular app: uses
- Angular app → Login and register: renders
- Angular app → Event browsing: renders
- Angular app → Bookings view: renders
- Angular app → Admin dashboard: renders
- Login and register → Auth service: authenticates
- Auth service → Auth endpoints: HTTP requests
- Auth endpoints → Auth orchestration: dispatches
- Auth orchestration → User management: validates users
- Auth orchestration → PostgreSQL: persists tokens and users
- JWT security → Auth endpoints: secures routes
- Event browsing → Event endpoints: browses events
- Event details → Event endpoints: loads details
- Event endpoints → Event search: dispatches queries
- Event search → PostgreSQL: reads events
- Event administration → Event commands: manages events
- Event commands → PostgreSQL: writes events
- Bookings view → Booking endpoints: manages bookings
- Booking endpoints → Booking orchestration: dispatches
- Booking orchestration → User management: loads active user
- Booking orchestration → Event search: loads published event
- Booking orchestration → Inventory control: reserves or releases
- Booking orchestration → Booking queries: reads bookings
- Booking orchestration → PostgreSQL: saves booking
- Booking orchestration → Email notifications: requests confirmation
- Inventory control → PostgreSQL: locks and updates stock
- Admin dashboard → Admin endpoints: requests metrics
- Admin endpoints → Dashboard metrics: dispatches
- Dashboard metrics → PostgreSQL: aggregates metrics
- Email notifications → Email provider: sends email
- Retry and expiry jobs → Email notifications: retries failures
- Audit logging → PostgreSQL: writes audit logs
- Event search → Redis cache: caches reads
