# ibraheemd47/ticket_management_system_ architecture

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

- Interactive diagram: https://gitdiagram.com/ibraheemd47/ticket_management_system_
- Repository: https://github.com/ibraheemd47/ticket_management_system_

## Overview

1. **Overall shape**
   - This is a single Spring Boot 3.3.5 monolith built with Maven and Java 21.
   - The app combines backend business logic, persistence, security, and a Vaadin 24 UI in one deployable unit.
   - The main runtime entrypoint is `TicketManagementSystemApplication`.

2. **UI / presentation boundary**
   - The user-facing app is Vaadin-based, with views under `src/main/java/.../Frontend` and route/page classes under `.../endpoints`.
   - There is also a generated frontend bundle in `src/main/frontend/generated`, which is Vaadin Flow plumbing rather than hand-written app logic.
   - The UI layer talks to backend services directly through Spring-managed beans, not through a separate REST API boundary.

3. **Core business domains**
   - The codebase is organized around several business subdomains: **users/auth**, **events/tickets**, **orders/checkout**, **policies**, **companies**, **lottery**, **complaints**, and **notifications**.
   - These domains are represented by explicit domain objects in `Domain_Layer`, DTOs in `DTOs`, and application services in `Application_Layer`.
   - The event/ticket/order path is the most central flow in the system.

4. **Application layer as orchestration**
   - `Application_Layer` contains use-case services such as `TicketService`, `EventService`, `PaymentService`, `OrderMapper`, `LotteryService`, `UserService`, `SystemAdminService`, `ComplaintService`, and notification services.
   - These services coordinate domain objects, repositories, and external gateways.
   - This is where most workflows are assembled, including checkout, policy evaluation, role checks, and notification triggering.

5. **Domain model and invariants**
   - `Domain_Layer` holds the core business entities and rules: `Event`, `Seat`, `Area`, `Ticket`, `Purchase`, `OrderSaga`, `Policy`, `Lottery`, `Notification`, `Member`, `System_admin`, and `Company`.
   - The domain model includes explicit rule objects for purchase and discount policy composition, suggesting rich business rules rather than thin CRUD.
   - Concurrency-sensitive concepts appear in the domain too, such as `Lock`, `ActiveOrder`, and `WaitingQueue`, which indicate coordinated ticket reservation and checkout behavior.

6. **Checkout and order flow**
   - The order pipeline centers on `CheckoutDomainService`, `ActiveOrderService`, `PaymentService`, `Purchase`, `PaymentDetails`, `PaymentTransaction`, and `OrderSaga`.
   - `IPaymentGateway` and `ITicketSupplierGateway` are abstraction points for external integrations, while `PaymentGatewayProxy` and `TicketSupplierGatewayProxy` are infrastructure adapters.
   - The checkout flow likely goes from UI → application service → domain checks/policy validation → payment/supplier integration → persistence of order state and tickets.

7. **Event seating and inventory handling**
   - Event modeling includes seat/area structures (`SeatedArea`, `StandingArea`, `Row`, `Block`, `Seat`) and a `TicketGenerator`.
   - This suggests the system manages ticket allocation against structured event inventory, not just generic ticket records.
   - There is also a waiting queue subsystem, implying oversubscription handling when inventory is constrained.

8. **User, auth, and authorization**
   - Authentication is JWT-based with Spring Security; key classes include `SecurityConfig`, `AuthTokenService`, `AuthToken`, and token repositories.
   - User/account concerns include registration, verification, password hashing, profiles, suspension, and company roles.
   - Authorization is split across user roles, company permissions, and domain services such as `CompanyAuthorizationDomainService` and `PolicyAuthorizationDomainService`.

9. **Notifications and real-time updates**
   - Notifications are implemented as a dedicated subsystem spanning application, domain, communication, and infrastructure layers.
   - WebSocket support is configured through `NotificationWebSocketConfig`, with a broadcaster, session registry, handshake handler, and notification controller.
   - Infrastructure includes `WebSocketNotifier` and `NotificationRepository`, so notifications are both persisted and pushed in real time to connected clients.

