# joeclack/thamco-events-management architecture

> Architecture diagram of the GitHub repository joeclack/thamco-events-management, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/joeclack/thamco-events-management
- Repository: https://github.com/joeclack/thamco-events-management

## Overview

##### Main Components
- ThAmCo.Events Web Application – This ASP.NET Core Razor Pages project is the primary UI layer for managing events, guests, staff, and integrating with catering and venue functionalities.
- ThAmCo.Catering Web Service – An ASP.NET Core API that manages food items, menus, and food bookings.
- ThAmCo.Venues Web Service – A pre-built, external web service providing venue querying and booking capabilities.
- Database(s) – Multiple SQL Server databases (or logically separated schemas) underpin each service (using EntityFramework Core in both the Events and Catering projects, and the Venues project similarly).
- Identity & User Management – Embedded within the Events project using ASP.NET Core Identity (visible under the Areas/Identity folder).

##### Relationships and Interactions
- The Events Web Application acts as the central orchestration layer. It interacts with the Catering API for food-related operations (like booking food for events) and with the Venues service for venue reservation functions.
- Events → Catering: For operations such as food booking, retrieving menus, and food items.
- Events → Venues: For venue availability checks, reservations, and cancellations.
- Internal layers within each service should be depicted to illustrate the layered architecture:
- For example, in ThAmCo.Events, show the separation between the Presentation Layer (Razor Pages), Business Logic (Services such as EventService, GuestService, StaffService), and Data Access (ApplicationDbContext, EventsDbContext).
- Similarly, in ThAmCo.Catering, display the Controllers (handling API requests), Data Access (CateringDbContext), DTOs (data transfer objects) and Models (defining domain entities).

##### Architectural Patterns and Design Principles
- The solution is organized with clear separation of concerns (layered architecture). Each project uses controllers, models, DTOs, and a corresponding DbContext to encapsulate data operations.
- Many-to-many or one-to-many relationships (e.g., many-to-many between menus and food items in the Catering service, and one-to-many between events and guests in the Events application).

##### Relevant Technologies and Tools
- ASP.NET Core 6.0 for both web and API components.
- EntityFramework Core for O/RM and data management.
- MSSQL as the relational database backend.
- ASP.NET Core Identity for managing authentication/authorization in the Events project.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Main Application Nodes
    EventsApp["ThAmCo.Events Web Application"]:::events
    CateringApp["ThAmCo.Catering Web Service"]:::api
    VenuesService["ThAmCo.Venues Web Service"]:::venues

    %% Subgraph for ThAmCo.Events internal layers
    subgraph "Events - Internal Layers"
        EUI["UI Layer (Razor Pages)"]:::events
        EIdentity["Identity & User Management"]:::events
        EBLS["Business Logic & Services"]:::events
        EData["Data Access Layer (ApplicationDbContext,EventsDbContext)"]:::events
    end

    %% Subgraph for ThAmCo.Catering internal layers
    subgraph "Catering - Internal Layers"
        CAPI["API Layer (Controllers,DTOs,Models)"]:::api
        CData["Data Access (CateringDbContext)"]:::api
    end

    %% Database Nodes
    DBEvents["MSSQL Database (Events)"]:::db
    DBCatering["MSSQL Database (Catering)"]:::db

    %% Relationships - Internal connections for Events Application
    EventsApp -->|"routes-to"| EUI
    EventsApp -->|"handles-auth"| EIdentity
    EventsApp -->|"executes"| EBLS
    EventsApp -->|"stores-data"| EData

    %% Relationships - Internal connections for Catering Service
    CateringApp -->|"exposes-API"| CAPI
    CateringApp -->|"stores-data"| CData

    %% External Integrations and Database Connectivity
    EUI -->|"FoodBookingAPICall"| CAPI
    EUI -->|"VenueReservationQuery"| VenuesService
    EData -->|"EFCoreOperations"| DBEvents
    CData -->|"EFCoreOperations"| DBCatering

    %% Click Events
    click EventsApp "https://github.com/joeclack/thamco-events-management/blob/master/ThAmCo.Events"
    click CateringApp "https://github.com/joeclack/thamco-events-management/blob/master/ThAmCo.Catering"
    click VenuesService "https://github.com/joeclack/thamco-events-management/blob/master/ThAmCo.Venues"
    click EData "https://github.com/joeclack/thamco-events-management/tree/master/ThAmCo.Events/Data"
    click CData "https://github.com/joeclack/thamco-events-management/blob/master/ThAmCo.Catering/Data/CateringDbContext.cs"
    click EIdentity "https://github.com/joeclack/thamco-events-management/tree/master/ThAmCo.Events/Areas/Identity"
    click EBLS "https://github.com/joeclack/thamco-events-management/tree/master/ThAmCo.Events/Services"

    %% Styles
    classDef events fill:#FAD7A0,stroke:#E67E22,stroke-width:2px;
    classDef api fill:#AED6F1,stroke:#3498DB,stroke-width:2px;
    classDef venues fill:#A9DFBF,stroke:#28B463,stroke-width:2px;
    classDef db fill:#F9E79F,stroke:#F1C40F,stroke-width:2px;
```
