# bania1/eventease architecture

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

- Interactive diagram: https://gitdiagram.com/bania1/eventease
- Repository: https://github.com/bania1/eventease

## Overview

##### Project type and purpose
- This is a monolithic full-stack ASP.NET Core MVC web application (“eventease”) that lets end users browse and book events and enables organizers (and admins) to manage events, users, tickets, and generate QR codes.

##### File structure
- Top-level solution folder: eventease-app.sln
- Single ASP.NET Core MVC project (eventease-app) containing:
- Controllers (Auth, Home, Events, Tickets, Users, Admin, QRCode) – entry points for HTTP requests
- Views (Razor .cshtml files organized by feature and Shared layouts) – server-side rendered UI
- Models (Event, User, Ticket, Guest, Notification, Transaction, DbContext) – domain entities and EF Core context
- Services (e.g. IPasswordHasherService/PasswordHasherService) – business or utility logic
- Migrations – EF Core database schema evolution
- Program.cs and appsettings.json – application startup and configuration
- wwwroot – static assets (Bootstrap, jQuery, site CSS/JS, QR code images folder)
- QRCoder folder – library code for generating QR codes

##### Extract architecture insights from the README
- Purpose re-affirmed: booking events and organizer management
- No separate microservices or frontend frameworks, it is server-rendered MVC

##### Main components
a. Client Layer (Web Browser)
- Static assets delivered from wwwroot (HTML/CSS/JS/Bootstrap/jQuery)
b. Presentation Layer (ASP.NET Core MVC)
- Controllers handle HTTP routes (AuthController, EventsController, etc.)
- Views render HTML responses
c. Business Logic Layer
- Service interfaces and implementations (PasswordHasherService, QRCoder library)
- Controllers may call services for hashing passwords, generating QR codes, sending notifications
d. Data Access Layer
- EF Core DbContext (eventeaseContext)
- Migrations manage schema updates
e. Persistence
- SQL Server or other relational database (connection string in appsettings.json)
f. External Libraries/Services
- QRCoder (in-project library)
- Client frameworks: Bootstrap, jQuery

##### Relationships and interactions
- Client → HTTP GET/POST → Controllers
- Controllers → call Services → potentially call QRCoder library or hashing service
- Controllers/Services → EF Core DbContext → Database
- DbContext → SQL queries → Database
- Controllers → select Views → return HTML + JSON + static assets → Client

##### Architectural patterns and design principles
- MVC: clear separation of Models, Views, Controllers
- Dependency Injection: services registered in Program.cs, injected into controllers
- Layered architecture: Presentation → Business → Data
- Convention-based routing and folder structure typical of ASP.NET Core MVC

##### Technologies and frameworks
- ASP.NET Core MVC (.NET 7+ likely)
- Entity Framework Core
- SQL Server (or another relational provider)
- Razor Views (.cshtml)
- QRCoder library for QR generation
- Bootstrap & jQuery for client UI

