# aldiix/educhem-lan-party-web architecture

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

- Interactive diagram: https://gitdiagram.com/aldiix/educhem-lan-party-web
- Repository: https://github.com/aldiix/educhem-lan-party-web

## Overview

##### Project type and purpose
- This is a full-stack web application (“EDUCHEM LAN Party App”) for managing LAN party events: team registration, tournament planning, real-time chat, seat reservations, user administration.
- Frontend: React+Vite+TypeScript+SASS.
- Backend: C#/.NET 7 Web API with Controllers, Middleware, Services, WebSocket endpoints.
- Persistence: MySQL.

##### File structure
- Top level: Dockerfile, .run scripts, nginx.conf, shell scripts, solution file, dbschema.sql.
- EduchemLP.Server: .NET Web API project with Program.cs → Middleware → Controllers → Services → Classes → Models → Views for email templates → WebSocketServices.
- educhemlp.client: Vite+React app: public assets + src (components, pages, store, utils).

##### Insights from README
- Describes features (reservations, chat, tournaments).
- Lists tech stack (C#/.NET, React, MySQL).
- Deployment via Docker or local scripts.

##### Elements
- Clear labels: “React SPA”, “Nginx Reverse Proxy”, “.NET API”, “WebSocket Chat”, “MySQL DB”, “OAuth Providers”, “SMTP Service”.
- Blue rectangles for Node/React components
- Green for .NET services

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Presentation Layer
    subgraph "Presentation Layer"
        ReactSPA["React SPA"]:::frontend
    end

    %% Application Layer
    subgraph "Application Layer"
        Nginx["Nginx Reverse Proxy"]:::proxy
        subgraph ".NET API"
            Program["Program & DI Setup"]:::backend
            APIV1["API Versioning & Routing"]:::backend
            subgraph "HTTP Controllers"
                OAuthGroup["OAuth Controllers"]:::backend
                AuthDiscord["DiscordOAuthController"]:::backend
                AuthGitHub["GitHubOAuthController"]:::backend
                AuthGoogle["GoogleOAuthController"]:::backend
                AuthInstagram["InstagramOAuthController"]:::backend
            end
            Middlewares["Middleware Pipeline"]:::backend
            subgraph "Services"
                EmailSvc["EmailService"]:::backend
                RazorSvc["RazorEngineService"]:::backend
                HttpCtxSvc["HttpContextService"]:::backend
                OtherServices["Other Services"]:::backend
            end
            DataAccess["Data Access & Config (Database.cs, AppSettings.cs)"]:::backend
            Models["Domain Models"]:::backend
            subgraph "WebSocket Services"
                WSChat["WSChat"]:::backend
                WSRes["WSReservations"]:::backend
            end
            subgraph "Email Views"
                UserRegView["UserRegistered.cshtml"]:::backend
                UserResetView["UserResetPassword.cshtml"]:::backend
            end
        end
    end

    %% Data & External Layer
    subgraph "Data & External"
        MySQL["MySQL Database"]:::db
        OAuth["OAuth Providers"]:::external
        SMTP["SMTP Email Service"]:::external
    end

    %% Deployment
    subgraph "Deployment"
        Dockerfile["Dockerfile"]:::deploy
        DockRun["dockerrun.sh"]:::deploy
        RunXml[".run/Run dockerfile.run.xml"]:::deploy
        StartSh["start.sh"]:::deploy
        UpdateSh["update.sh"]:::deploy
    end

    %% Connections
    ReactSPA -->|HTTPS| Nginx
    Nginx -->|HTTPS API| Program
    Program --> APIV1
    APIV1 -->|invokes| AuthDiscord
    APIV1 -->|invokes| AuthGitHub
    APIV1 -->|invokes| AuthGoogle
    APIV1 -->|invokes| AuthInstagram
    APIV1 -->|routes| Middlewares
    Middlewares -->|calls| OtherServices
    OtherServices --> DataAccess
    DataAccess --> MySQL
    AuthDiscord -->|OAuth Flow| OAuth
    AuthGitHub -->|OAuth Flow| OAuth
    AuthGoogle -->|OAuth Flow| OAuth
    AuthInstagram -->|OAuth Flow| OAuth
    ReactSPA -->|WSS| WSChat
    ReactSPA -->|WSS| WSRes
    WSChat --> DataAccess
    WSRes --> DataAccess
    OtherServices -->|send email| SMTP
    UserRegView --> EmailSvc
    UserResetView --> RazorSvc

    Dockerfile --> Nginx
    Dockerfile --> Program
    DockRun --> Dockerfile
    RunXml --> Dockerfile
    StartSh --> Dockerfile
    UpdateSh --> Dockerfile

    %% Click Events
    click ReactSPA "https://github.com/aldiix/educhem-lan-party-web/tree/main/educhemlp.client/"
    click Nginx "https://github.com/aldiix/educhem-lan-party-web/blob/main/nginx.conf"
    click Dockerfile "https://github.com/aldiix/educhem-lan-party-web/tree/main/Dockerfile"
    click DockRun "https://github.com/aldiix/educhem-lan-party-web/blob/main/dockerrun.sh"
    click RunXml "https://github.com/aldiix/educhem-lan-party-web/blob/main/.run/Run dockerfile.run.xml"
    click StartSh "https://github.com/aldiix/educhem-lan-party-web/blob/main/start.sh"
    click UpdateSh "https://github.com/aldiix/educhem-lan-party-web/blob/main/update.sh"
    click Program "https://github.com/aldiix/educhem-lan-party-web/blob/main/EduchemLP.Server/Program.cs"
    click APIV1 "https://github.com/aldiix/educhem-lan-party-web/blob/main/EduchemLP.Server/API/APIv1.cs"
    click AuthDiscord "https://github.com/aldiix/educhem-lan-party-web/blob/main/EduchemLP.Server/Controllers/DiscordOAuthController.cs"
    click AuthGitHub "https://github.com/aldiix/educhem-lan-party-web/blob/main/EduchemLP.Server/Controllers/GitHubOAuthController.cs"
    click AuthGoogle "https://github.com/aldiix/educhem-lan-party-web/blob/main/EduchemLP.Server/Controllers/GoogleOAuthController.cs"
    click AuthInstagram "https://github.com/aldiix/educhem-lan-party-web/blob/main/EduchemLP.Server/Controllers/InstagramOAuthController.cs"
    click Middlewares "https://github.com/aldiix/educhem-lan-party-web/tree/main/EduchemLP.Server/Middlewares/"
    click EmailSvc "https://github.com/aldiix/educhem-lan-party-web/blob/main/EduchemLP.Server/Services/EmailService.cs"
    click RazorSvc "https://github.com/aldiix/educhem-lan-party-web/blob/main/EduchemLP.Server/Services/RazorEngineService.cs"
    click HttpCtxSvc "https://github.com/aldiix/educhem-lan-party-web/blob/main/EduchemLP.Server/Services/HttpContextService.cs"
    click DataAccess "https://github.com/aldiix/educhem-lan-party-web/tree/main/EduchemLP.Server/Classes/"
    click Models "https://github.com/aldiix/educhem-lan-party-web/tree/main/EduchemLP.Server/Models/"
    click WSChat "https://github.com/aldiix/educhem-lan-party-web/blob/main/EduchemLP.Server/WebSocketServices/WSChat.cs"
    click WSRes "https://github.com/aldiix/educhem-lan-party-web/blob/main/EduchemLP.Server/WebSocketServices/WSReservations.cs"
    click UserRegView "https://github.com/aldiix/educhem-lan-party-web/blob/main/EduchemLP.Server/Views/Emails/UserRegistered.cshtml"
    click UserResetView "https://github.com/aldiix/educhem-lan-party-web/blob/main/EduchemLP.Server/Views/Emails/UserResetPassword.cshtml"

    %% Styles
    classDef frontend fill:#D6EFFF,stroke:#3182CE
    classDef proxy fill:#E2E8F0,stroke:#4A5568
    classDef backend fill:#C6F6D5,stroke:#38A169
    classDef db fill:#FEEBC8,stroke:#DD6B20
    classDef external fill:#F0FFF4,stroke:#48BB78
    classDef deploy fill:#EDF2F7,stroke:#A0AEC0
```