10. **Persistence and infrastructure**
   - Persistence is handled by repositories in `Infastructure_Layer`, using an embedded H2 database per the README.
   - Repositories exist for events, tickets, users, companies, complaints, policies, orders, lotteries, notifications, and queue/order state.
   - This layer also contains cross-cutting adapters like password hashing, web configuration, and plugin/support classes.

11. **Bootstrap and sample data**
   - `DataInitializer` and `DemoDataLoader` seed the application with initial/demo state.
   - These are likely used to populate users, events, or policies for local development and testing.
   - `application.properties` and test-specific properties define runtime configuration such as database and security settings.

12. **Testing structure**
   - Tests are organized by domain and include unit, integration, acceptance, concurrency, and end-to-end system tests.
   - The presence of many concurrency tests is significant: tickets, orders, lotteries, and users all have contention-sensitive behavior.
   - This reflects an architecture where correctness under simultaneous access is a first-class concern.

13. **Main architectural boundaries for a diagram**
   - Best diagram boundaries are: **Vaadin UI**, **application services**, **domain model**, **repositories/infrastructure**, **security/auth**, and **WebSocket notifications**.
   - External dependencies to show explicitly are **H2**, **Spring Security/JWT**, and **WebSocket clients**.
   - The primary data flow is UI action → application service → domain rule evaluation → repository/gateway persistence or external call → notification/update back to UI.