##### Detailed capture of essential elements
- MVC pattern: Controllers pick a View and a Model
- Custom business services (password hashing, notifications)
- EF Core migrations as part of Data Access
- Configuration source (appsettings.json) feeding the DbContext and service registrations

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    Client["Web Browser"]:::client
    StaticAssets["Static Assets (wwwroot)"]:::client
    Client -->|HTTP GET static| StaticAssets
    click StaticAssets "https://github.com/bania1/eventease/tree/main/eventease-app/eventease-app/wwwroot"

    %% Presentation Layer
    subgraph "Presentation Layer"
        subgraph "Controllers"
            AuthCtrl["AuthController"]:::controller
            HomeCtrl["HomeController"]:::controller
            EventsCtrl["EventsController"]:::controller
            TicketsCtrl["TicketsController"]:::controller
            UsersCtrl["UsersController"]:::controller
            AdminCtrl["AdminController"]:::controller
            QRCodeCtrl["QRCodeController"]:::controller
            AboutCtrl["AboutController"]:::controller
        end
        Views["Views (Razor .cshtml)"]:::view
        AuthCtrl -->|renders| Views
        HomeCtrl -->|renders| Views
        EventsCtrl -->|renders| Views
        TicketsCtrl -->|renders| Views
        UsersCtrl -->|renders| Views
        AdminCtrl -->|renders| Views
        QRCodeCtrl -->|renders| Views
        AboutCtrl -->|renders| Views
    end

    Client -->|HTTP GET/POST| AuthCtrl
    Client -->|HTTP GET/POST| HomeCtrl
    Client -->|HTTP GET/POST| EventsCtrl
    Client -->|HTTP GET/POST| TicketsCtrl
    Client -->|HTTP GET/POST| UsersCtrl
    Client -->|HTTP GET/POST| AdminCtrl
    Client -->|HTTP GET/POST| QRCodeCtrl
    Client -->|HTTP GET/POST| AboutCtrl

    click AuthCtrl "https://github.com/bania1/eventease/blob/main/eventease-app/eventease-app/Controllers/AuthController.cs"
    click HomeCtrl "https://github.com/bania1/eventease/blob/main/eventease-app/eventease-app/Controllers/HomeController.cs"
    click EventsCtrl "https://github.com/bania1/eventease/blob/main/eventease-app/eventease-app/Controllers/EventsController.cs"
    click TicketsCtrl "https://github.com/bania1/eventease/blob/main/eventease-app/eventease-app/Controllers/TicketsController.cs"
    click UsersCtrl "https://github.com/bania1/eventease/blob/main/eventease-app/eventease-app/Controllers/UsersController.cs"
    click AdminCtrl "https://github.com/bania1/eventease/blob/main/eventease-app/eventease-app/Controllers/AdminController.cs"
    click QRCodeCtrl "https://github.com/bania1/eventease/blob/main/eventease-app/eventease-app/Controllers/QRCode.cs"
    click AboutCtrl "https://github.com/bania1/eventease/blob/main/eventease-app/eventease-app/Controllers/AboutController.cs"
    click Views "https://github.com/bania1/eventease/tree/main/eventease-app/eventease-app/Views"

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        subgraph "Services"
            IPassword["IPasswordHasherService"]:::service
            PasswordHasher["PasswordHasherService"]:::service
        end
        QRCoderLib["QRCoder Library"]:::library
    end

    AuthCtrl -->|uses| IPassword
    HomeCtrl -->|uses| PasswordHasher
    EventsCtrl -->|uses| QRCoderLib
    TicketsCtrl -->|uses| QRCoderLib
    IPassword -->|implemented by| PasswordHasher
    AuthCtrl -->|calls| QRCoderLib

    click IPassword "https://github.com/bania1/eventease/blob/main/eventease-app/eventease-app/Services/IPasswordHasherService.cs"
    click PasswordHasher "https://github.com/bania1/eventease/blob/main/eventease-app/eventease-app/Services/PasswordHasherService.cs"
    click QRCoderLib "https://github.com/bania1/eventease/blob/main/eventease-app/eventease-app/QRCoder/QRCode.cs"

    %% Data Access Layer
    subgraph "Data Access Layer"
        DbContext["eventeaseContext (DbContext)"]:::dataaccess
        Migrations["Migrations"]:::dataaccess
    end

    Services -->|injects| DbContext
    Controllers -->|calls| DbContext
    DbContext -->|applies migrations| Migrations

    click DbContext "https://github.com/bania1/eventease/blob/main/eventease-app/eventease-app/Models/eventeaseContext.cs"
    click Migrations "https://github.com/bania1/eventease/tree/main/eventease-app/eventease-app/Migrations"

    %% Persistence
    Database["SQL Database"]:::database
    DbContext -->|SQL queries| Database

    %% Configuration
    Config["Configuration (Program.cs & appsettings)"]:::config
    Config -->|sets up DI & DbContext| Controllers
    Config -->|configures| Services
    Config -->|configures| DbContext

    %% Styles
    classDef client fill:#b3e5fc,stroke:#0288d1,color:#000;
    classDef controller fill:#bbdefb,stroke:#1976d2,color:#000;
    classDef view fill:#c8e6c9,stroke:#388e3c,color:#000;
    classDef service fill:#ffe0b2,stroke:#f57c00,color:#000;
    classDef library fill:#d1c4e9,stroke:#7e57c2,color:#000;
    classDef dataaccess fill:#d7ccc8,stroke:#5d4037,color:#000;
    classDef database fill:#ffcdd2,stroke:#c62828,color:#000;
    classDef config fill:#e0e0e0,stroke:#616161,color:#000;
```
