# yvtg/nt106_project architecture

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

- Interactive diagram: https://gitdiagram.com/yvtg/nt106_project
- Repository: https://github.com/yvtg/nt106_project

## Overview

##### Project Type & Purpose
- This is a networked, multi-component application developed for a network programming course. The project is a game titled “Sketch&Guess” where players likely interact via drawing and guessing (similar in spirit to Pictionary), with a client-server architecture.
- The existence of multiple projects (LoadBalancer, Server, RoomServer, Program, Models) indicates that the game is distributed into various responsibilities across the system.

##### Analyzing the File Structure & Key Components
- Client Component (Program):
- Contains many Windows Forms (e.g., Form_Login, Form_Register, Form_Home, Form_Room, etc.) used for user interaction.
- Responsible for tasks such as user sign-in, room management, game messaging, creating game files, etc.
- Server Component (Server):
- Includes files like Form_Server and DataAccess (DatabaseHelper.cs), which suggest handling of user management, passwords, and probably communication with a database.
- Likely responsible for central server logic and authentication.
- Room Server Component (RoomServer):
- Its structure (with RoomServer.cs and related forms) indicates that it handles game room specific logic, likely routing messages among players in a game session.
- Load Balancer (LoadBalancer):
- Files like LoadBalancer.cs and configuration indicate that this component manages incoming client requests, distributing them among available servers (e.g., the RoomServer and Server components) to balance the load.
- Models:
- Contains domain entities and shared classes (e.g., User, Room, Packet, various data/text files) which represent the core data models shared by client and server components.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Nodes
    A["Client Application (Program)"]:::client
    B["Load Balancer"]:::balancer
    C["Main Server"]:::server
    D["Room Server"]:::server
    E["Database"]:::database
    F["Models Library"]:::models

    %% Relationships
    A -->|"sends_requests"| B
    B -->|"routes_to"| C
    B -->|"routes_to"| D
    C -->|"persists_data"| E
    C -->|"uses_contracts"| F
    D -->|"uses_contracts"| F
    E ---|"shared_schema"| F

    %% Click Events
    click A "https://github.com/yvtg/nt106_project/tree/master/Program"
    click B "https://github.com/yvtg/nt106_project/tree/master/LoadBalancer"
    click C "https://github.com/yvtg/nt106_project/tree/master/Server"
    click D "https://github.com/yvtg/nt106_project/tree/master/RoomServer"
    click F "https://github.com/yvtg/nt106_project/tree/master/Models"

    %% Styles
    classDef client fill:#C4FFC4,stroke:#1D8348,stroke-width:2px;
    classDef balancer fill:#FFFACD,stroke:#B7950B,stroke-width:2px;
    classDef server fill:#AED6F1,stroke:#2874A6,stroke-width:2px;
    classDef models fill:#D5D8DC,stroke:#566573,stroke-width:2px;
    classDef database fill:#FDEBD0,stroke:#D35400,stroke-width:2px;
```
