# heosejin98/xmash architecture

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

- Interactive diagram: https://gitdiagram.com/heosejin98/xmash
- Repository: https://github.com/heosejin98/xmash

## Overview

##### High-Level Architecture Components

The system should be represented as a two-tier architecture with these main components:

A. Frontend (FE)
- React-based application (indicated by .tsx files)
- Feature-based architecture following Feature-Sliced Design
- UI components library
- API integration layer

B. Backend (BE)
- Spring Boot application (Java-based)
- Database layer
- Authentication system
- Game/Match management
- Ranking system

##### Detailed Component Breakdown

Frontend Layer:
- Core Layers
- Pages (Routing)
- Widgets (Complex UI Compositions)
- Features (Business Logic)
- Entities (Domain Models)
- Shared (Common Utils/UI)

- Technical Layers
- API Integration
- State Management
- UI Components

Backend Layer:
- Application Layers
- Controllers (Web Layer)
- Services (Business Logic)
- Repositories (Data Access)
- Entities (Domain Models)

- Technical Layers
- Configuration
- Security
- Exception Handling

##### Key Interactions to Highlight

A. Authentication Flow:
- Login/Logout process
- Password reset functionality
- Session management

B. Game Management:
- Single/Double match handling
- Normal/Ranked game differentiation
- Score tracking and evaluation

C. Ranking System:
- Individual rankings
- Team rankings
- Rating calculations

##### Specific Implementation Details

Frontend:
- React Query integration for data fetching
- Feature-based folder structure
- Shared UI components library
- Routing structure

Backend:
- Spring Boot components
- Database entity relationships
- Service layer organization
- Authentication middleware

##### Bottom: Server-side components and Database

- Component types
- Interaction types
- Data flow directions
- Security boundaries

- Clear separation of frontend and backend concerns
- The game management system's architecture
- The ranking system's integration
- Authentication and authorization flow
- Data flow between components

Remember to maintain a balance between detail and clarity, focusing on the core gaming and ranking features while showing the supporting infrastructure.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        FE_Pages["Pages (Routing)"]:::frontend
        FE_Widgets["Widgets"]:::frontend
        FE_Features["Features"]:::frontend
        FE_Entities["Entities"]:::frontend
        FE_Shared["Shared/UI"]:::frontend
        FE_API["API Integration"]:::frontend
        
        FE_Auth["Authentication UI"]:::frontend
        FE_Ranking["Ranking UI"]:::frontend
        
        FE_Pages --> FE_Widgets
        FE_Widgets --> FE_Features
        FE_Features --> FE_Entities
        FE_Features --> FE_Shared
        FE_Features --> FE_API
        
        FE_Auth --> FE_API
        FE_Ranking --> FE_API
    end

    subgraph Backend
        BE_Controllers["Controllers"]:::backend
        BE_Services["Services"]:::backend
        BE_Repos["Repositories"]:::backend
        BE_Entities["Entities"]:::backend
        BE_Config["Configuration"]:::backend
        
        BE_Auth["Authentication Service"]:::backend
        BE_Game["Game Management"]:::backend
        BE_Ranking["Ranking Service"]:::backend
        
        BE_Controllers --> BE_Services
        BE_Services --> BE_Repos
        BE_Repos --> BE_Entities
        BE_Config --> BE_Services
        
        BE_Auth --> BE_Services
        BE_Game --> BE_Services
        BE_Ranking --> BE_Services
    end

    subgraph Database
        DB[(Database)]:::database
    end

    FE_API --> BE_Controllers
    BE_Repos --> DB

    subgraph CI/CD
        CICD["GitHub Workflows"]:::cicd
    end

    %% Click events for component mapping
    click FE_Pages "https://github.com/Heosejin98/Xmash/tree/main/fe/src/pages"
    click FE_Widgets "https://github.com/Heosejin98/Xmash/tree/main/fe/src/widgets"
    click FE_Features "https://github.com/Heosejin98/Xmash/tree/main/fe/src/features"
    click FE_Entities "https://github.com/Heosejin98/Xmash/tree/main/fe/src/entities"
    click FE_Shared "https://github.com/Heosejin98/Xmash/tree/main/fe/src/shared"
    click FE_API "https://github.com/Heosejin98/Xmash/tree/main/fe/src/shared/api"
    click BE_Controllers "https://github.com/Heosejin98/Xmash/tree/main/be/xmash/src/main/java/com/tmp/xmash/web"
    click BE_Services "https://github.com/Heosejin98/Xmash/tree/main/be/xmash/src/main/java/com/tmp/xmash/service"
    click BE_Repos "https://github.com/Heosejin98/Xmash/tree/main/be/xmash/src/main/java/com/tmp/xmash/db/repositroy"
    click BE_Entities "https://github.com/Heosejin98/Xmash/tree/main/be/xmash/src/main/java/com/tmp/xmash/db/entity"
    click BE_Config "https://github.com/Heosejin98/Xmash/tree/main/be/xmash/src/main/java/com/tmp/xmash/config"
    click BE_Game "https://github.com/Heosejin98/Xmash/tree/main/be/xmash/src/main/java/com/tmp/xmash/service/game"
    click BE_Auth "https://github.com/Heosejin98/Xmash/blob/main/be/xmash/src/main/java/com/tmp/xmash/service/AuthenticationService.java"
    click FE_Auth "https://github.com/Heosejin98/Xmash/tree/main/fe/src/features/login"
    click BE_Ranking "https://github.com/Heosejin98/Xmash/blob/main/be/xmash/src/main/java/com/tmp/xmash/service/RankingService.java"
    click FE_Ranking "https://github.com/Heosejin98/Xmash/tree/main/fe/src/entities/ranking"
    click CICD "https://github.com/Heosejin98/Xmash/tree/main/.github/workflows"

    %% Styling
    classDef frontend fill:#2196F3,stroke:#1565C0,color:white
    classDef backend fill:#4CAF50,stroke:#2E7D32,color:white
    classDef database fill:#FFC107,stroke:#FFA000,color:black
    classDef cicd fill:#9C27B0,stroke:#7B1FA2,color:white

    %% Legend
    subgraph Legend
        L_FE["Frontend"]:::frontend
        L_BE["Backend"]:::backend
        L_DB[(Database)]:::database
        L_CICD["CI/CD"]:::cicd
    end
```
