# dmytroflakac/vut-fit-itu-alco-stack-party-manager-project- architecture

> Architecture diagram of the GitHub repository dmytroflakac/vut-fit-itu-alco-stack-party-manager-project-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dmytroflakac/vut-fit-itu-alco-stack-party-manager-project-
- Repository: https://github.com/dmytroflakac/vut-fit-itu-alco-stack-party-manager-project-

## Overview

##### Main Components

Frontend Layer (React Application):
- User Interface Components
- Pages (Login, Register, Home, Profile, Party, etc.)
- Reusable Components (Cards, Buttons, Forms)
- State Management (Context API - useAuth)
- Services Layer (API Integration)
- Models/Types
- Asset Management

Backend Layer (.NET Core):
- API Controllers
- Data Access Layer
- Service Layer
- Repository Layer
- Authentication/Authorization
- Models/DTOs

Database Layer:
- Entity relationships for:
- Users
- Parties
- Alcohols
- Cocktails
- Various joining tables (UserParty, PartyAlcohol, etc.)

**[Frontend Layer (React)]**
- ↕
**[Backend Layer (.NET)]**
- ↕
**[Database Layer]**

##### Detailed Component Breakdown

Frontend (React):
**[Pages] → [Components] → [Services]**
- ↓           ↓            ↓
**[Context] → [Models] → [API Calls]**

Backend (.NET):
**[Controllers] → [Services] → [Repositories]**
- ↓             ↓            ↓
**[DTOs/Models] → [Interfaces] → [Data Context]**

##### Key Interactions to Highlight

- Authentication flow between frontend and backend
- Party management operations
- Alcohol and cocktail rating system
- User profile management
- File handling for user photos

##### Specific Implementation Details

- Token-based authentication (TokenService)
- File handling (FileService)
- Alcohol ranking system (AlcoholRankingService)
- Party management flow
- User management flow

##### Additional Elements

Supporting components:
- Error handling flow
- API endpoints
- Security middleware
- Database relationships
- File storage system

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        UI["User Interface"]
        Pages["Pages"]:::frontend
        Components["Components"]:::frontend
        Services["Services"]:::frontend
        Models["Models"]:::frontend
        AuthContext["Auth Context"]:::frontend
        
        subgraph Pages
            Login["Login Page"]:::frontend
            Register["Register Page"]:::frontend
            Home["Home Page"]:::frontend
            Profile["Profile Page"]:::frontend
            Party["Party Page"]:::frontend
        end
        
        subgraph Components
            Cards["Cards"]:::frontend
            Forms["Forms"]:::frontend
            Buttons["Buttons"]:::frontend
        end
        
        subgraph Services
            AuthService["Auth Service"]:::frontend
            PartyService["Party Service"]:::frontend
            AlcoholService["Alcohol Service"]:::frontend
            CocktailService["Cocktail Service"]:::frontend
        end
        
        subgraph Models
            UserModel["User Model"]:::frontend
            PartyModel["Party Model"]:::frontend
            AlcoholModel["Alcohol Model"]:::frontend
        end
    end
    
    subgraph Backend
        Controllers["Controllers"]:::backend
        BServices["Services"]:::backend
        Repos["Repositories"]:::backend
        BModels["Models"]:::backend
        DTOs["DTOs"]:::backend
        Interfaces["Interfaces"]:::backend
        
        subgraph Controllers
            UserController["User Controller"]:::backend
            PartyController["Party Controller"]:::backend
            AlcoholController["Alcohol Controller"]:::backend
        end
        
        subgraph BServices
            TokenService["Token Service"]:::backend
            FileService["File Service"]:::backend
            AlcoholRankingService["Alcohol Ranking Service"]:::backend
            BCocktailService["Cocktail Service"]:::backend
        end
        
        subgraph Repos
            UserRepo["User Repository"]:::backend
            PartyRepo["Party Repository"]:::backend
            AlcoholRepo["Alcohol Repository"]:::backend
        end
    end
    
    subgraph Database
        DataContext["App Data Context"]:::database
        DB[(Database)]:::database
    end
    
    UI --> Pages
    Pages --> Components
    Pages --> Services
    Services --> AuthContext
    Services --> Models
    
    Services --> Controllers
    Controllers --> BServices
    BServices --> Repos
    Repos --> DataContext
    DataContext --> DB
    
    %% Click events for frontend components
    click Pages "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/tree/main/app/src/Pages/"
    click Login "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/app/src/Pages/LoginPage/LoginPage.tsx"
    click Register "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/app/src/Pages/RegisterPage/RegisterPage.tsx"
    click Home "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/app/src/Pages/HomePage/HomePage.tsx"
    click Profile "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/app/src/Pages/ProfilePage/ProfilePage.tsx"
    click Party "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/app/src/Pages/PartyPage/PartyPage.tsx"
    click Components "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/tree/main/app/src/components/"
    click Cards "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/tree/main/app/src/components/Card/"
    click Forms "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/tree/main/app/src/components/FormInput/"
    click Buttons "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/tree/main/app/src/components/MenuButton/"
    click Services "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/tree/main/app/src/Services/"
    click AuthService "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/app/src/Services/AuthService.tsx"
    click PartyService "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/app/src/Services/PartyService.tsx"
    click AlcoholService "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/app/src/Services/AlcoholService.tsx"
    click CocktailService "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/app/src/Services/CocktailService.tsx"
    click Models "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/tree/main/app/src/Models/"
    click UserModel "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/app/src/Models/User.tsx"
    click PartyModel "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/app/src/Models/Party.tsx"
    click AlcoholModel "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/app/src/Models/Alcohol.tsx"
    click AuthContext "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/app/src/Context/useAuth.tsx"
    
    %% Click events for backend components
    click Controllers "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/tree/main/AlcoStack/Controllers/"
    click UserController "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/AlcoStack/Controllers/UserController.cs"
    click PartyController "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/AlcoStack/Controllers/PartyController.cs"
    click AlcoholController "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/AlcoStack/Controllers/AlcoholController.cs"
    click BServices "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/tree/main/AlcoStack/Service/"
    click TokenService "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/AlcoStack/Service/TokenService.cs"
    click FileService "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/AlcoStack/Service/FileService.cs"
    click AlcoholRankingService "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/AlcoStack/Service/AlcoholRankingService.cs"
    click BCocktailService "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/AlcoStack/Service/CocktailService.cs"
    click Repos "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/tree/main/AlcoStack/Repositories/"
    click UserRepo "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/AlcoStack/Repositories/UserRepository.cs"
    click PartyRepo "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/AlcoStack/Repositories/PartyRepository.cs"
    click AlcoholRepo "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/AlcoStack/Repositories/AlcoholRepository.cs"
    click BModels "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/tree/main/AlcoStack/Models/"
    click DTOs "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/tree/main/AlcoStack/Dtos/"
    click Interfaces "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/tree/main/AlcoStack/Interface/"
    click DataContext "https://github.com/DmytroFlakac/VUT-FIT-ITU-Alco-Stack-Party-manager-project-/blob/main/AlcoStack/Data/AppDataContext.cs"
    
    %% Styling
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef database fill:#f1c40f,stroke:#f39c12,color:black
    
    %% Legend
    subgraph Legend
        Frontend_L["Frontend"]:::frontend
        Backend_L["Backend"]:::backend
        Database_L["Database"]:::database
    end
```
