# enigmaf17/proyecto-interfaces architecture

> Architecture diagram of the GitHub repository enigmaf17/proyecto-interfaces, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/enigmaf17/proyecto-interfaces
- Repository: https://github.com/enigmaf17/proyecto-interfaces

## Overview

UNO is a Windows Forms game for three players, with C# game rules and a Python FastAPI service that persists matches and moves in MySQL. The main workflow is user actions in the game UI, rule execution through the controller and game model, then API logging and persistence. The README documents additional history/statistics and match-finalization capabilities. API internals were not excerpted, so endpoint-to-database behavior is shown only at the documented service boundary.

Main entry points: [`UnoUI/Form1.cs`](https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoUI/Form1.cs) (Game table), [`UnoLogica/Partida.cs`](https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoLogica/Partida.cs) (Match rules), [`UnoLogica/ControladorPartida.cs`](https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoLogica/ControladorPartida.cs) (Game controller), [`UnoLogica/ApiCliente.cs`](https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoLogica/ApiCliente.cs) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Game interface"]
  node_game_ui["Game table<br/>[Form1.cs]"]
  node_loading["Loading screen<br/>[FormCarga.cs]"]
  node_color_picker["Color picker<br/>[FormElegirColor.cs]"]
  node_history["History view<br/>[FormHistorial.cs]"]
  node_ui_entry["UI entry point<br/>[Program.cs]"]
end

subgraph group_logic["Game rules"]
  node_controller["Game controller"]
  node_match["Match rules<br/>[Partida.cs]"]
  node_deck["Deck<br/>[Mazo.cs]"]
  node_card["Card model<br/>[Carta.cs]"]
  node_player_model["Player model<br/>[Jugador.cs]"]
end

subgraph group_service["Persistence service"]
  node_api_client["API client<br/>[ApiCliente.cs]"]
  node_api["FastAPI service<br/>[main.py]"]
end

subgraph group_data["Database"]
  node_schema["Database schema<br/>[schema.sql]"]
  node_mysql[("MySQL")]
end

node_player(("Player"))

node_player -->|"plays through"| node_game_ui
node_ui_entry -->|"opens"| node_game_ui
node_game_ui -->|"dispatches actions"| node_controller
node_game_ui -->|"opens for wilds"| node_color_picker
node_game_ui -->|"opens history"| node_history
node_game_ui -.->|"shows loading"| node_loading
node_controller -->|"applies rules"| node_match
node_controller -->|"records match and moves"| node_api_client
node_match -->|"draws and reshuffles"| node_deck
node_match -->|"updates hands and turns"| node_player_model
node_match -->|"checks played cards"| node_card
node_deck -->|"creates and deals"| node_card
node_player_model -->|"holds cards"| node_card
node_api_client -->|"calls HTTP endpoints"| node_api
node_history -->|"loads player statistics"| node_api_client
node_api -->|"reads and writes"| node_mysql
node_schema -->|"defines tables"| node_mysql

click node_game_ui "https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoUI/Form1.cs"
click node_loading "https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoUI/FormCarga.cs"
click node_color_picker "https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoUI/FormElegirColor.cs"
click node_history "https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoUI/FormHistorial.cs"
click node_ui_entry "https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoUI/Program.cs"
click node_controller "https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoLogica/ControladorPartida.cs"
click node_match "https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoLogica/Partida.cs"
click node_deck "https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoLogica/Mazo.cs"
click node_card "https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoLogica/Carta.cs"
click node_player_model "https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoLogica/Jugador.cs"
click node_api_client "https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoLogica/ApiCliente.cs"
click node_api "https://github.com/enigmaf17/proyecto-interfaces/blob/master/api/main.py"
click node_schema "https://github.com/enigmaf17/proyecto-interfaces/blob/master/database/schema.sql"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_game_ui,node_loading,node_color_picker,node_history,node_ui_entry toneBlue
class node_controller,node_match,node_deck,node_card,node_player_model toneAmber
class node_api_client,node_api toneMint
class node_schema,node_mysql toneRose
class node_player toneIndigo
```

## Components

### Game interface

- [Game table](https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoUI/Form1.cs): `UnoUI/Form1.cs`
- [Loading screen](https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoUI/FormCarga.cs): `UnoUI/FormCarga.cs`
- [Color picker](https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoUI/FormElegirColor.cs): `UnoUI/FormElegirColor.cs`
- [History view](https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoUI/FormHistorial.cs): `UnoUI/FormHistorial.cs`
- [UI entry point](https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoUI/Program.cs): `UnoUI/Program.cs`

### Game rules

- [Game controller](https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoLogica/ControladorPartida.cs): `UnoLogica/ControladorPartida.cs`
- [Match rules](https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoLogica/Partida.cs): `UnoLogica/Partida.cs`
- [Deck](https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoLogica/Mazo.cs): `UnoLogica/Mazo.cs`
- [Card model](https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoLogica/Carta.cs): `UnoLogica/Carta.cs`
- [Player model](https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoLogica/Jugador.cs): `UnoLogica/Jugador.cs`

### Persistence service

- [API client](https://github.com/enigmaf17/proyecto-interfaces/blob/master/UnoLogica/ApiCliente.cs): `UnoLogica/ApiCliente.cs`
- [FastAPI service](https://github.com/enigmaf17/proyecto-interfaces/blob/master/api/main.py): `api/main.py`

### Database

- [Database schema](https://github.com/enigmaf17/proyecto-interfaces/blob/master/database/schema.sql): `database/schema.sql`
- **MySQL**

### Other components

- **Player**

## Connections

- Player → Game table: plays through (evidence: `README.md`)
- UI entry point → Game table: opens (evidence: `UnoUI/Program.cs`)
- Game table → Game controller: dispatches actions (evidence: `README.md`)
- Game table → Color picker: opens for wilds (evidence: `UnoUI/Form1.cs`)
- Game table → History view: opens history (evidence: `UnoUI/Form1.cs`)
- Game table → Loading screen: shows loading (evidence: `UnoUI/Form1.cs`)
- Game controller → Match rules: applies rules (evidence: `UnoLogica/ControladorPartida.cs`)
- Game controller → API client: records match and moves (evidence: `UnoLogica/ControladorPartida.cs`)
- Match rules → Deck: draws and reshuffles (evidence: `UnoLogica/Partida.cs`)
- Match rules → Player model: updates hands and turns (evidence: `UnoLogica/Partida.cs`)
- Match rules → Card model: checks played cards (evidence: `UnoLogica/Partida.cs`)
- Deck → Card model: creates and deals (evidence: `UnoLogica/Mazo.cs`)
- Player model → Card model: holds cards (evidence: `UnoLogica/Jugador.cs`)
- API client → FastAPI service: calls HTTP endpoints (evidence: `UnoLogica/ApiCliente.cs`)
- History view → API client: loads player statistics (evidence: `UnoUI/FormHistorial.cs`)
- FastAPI service → MySQL: reads and writes (evidence: `README.md`)
- Database schema → MySQL: defines tables (evidence: `README.md`)