Main entry points: [`src/main/java/com/sdnah/Ticket_Management_System_/Frontend`](https://github.com/ibraheemd47/ticket_management_system_/tree/main/src/main/java/com/sdnah/Ticket_Management_System_/Frontend) (Vaadin views), [`src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/Order/PaymentService.java`](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/Order/PaymentService.java) (Checkout services), [`src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/Notifications/NotificationService.java`](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/Notifications/NotificationService.java) (Notify service), [`src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Order/OrderSaga.java`](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Order/OrderSaga.java) (Order model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_ui["Vaadin UI"]
  node_node_ui_main["Vaadin views<br/>presentation"]
  node_node_ui_generated["Generated Flow<br/>vaadin plumbing"]
  node_node_backend_endpoints["Route pages<br/>routes"]
end

subgraph group_group_app["Application"]
  node_node_app_user["User services<br/>account orchestration<br/>[UserService.java]"]
  node_node_app_event["Event service<br/>event orchestration<br/>[EventService.java]"]
  node_node_app_order["Checkout services<br/>checkout orchestration"]
  node_node_app_lottery["Lottery service<br/>raffle orchestration"]
  node_node_app_company["Company services<br/>company orchestration"]
  node_node_app_complaint["Complaint service<br/>support orchestration"]
  node_node_app_notify["Notify service<br/>notification orchestration"]
end

subgraph group_group_domain["Domain"]
  node_node_domain_event["Event model<br/>seating domain<br/>[Event.java]"]
  node_node_domain_order["Order model<br/>checkout domain<br/>[OrderSaga.java]"]
  node_node_domain_policy["Policy model<br/>rule domain<br/>[Policy.java]"]
  node_node_domain_user["User model<br/>identity domain<br/>[Member.java]"]
  node_node_domain_company["Company model<br/>authorization domain<br/>[Company.java]"]
  node_node_domain_lottery["Lottery model<br/>raffle domain<br/>[Lottery.java]"]
  node_node_domain_complaint["Complaint model<br/>support domain<br/>[Complaint.java]"]
  node_node_domain_notify["Notification model<br/>message domain<br/>[Notification.java]"]
end

subgraph group_group_infra["Infrastructure"]
  node_node_infra_repo[("Repositories<br/>persistence adapters")]
  node_node_infra_gw["Gateways<br/>external adapters"]
  node_node_h2[("H2 database<br/>embedded db")]
end

subgraph group_group_sec["Security & Realtime"]
  node_node_infra_ws["WebSocket infra<br/>realtime adapter<br/>[Broadcaster.java]"]
  node_node_sec_config["Security config<br/>jwt security"]
end

subgraph group_group_boot["Bootstrap"]
  node_node_app(("Spring Boot app<br/>entrypoint"))
  node_node_bootstrap["Seed data<br/>initializer"]
end

node_node_app -->|"starts UI"| node_node_ui_main
node_node_app -->|"registers routes"| node_node_backend_endpoints
node_node_backend_endpoints -->|"navigates"| node_node_ui_main
node_node_ui_main -->|"calls beans"| node_node_app_user
node_node_ui_main -->|"calls beans"| node_node_app_event
node_node_ui_main -->|"calls beans"| node_node_app_order
node_node_ui_main -->|"calls beans"| node_node_app_company
node_node_ui_main -->|"calls beans"| node_node_app_complaint
node_node_ui_main -->|"receives updates"| node_node_app_notify
node_node_ui_generated -.->|"plumbing"| node_node_ui_main
node_node_app_user -->|"uses"| node_node_domain_user
node_node_app_user -->|"auth"| node_node_sec_config
node_node_app_event -->|"uses"| node_node_domain_event
node_node_app_order -->|"uses"| node_node_domain_order
node_node_app_order -->|"checks policies"| node_node_domain_policy
node_node_app_order -->|"integrates"| node_node_infra_gw
node_node_app_lottery -->|"uses"| node_node_domain_lottery
node_node_app_company -->|"uses"| node_node_domain_company
node_node_app_complaint -->|"uses"| node_node_domain_complaint
node_node_app_notify -->|"uses"| node_node_domain_notify
node_node_app_notify -->|"pushes"| node_node_infra_ws
node_node_app_notify -->|"persists"| node_node_infra_repo
node_node_domain_order -->|"reserves seats"| node_node_domain_event
node_node_domain_order -->|"enforces"| node_node_domain_policy
node_node_domain_user -->|"roles"| node_node_domain_company
node_node_domain_event -.->|"feeds"| node_node_domain_lottery
node_node_infra_repo -->|"stores data"| node_node_h2
node_node_infra_gw -->|"external side effects"| node_node_domain_order
node_node_infra_ws -->|"pushes updates"| node_node_ui_main
node_node_sec_config -->|"authorizes"| node_node_domain_user
node_node_bootstrap -->|"seeds"| node_node_infra_repo

click node_node_app "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/TicketManagementSystemApplication.java"
click node_node_ui_main "https://github.com/ibraheemd47/ticket_management_system_/tree/main/src/main/java/com/sdnah/Ticket_Management_System_/Frontend"
click node_node_ui_generated "https://github.com/ibraheemd47/ticket_management_system_/tree/main/src/main/frontend/generated"
click node_node_backend_endpoints "https://github.com/ibraheemd47/ticket_management_system_/tree/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/endpoints"
click node_node_app_user "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/UserService.java"
click node_node_app_event "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/EventService.java"
click node_node_app_order "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/Order/PaymentService.java"
click node_node_app_lottery "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/LotteryService.java"
click node_node_app_company "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/Company/CompanyRoleService.java"
click node_node_app_complaint "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/ComplaintService.java"
click node_node_app_notify "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/Notifications/NotificationService.java"
click node_node_domain_event "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Event/Event.java"
click node_node_domain_order "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Order/OrderSaga.java"
click node_node_domain_policy "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Policy/Policy.java"
click node_node_domain_user "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/User/Member.java"
click node_node_domain_company "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Company/Company.java"
click node_node_domain_lottery "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Lottery/Lottery.java"
click node_node_domain_complaint "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/User/Complaint.java"
click node_node_domain_notify "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Notifications/Notification.java"
click node_node_infra_repo "https://github.com/ibraheemd47/ticket_management_system_/tree/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Infastructure_Layer"
click node_node_infra_gw "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Infastructure_Layer/PaymentGatewayProxy.java"
click node_node_infra_ws "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Communication_Layer/Notifications/Broadcaster.java"
click node_node_sec_config "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/SecurityConfig.java"
click node_node_bootstrap "https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/DataInitializer.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_node_ui_main,node_node_ui_generated,node_node_backend_endpoints toneBlue
class node_node_app_user,node_node_app_event,node_node_app_order,node_node_app_lottery,node_node_app_company,node_node_app_complaint,node_node_app_notify toneAmber
class node_node_domain_event,node_node_domain_order,node_node_domain_policy,node_node_domain_user,node_node_domain_company,node_node_domain_lottery,node_node_domain_complaint,node_node_domain_notify toneMint
class node_node_infra_repo,node_node_infra_gw,node_node_h2 toneRose
class node_node_infra_ws,node_node_sec_config toneIndigo
class node_node_app,node_node_bootstrap toneTeal
```

## Components

### Vaadin UI

User-facing Vaadin views and route pages.

- [Vaadin views](https://github.com/ibraheemd47/ticket_management_system_/tree/main/src/main/java/com/sdnah/Ticket_Management_System_/Frontend): presentation · Primary UI screens and route-driven views. · `src/main/java/com/sdnah/Ticket_Management_System_/Frontend`
- [Generated Flow](https://github.com/ibraheemd47/ticket_management_system_/tree/main/src/main/frontend/generated): vaadin plumbing · Generated frontend bundle and Flow glue code. · `src/main/frontend/generated`
- [Route pages](https://github.com/ibraheemd47/ticket_management_system_/tree/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/endpoints): routes · Endpoint classes that wire pages and navigation. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/endpoints`

### Application

Use-case services and orchestration.

- [User services](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/UserService.java): account orchestration · Registration, verification, profiles, and admin/user flows. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/UserService.java`
- [Event service](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/EventService.java): event orchestration · Event and ticket use-cases. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/EventService.java`
- [Checkout services](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/Order/PaymentService.java): checkout orchestration · Order, payment, policy, and reservation workflows. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/Order/PaymentService.java`
- [Lottery service](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/LotteryService.java): raffle orchestration · Lottery entry and draw coordination. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/LotteryService.java`
- [Company services](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/Company/CompanyRoleService.java): company orchestration · Company roles and management workflows. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/Company/CompanyRoleService.java`
- [Complaint service](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/ComplaintService.java): support orchestration · Complaint creation and handling workflows. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/ComplaintService.java`
- [Notify service](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/Notifications/NotificationService.java): notification orchestration · Notification creation and dispatch coordination. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Application_Layer/Notifications/NotificationService.java`

### Domain

Core business model and rules.

- [Event model](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Event/Event.java): seating domain · Events, areas, seats, and ticket generation rules. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Event/Event.java`
- [Order model](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Order/OrderSaga.java): checkout domain · Purchase, active order, saga, payment, and locking concepts. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Order/OrderSaga.java`
- [Policy model](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Policy/Policy.java): rule domain · Purchase and discount policy composition and evaluation. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Policy/Policy.java`
- [User model](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/User/Member.java): identity domain · Members, admins, auth tokens, roles, and suspensions. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/User/Member.java`
- [Company model](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Company/Company.java): authorization domain · Company entities, permissions, and role assignments. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Company/Company.java`
- [Lottery model](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Lottery/Lottery.java): raffle domain · Lottery entries and lottery state. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Lottery/Lottery.java`
- [Complaint model](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/User/Complaint.java): support domain · Complaint entities and status lifecycle. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/User/Complaint.java`
- [Notification model](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Notifications/Notification.java): message domain · Notification entities and types. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Domain_Layer/Notifications/Notification.java`

### Infrastructure

Repositories and external adapters.

- [Repositories](https://github.com/ibraheemd47/ticket_management_system_/tree/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Infastructure_Layer): persistence adapters · JPA/repository layer for events, orders, users, policies, lottery, and complaints. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Infastructure_Layer`
- [Gateways](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Infastructure_Layer/PaymentGatewayProxy.java): external adapters · Payment and ticket-supplier integration proxies. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Infastructure_Layer/PaymentGatewayProxy.java`
- **H2 database**: embedded db · Embedded persistence store used by the application.

### Security & Realtime

Authentication, authorization, and notifications.

- [WebSocket infra](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/Communication_Layer/Notifications/Broadcaster.java): realtime adapter · Session registry, broadcaster, handshake, and notifier plumbing. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/Communication_Layer/Notifications/Broadcaster.java`
- [Security config](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/SecurityConfig.java): jwt security · Spring Security and JWT/token configuration. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/SecurityConfig.java`

### Bootstrap

Application startup and seed data.

- [Spring Boot app](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/TicketManagementSystemApplication.java): entrypoint · Main JVM entrypoint for the monolith. · `src/main/java/com/sdnah/Ticket_Management_System_/TicketManagementSystemApplication.java`
- [Seed data](https://github.com/ibraheemd47/ticket_management_system_/blob/main/src/main/java/com/sdnah/Ticket_Management_System_/Backend/DataInitializer.java): initializer · Application initializers and demo data loaders. · `src/main/java/com/sdnah/Ticket_Management_System_/Backend/DataInitializer.java`

## Connections

- Spring Boot app → Vaadin views: starts UI · Bootstraps the Vaadin application.
- Spring Boot app → Route pages: registers routes · Exposes route/page entrypoints.
- Route pages → Vaadin views: navigates · Pages are rendered through Vaadin views.
- Vaadin views → User services: calls beans · Views invoke Spring-managed services directly.
- Vaadin views → Event service: calls beans · Event screens coordinate through application services.
- Vaadin views → Checkout services: calls beans · Checkout and order screens use orchestration services.
- Vaadin views → Company services: calls beans · Company screens call company services.
- Vaadin views → Complaint service: calls beans · Complaint screens use complaint services.
- Vaadin views → Notify service: receives updates · Notification UI consumes pushed updates.
- Generated Flow → Vaadin views: plumbing · Generated Flow artifacts support the hand-written Vaadin views.
- User services → User model: uses · User orchestration depends on identity domain rules.
- User services → Security config: auth · Integrates with security and token handling.
- Event service → Event model: uses · Event use-cases operate on the event model.
- Checkout services → Order model: uses · Checkout logic centers on order and payment domain objects.
- Checkout services → Policy model: checks policies · Policy evaluation gates purchase and checkout.
- Checkout services → Gateways: integrates · Payments and ticket supply go through gateway adapters.
- Lottery service → Lottery model: uses · Lottery workflows operate on lottery entities.
- Company services → Company model: uses · Company role orchestration depends on company domain objects.
- Complaint service → Complaint model: uses · Complaint handling works on complaint entities.
- Notify service → Notification model: uses · Notification service creates and manages notifications.
- Notify service → WebSocket infra: pushes · Notification service broadcasts over WebSockets.
- Notify service → Repositories: persists · Notifications are stored through repositories.
- Order model → Event model: reserves seats · Orders interact with event inventory and ticket generation.
- Order model → Policy model: enforces · Order saga and checkout follow policy rules.
- User model → Company model: roles · User identities participate in company role assignments.
- Event model → Lottery model: feeds · Lottery can depend on event participation/inventory.
- Repositories → H2 database: stores data · Repositories persist to the embedded H2 database.
- Gateways → Order model: external side effects · Payment/ticket supplier calls are triggered by checkout flows.
- WebSocket infra → Vaadin views: pushes updates · WebSocket notifications update connected clients.
- Security config → User model: authorizes · Security configuration protects user/account actions.
- Seed data → Repositories: seeds · Initial data loaders populate repositories.
