# lieslot/matching-match-v2 architecture

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

- Interactive diagram: https://gitdiagram.com/lieslot/matching-match-v2
- Repository: https://github.com/lieslot/matching-match-v2

## Overview

##### Main Components

a. Core Modules:
- Authentication System
- Match Management
- Team Management
- Chat System
- Notification System
- Admin Management
- User Management

b. External Services:
- AWS S3 (indicated by AwsS3Adapter)
- Database (JPA repositories suggest a relational database)

**┌─ Client Layer ─────────────────────────────────────┐**
- (External Client Applications)                      │
- ┬───────────────────────────────┘

**┌─ API Layer ─────────┴───────────────────────────────┐**
- Auth Controller                                  │
- Match Controller                                 │
- Team Controller                                  │
- Chat Controller                                  │
- Admin Controller                                 │
- ┬───────────────────────────────┘

**┌─ Service Layer ─────┴───────────────────────────────┐**
- Auth Service                                     │
- Match Service                                    │
- Team Service                                     │
- Chat Service                                     │
- Admin Service                                    │
- ┬───────────────────────────────┘

**┌─ Domain Layer ──────┴───────────────────────────────┐**
- Match Domain                                     │
- Team Domain                                      │
- User Domain                                      │
- Chat Domain                                      │
- ┬───────────────────────────────┘

**┌─ Infrastructure ────┴───────────────────────────────┐**
- Database                                         │
- AWS S3                                          │
- Security Config                                 │
- ┘

##### Important Relationships

a. Authentication Flow:
- JWT Token Generation
- Refresh Token Handling
- Security Filter Chain

b. Match Making Flow:
- Match Creation
- Team Matching
- Match Confirmation
- Rating System

c. Chat System:
- Room Creation
- Message Handling
- File Upload Flow

##### Implementation Details

Use these symbols:
- Rectangles: Components/Services
- Diamonds: Decision Points

##### Additional Elements

Specific features:
- Manner Rating System
- Bookmark Management
- Chat Room Participant Management
- File Storage Strategy (Local/AWS)

##### The team matching logic flow

Remember to:
- Keep the main flows visible and clear
- Security boundaries
- Async operations
- External service dependencies
- Error handling paths

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        C[Client Applications]
    end

    subgraph API
        AC["Auth Controller"]:::controller
        MC["Match Controller"]:::controller
        TC["Team Controller"]:::controller
        CC["Chat Controller"]:::controller
        ADC["Admin Controller"]:::controller
    end

    subgraph Services
        AS["Auth Service"]:::service
        MS["Match Service"]:::service
        TS["Team Service"]:::service
        CS["Chat Service"]:::service
        ADS["Admin Service"]:::service
        NS["Notification Service"]:::service
    end

    subgraph Domain
        MD["Match Domain"]:::domain
        TD["Team Domain"]:::domain
        UD["User Domain"]:::domain
        CD["Chat Domain"]:::domain
        ND["Notification Domain"]:::domain
    end

    subgraph Infrastructure
        JWT["JWT Provider"]:::security
        SC["Security Config"]:::security
        DB[(Database)]:::database
        S3["AWS S3"]:::external
        LS["Local Storage"]:::storage
        EL["Event Listeners"]:::event
    end

    %% Client to API
    C --> AC
    C --> MC
    C --> TC
    C --> CC
    C --> ADC

    %% API to Services
    AC --> AS
    MC --> MS
    TC --> TS
    CC --> CS
    ADC --> ADS

    %% Services to Domain
    MS --> MD
    TS --> TD
    CS --> CD
    AS --> UD
    NS --> ND

    %% Infrastructure Connections
    AS --> JWT
    AS --> SC
    CS --> S3
    CS --> LS
    MS --> EL
    TS --> EL

    %% Event System
    EL --> NS
    NS -.-> C

    %% Database Connections
    MD --> DB
    TD --> DB
    UD --> DB
    CD --> DB
    ND --> DB

    %% Click Events
    click AC "https://github.com/Lieslot/Matching-Match-v2/tree/main/src/main/java/com/matchingMatch/auth/controller/"
    click AS "https://github.com/Lieslot/Matching-Match-v2/tree/main/src/main/java/com/matchingMatch/auth/"
    click JWT "https://github.com/Lieslot/Matching-Match-v2/blob/main/src/main/java/com/matchingMatch/auth/JwtProvider.java"
    click SC "https://github.com/Lieslot/Matching-Match-v2/blob/main/src/main/java/com/matchingMatch/auth/config/SecurityConfig.java"
    click MC "https://github.com/Lieslot/Matching-Match-v2/tree/main/src/main/java/com/matchingMatch/match/controller/"
    click MS "https://github.com/Lieslot/Matching-Match-v2/tree/main/src/main/java/com/matchingMatch/match/service/"
    click MD "https://github.com/Lieslot/Matching-Match-v2/tree/main/src/main/java/com/matchingMatch/match/domain/"
    click TC "https://github.com/Lieslot/Matching-Match-v2/blob/main/src/main/java/com/matchingMatch/team/controller/TeamController.java"
    click TS "https://github.com/Lieslot/Matching-Match-v2/blob/main/src/main/java/com/matchingMatch/team/service/TeamService.java"
    click TD "https://github.com/Lieslot/Matching-Match-v2/tree/main/src/main/java/com/matchingMatch/team/domain/"
    click CC "https://github.com/Lieslot/Matching-Match-v2/tree/main/src/main/java/com/matchingMatch/chat/controller/"
    click CS "https://github.com/Lieslot/Matching-Match-v2/tree/main/src/main/java/com/matchingMatch/chat/service/"
    click CD "https://github.com/Lieslot/Matching-Match-v2/tree/main/src/main/java/com/matchingMatch/chat/entity/"
    click ND "https://github.com/Lieslot/Matching-Match-v2/tree/main/src/main/java/com/matchingMatch/notification/domain/"
    click ADC "https://github.com/Lieslot/Matching-Match-v2/blob/main/src/main/java/com/matchingMatch/admin/controller/AdminController.java"
    click ADS "https://github.com/Lieslot/Matching-Match-v2/blob/main/src/main/java/com/matchingMatch/admin/service/AdminService.java"
    click UD "https://github.com/Lieslot/Matching-Match-v2/tree/main/src/main/java/com/matchingMatch/user/domain/"
    click S3 "https://github.com/Lieslot/Matching-Match-v2/blob/main/src/main/java/com/matchingMatch/chat/file/AwsS3Adapter.java"
    click LS "https://github.com/Lieslot/Matching-Match-v2/blob/main/src/main/java/com/matchingMatch/chat/file/LocalAdapter.java"
    click EL "https://github.com/Lieslot/Matching-Match-v2/tree/main/src/main/java/com/matchingMatch/listener/"

    %% Styling
    classDef controller fill:#2196F3,stroke:#1565C0,color:white
    classDef service fill:#4CAF50,stroke:#2E7D32,color:white
    classDef domain fill:#FFC107,stroke:#FFA000,color:black
    classDef database fill:#607D8B,stroke:#455A64,color:white
    classDef security fill:#F44336,stroke:#C62828,color:white
    classDef external fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef event fill:#FF9800,stroke:#F57C00,color:white
    classDef storage fill:#795548,stroke:#4E342E,color:white
```
