# nolhan-b/ft_transcendence architecture

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

- Interactive diagram: https://gitdiagram.com/nolhan-b/ft_transcendence
- Repository: https://github.com/nolhan-b/ft_transcendence

## Overview

This repository is presented as a development plan for a web-based UNO game, not as a verified implementation: the backend and frontend have no sampled source files. The documented user journey is account access, real-time multiplayer play, and game outcomes, with social and progression features around it. The graph therefore reflects planned capabilities and documented connections; directory paths identify only the directories present in the tree, and the shared type files were excerpted but contained no visible definitions.

Main entry points: [`frontend`](https://github.com/nolhan-b/ft_transcendence/tree/main/frontend) (Web frontend), [`backend`](https://github.com/nolhan-b/ft_transcendence/tree/main/backend) (Multiplayer sessions), [`shared/src/types/game.ts`](https://github.com/nolhan-b/ft_transcendence/blob/main/shared/src/types/game.ts) (Game contracts), [`shared/src/types/user.ts`](https://github.com/nolhan-b/ft_transcendence/blob/main/shared/src/types/user.ts) (User contracts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_webapp["Web frontend"]
end

subgraph group_gameplay["UNO gameplay"]
  node_rooms["Game rooms"]
  node_uno["UNO rules and turns"]
  node_multiplayer["Multiplayer sessions"]
  node_remote["Reconnect handling"]
  node_bot["AI opponent"]
  node_custom["Custom cards"]
  node_tournament["Tournaments"]
  node_spectator["Spectator mode"]
end

subgraph group_community["Social features"]
  node_profiles["User profiles"]
  node_friends["Friend system"]
  node_chat["Real-time chat"]
  node_progression["XP and leaderboard"]
end

subgraph group_platform["Accounts and platform"]
  node_auth["Signup and login"]
  node_socket["WebSocket service"]
  node_sharedgame["Game contracts<br/>[game.ts]"]
  node_shareduser["User contracts<br/>[user.ts]"]
  node_sharedevents["WebSocket events"]
  node_database[("PostgreSQL database")]
  node_oauth["OAuth providers"]
end

node_player(("Player"))

node_player -->|"uses"| node_webapp
node_webapp -->|"submits credentials"| node_auth
node_webapp -->|"enters rooms"| node_rooms
node_rooms -->|"stores game state"| node_database
node_auth -->|"stores users"| node_database
node_webapp -->|"connects via"| node_socket
node_socket -->|"broadcasts updates"| node_multiplayer
node_multiplayer -->|"runs rules"| node_uno
node_uno -.->|"uses contracts"| node_sharedgame
node_socket -.->|"uses events"| node_sharedevents
node_auth -.->|"uses contracts"| node_shareduser
node_multiplayer -.->|"supports reconnection"| node_remote
node_multiplayer -.->|"can add opponent"| node_bot
node_uno -.->|"can add customization"| node_custom
node_webapp -->|"views profiles"| node_profiles
node_webapp -->|"uses"| node_friends
node_webapp -->|"uses"| node_chat
node_chat -.->|"uses transport"| node_socket
node_multiplayer -.->|"enables tournaments"| node_tournament
node_multiplayer -.->|"enables spectators"| node_spectator
node_multiplayer -.->|"feeds progression"| node_progression
node_webapp -.->|"offers sign-in"| node_oauth

click node_webapp "https://github.com/nolhan-b/ft_transcendence/tree/main/frontend"
click node_auth "https://github.com/nolhan-b/ft_transcendence/tree/main/backend"
click node_profiles "https://github.com/nolhan-b/ft_transcendence/tree/main/backend"
click node_friends "https://github.com/nolhan-b/ft_transcendence/tree/main/backend"
click node_chat "https://github.com/nolhan-b/ft_transcendence/tree/main/backend"
click node_socket "https://github.com/nolhan-b/ft_transcendence/tree/main/backend"
click node_rooms "https://github.com/nolhan-b/ft_transcendence/tree/main/backend"
click node_uno "https://github.com/nolhan-b/ft_transcendence/tree/main/backend"
click node_multiplayer "https://github.com/nolhan-b/ft_transcendence/tree/main/backend"
click node_remote "https://github.com/nolhan-b/ft_transcendence/tree/main/backend"
click node_bot "https://github.com/nolhan-b/ft_transcendence/tree/main/backend"
click node_custom "https://github.com/nolhan-b/ft_transcendence/tree/main/backend"
click node_tournament "https://github.com/nolhan-b/ft_transcendence/tree/main/backend"
click node_spectator "https://github.com/nolhan-b/ft_transcendence/tree/main/backend"
click node_progression "https://github.com/nolhan-b/ft_transcendence/tree/main/backend"
click node_sharedgame "https://github.com/nolhan-b/ft_transcendence/blob/main/shared/src/types/game.ts"
click node_shareduser "https://github.com/nolhan-b/ft_transcendence/blob/main/shared/src/types/user.ts"
click node_sharedevents "https://github.com/nolhan-b/ft_transcendence/blob/main/shared/src/types/websocket-events.ts"
click node_oauth "https://github.com/nolhan-b/ft_transcendence/tree/main/backend"

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_webapp toneBlue
class node_rooms,node_uno,node_multiplayer,node_remote,node_bot,node_custom,node_tournament,node_spectator toneAmber
class node_profiles,node_friends,node_chat,node_progression toneMint
class node_auth,node_socket,node_sharedgame,node_shareduser,node_sharedevents,node_database,node_oauth toneRose
class node_player toneIndigo
```

## Components

### Web experience

- [Web frontend](https://github.com/nolhan-b/ft_transcendence/tree/main/frontend): `frontend`

### UNO gameplay

- [Game rooms](https://github.com/nolhan-b/ft_transcendence/tree/main/backend): `backend`
- [UNO rules and turns](https://github.com/nolhan-b/ft_transcendence/tree/main/backend): `backend`
- [Multiplayer sessions](https://github.com/nolhan-b/ft_transcendence/tree/main/backend): `backend`
- [Reconnect handling](https://github.com/nolhan-b/ft_transcendence/tree/main/backend): `backend`
- [AI opponent](https://github.com/nolhan-b/ft_transcendence/tree/main/backend): `backend`
- [Custom cards](https://github.com/nolhan-b/ft_transcendence/tree/main/backend): `backend`
- [Tournaments](https://github.com/nolhan-b/ft_transcendence/tree/main/backend): `backend`
- [Spectator mode](https://github.com/nolhan-b/ft_transcendence/tree/main/backend): `backend`

### Social features

- [User profiles](https://github.com/nolhan-b/ft_transcendence/tree/main/backend): `backend`
- [Friend system](https://github.com/nolhan-b/ft_transcendence/tree/main/backend): `backend`
- [Real-time chat](https://github.com/nolhan-b/ft_transcendence/tree/main/backend): `backend`
- [XP and leaderboard](https://github.com/nolhan-b/ft_transcendence/tree/main/backend): `backend`

### Accounts and platform

- [Signup and login](https://github.com/nolhan-b/ft_transcendence/tree/main/backend): `backend`
- [WebSocket service](https://github.com/nolhan-b/ft_transcendence/tree/main/backend): `backend`
- [Game contracts](https://github.com/nolhan-b/ft_transcendence/blob/main/shared/src/types/game.ts): `shared/src/types/game.ts`
- [User contracts](https://github.com/nolhan-b/ft_transcendence/blob/main/shared/src/types/user.ts): `shared/src/types/user.ts`
- [WebSocket events](https://github.com/nolhan-b/ft_transcendence/blob/main/shared/src/types/websocket-events.ts): `shared/src/types/websocket-events.ts`
- **PostgreSQL database**
- [OAuth providers](https://github.com/nolhan-b/ft_transcendence/tree/main/backend): `backend`

### Other components

- **Player**

## Connections

- Player → Web frontend: uses (evidence: `README.md`)
- Web frontend → Signup and login: submits credentials (evidence: `README.md`)
- Web frontend → Game rooms: enters rooms (evidence: `README.md`)
- Game rooms → PostgreSQL database: stores game state (evidence: `README.md`)
- Signup and login → PostgreSQL database: stores users (evidence: `README.md`)
- Web frontend → WebSocket service: connects via (evidence: `README.md`)
- WebSocket service → Multiplayer sessions: broadcasts updates (evidence: `README.md`)
- Multiplayer sessions → UNO rules and turns: runs rules (evidence: `README.md`)
- UNO rules and turns → Game contracts: uses contracts
- WebSocket service → WebSocket events: uses events
- Signup and login → User contracts: uses contracts
- Multiplayer sessions → Reconnect handling: supports reconnection (evidence: `README.md`)
- Multiplayer sessions → AI opponent: can add opponent (evidence: `README.md`)
- UNO rules and turns → Custom cards: can add customization (evidence: `README.md`)
- Web frontend → User profiles: views profiles (evidence: `README.md`)
- Web frontend → Friend system: uses (evidence: `README.md`)
- Web frontend → Real-time chat: uses (evidence: `README.md`)
- Real-time chat → WebSocket service: uses transport (evidence: `README.md`)
- Multiplayer sessions → Tournaments: enables tournaments (evidence: `README.md`)
- Multiplayer sessions → Spectator mode: enables spectators (evidence: `README.md`)
- Multiplayer sessions → XP and leaderboard: feeds progression (evidence: `README.md`)
- Web frontend → OAuth providers: offers sign-in (evidence: `README.md`)
