# xhemilr/simplebookingsystem architecture

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

- Interactive diagram: https://gitdiagram.com/xhemilr/simplebookingsystem
- Repository: https://github.com/xhemilr/simplebookingsystem

## Overview

SimpleBookingSystem is a resource-booking web application. A user loads the resource list, selects a resource, enters dates and quantity, and submits a booking; the API checks availability, saves a booking, and requests an email notification. Resource browsing follows a separate API-to-service-to-repository path. The graph also shows the shared data-access layer and persistence context. The README is empty, so capabilities and connections are based on the sampled UI and source index; email delivery details and some runtime wiring were not inspected.

Main entry points: [`SimpleBookingSystem.Core/Services/BookingService.cs`](https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Services/BookingService.cs) (Booking service), [`simplebookingsystem.client/src/App.tsx`](https://github.com/xhemilr/simplebookingsystem/blob/master/simplebookingsystem.client/src/App.tsx) (Booking UI), [`SimpleBookingSystem.Server/Controllers/BookingController.cs`](https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Server/Controllers/BookingController.cs) (Booking API), [`SimpleBookingSystem.Core/Services/ResourceService.cs`](https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Services/ResourceService.cs) (Resource service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Booking UI<br/>[App.tsx]"]
  node_modal["Booking modal<br/>[Modal.tsx]"]
end

subgraph group_api["API"]
  node_booking_api["Booking API"]
  node_resource_api["Resource API"]
end

subgraph group_domain["Booking domain"]
  node_booking_service["Booking service<br/>[BookingService.cs]"]
  node_resource_service["Resource service<br/>[ResourceService.cs]"]
  node_booking_request["Booking request<br/>[BookingRequest.cs]"]
  node_booking_validator["Request validator"]
  node_booking_model["Booking model<br/>[Booking.cs]"]
  node_resource_model["Resource model<br/>[Resource.cs]"]
  node_mapping["Mapping profiles<br/>[Mappings]"]
  node_email_service["Email service<br/>[EmailService.cs]"]
  node_result["Result wrapper<br/>[Result.cs]"]
end

subgraph group_persistence["Persistence"]
  node_booking_repo["Booking repository"]
  node_resource_repo["Resource repository"]
  node_base_repo["Base repository"]
  node_dbcontext[("EF data context<br/>[AppDbContext.cs]")]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_modal
node_app -->|"fetches resources"| node_resource_api
node_app -->|"submits booking"| node_booking_api
node_booking_api -->|"calls"| node_booking_service
node_resource_api -->|"calls"| node_resource_service
node_booking_api -->|"accepts"| node_booking_request
node_booking_service -->|"reads"| node_booking_request
node_booking_service -->|"checks resource"| node_resource_repo
node_booking_service -->|"checks and saves"| node_booking_repo
node_booking_service -->|"requests notification"| node_email_service
node_booking_service -->|"maps to"| node_booking_model
node_booking_service -->|"returns"| node_result
node_resource_service -->|"reads resources"| node_resource_repo
node_resource_service -->|"returns"| node_result
node_booking_repo -->|"inherits"| node_base_repo
node_resource_repo -->|"inherits"| node_base_repo
node_base_repo -->|"queries and saves"| node_dbcontext
node_dbcontext -->|"stores"| node_booking_model
node_dbcontext -->|"stores"| node_resource_model
node_mapping -->|"maps"| node_booking_model
node_mapping -->|"maps"| node_resource_model

click node_app "https://github.com/xhemilr/simplebookingsystem/blob/master/simplebookingsystem.client/src/App.tsx"
click node_modal "https://github.com/xhemilr/simplebookingsystem/blob/master/simplebookingsystem.client/src/Modal.tsx"
click node_booking_api "https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Server/Controllers/BookingController.cs"
click node_resource_api "https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Server/Controllers/ResourceController.cs"
click node_booking_service "https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Services/BookingService.cs"
click node_resource_service "https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Services/ResourceService.cs"
click node_booking_request "https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Requests/BookingRequest.cs"
click node_booking_validator "https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Validators/BookingRequestValidator.cs"
click node_booking_model "https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Entities/Booking.cs"
click node_resource_model "https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Entities/Resource.cs"
click node_mapping "https://github.com/xhemilr/simplebookingsystem/tree/master/SimpleBookingSystem.Core/Mappings"
click node_email_service "https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Services/EmailService.cs"
click node_result "https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Wrapper/Result.cs"
click node_booking_repo "https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Infrastructure/Repositories/BookingRepositoryAsync.cs"
click node_resource_repo "https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Infrastructure/Repositories/ResourceRepositoryAsync.cs"
click node_base_repo "https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Infrastructure/Repositories/BaseRepositoryAsync.cs"
click node_dbcontext "https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Infrastructure/Data/AppDbContext.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_app,node_modal,node_user toneBlue
class node_booking_api,node_resource_api toneAmber
class node_booking_service,node_resource_service,node_booking_request,node_booking_validator,node_booking_model,node_resource_model,node_mapping,node_email_service,node_result toneMint
class node_booking_repo,node_resource_repo,node_base_repo,node_dbcontext toneRose
```

## Components

### Web client

- [Booking UI](https://github.com/xhemilr/simplebookingsystem/blob/master/simplebookingsystem.client/src/App.tsx): `simplebookingsystem.client/src/App.tsx`
- [Booking modal](https://github.com/xhemilr/simplebookingsystem/blob/master/simplebookingsystem.client/src/Modal.tsx): `simplebookingsystem.client/src/Modal.tsx`

### API

- [Booking API](https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Server/Controllers/BookingController.cs): `SimpleBookingSystem.Server/Controllers/BookingController.cs`
- [Resource API](https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Server/Controllers/ResourceController.cs): `SimpleBookingSystem.Server/Controllers/ResourceController.cs`

### Booking domain

- [Booking service](https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Services/BookingService.cs): `SimpleBookingSystem.Core/Services/BookingService.cs`
- [Resource service](https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Services/ResourceService.cs): `SimpleBookingSystem.Core/Services/ResourceService.cs`
- [Booking request](https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Requests/BookingRequest.cs): `SimpleBookingSystem.Core/Requests/BookingRequest.cs`
- [Request validator](https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Validators/BookingRequestValidator.cs): `SimpleBookingSystem.Core/Validators/BookingRequestValidator.cs`
- [Booking model](https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Entities/Booking.cs): `SimpleBookingSystem.Core/Entities/Booking.cs`
- [Resource model](https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Entities/Resource.cs): `SimpleBookingSystem.Core/Entities/Resource.cs`
- [Mapping profiles](https://github.com/xhemilr/simplebookingsystem/tree/master/SimpleBookingSystem.Core/Mappings): `SimpleBookingSystem.Core/Mappings`
- [Email service](https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Services/EmailService.cs): `SimpleBookingSystem.Core/Services/EmailService.cs`
- [Result wrapper](https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Core/Wrapper/Result.cs): `SimpleBookingSystem.Core/Wrapper/Result.cs`

### Persistence

- [Booking repository](https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Infrastructure/Repositories/BookingRepositoryAsync.cs): `SimpleBookingSystem.Infrastructure/Repositories/BookingRepositoryAsync.cs`
- [Resource repository](https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Infrastructure/Repositories/ResourceRepositoryAsync.cs): `SimpleBookingSystem.Infrastructure/Repositories/ResourceRepositoryAsync.cs`
- [Base repository](https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Infrastructure/Repositories/BaseRepositoryAsync.cs): `SimpleBookingSystem.Infrastructure/Repositories/BaseRepositoryAsync.cs`
- [EF data context](https://github.com/xhemilr/simplebookingsystem/blob/master/SimpleBookingSystem.Infrastructure/Data/AppDbContext.cs): `SimpleBookingSystem.Infrastructure/Data/AppDbContext.cs`

### Other components

- **User**

## Connections

- User → Booking UI: uses
- Booking UI → Booking modal: renders (evidence: `simplebookingsystem.client/src/App.tsx`)
- Booking UI → Resource API: fetches resources (evidence: `simplebookingsystem.client/src/App.tsx`)
- Booking UI → Booking API: submits booking (evidence: `simplebookingsystem.client/src/App.tsx`)
- Booking API → Booking service: calls (evidence: `SimpleBookingSystem.Server/Controllers/BookingController.cs`)
- Resource API → Resource service: calls (evidence: `SimpleBookingSystem.Server/Controllers/ResourceController.cs`)
- Booking API → Booking request: accepts (evidence: `SimpleBookingSystem.Server/Controllers/BookingController.cs`)
- Booking service → Booking request: reads (evidence: `SimpleBookingSystem.Core/Services/BookingService.cs`)
- Booking service → Resource repository: checks resource (evidence: `SimpleBookingSystem.Core/Services/BookingService.cs`)
- Booking service → Booking repository: checks and saves (evidence: `SimpleBookingSystem.Core/Services/BookingService.cs`)
- Booking service → Email service: requests notification (evidence: `SimpleBookingSystem.Core/Services/BookingService.cs`)
- Booking service → Booking model: maps to (evidence: `SimpleBookingSystem.Core/Services/BookingService.cs`)
- Booking service → Result wrapper: returns (evidence: `SimpleBookingSystem.Core/Services/BookingService.cs`)
- Resource service → Resource repository: reads resources (evidence: `SimpleBookingSystem.Core/Services/ResourceService.cs`)
- Resource service → Result wrapper: returns (evidence: `SimpleBookingSystem.Core/Services/ResourceService.cs`)
- Booking repository → Base repository: inherits (evidence: `SimpleBookingSystem.Infrastructure/Repositories/BookingRepositoryAsync.cs`)
- Resource repository → Base repository: inherits (evidence: `SimpleBookingSystem.Infrastructure/Repositories/ResourceRepositoryAsync.cs`)
- Base repository → EF data context: queries and saves (evidence: `SimpleBookingSystem.Infrastructure/Repositories/BaseRepositoryAsync.cs`)
- EF data context → Booking model: stores (evidence: `SimpleBookingSystem.Infrastructure/Data/AppDbContext.cs`)
- EF data context → Resource model: stores (evidence: `SimpleBookingSystem.Infrastructure/Data/AppDbContext.cs`)
- Mapping profiles → Booking model: maps (evidence: `SimpleBookingSystem.Core/Mappings/BookingProfile.cs`)
- Mapping profiles → Resource model: maps (evidence: `SimpleBookingSystem.Core/Mappings/ResourceProfile.cs`)
