# pierrebdl/ma_collection_jeux_videos architecture

> Architecture diagram of the GitHub repository pierrebdl/ma_collection_jeux_videos, 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/pierrebdl/ma_collection_jeux_videos
- Repository: https://github.com/pierrebdl/ma_collection_jeux_videos

## Overview

Ma Collection is a React/TypeScript game-collection app backed by a FastAPI API and PostgreSQL. Users browse and filter the catalog, open game details, register or log in, then manage favorites and their status, ratings, and comments; collection statistics summarize that data. The graph preserves the documented theme and navigation features as well. Backend route-to-service links and frontend page composition are supported by the source index; database operations are visible in sampled service code. Some frontend/API request wiring and unsampled feature implementations are represented only where documented.

Main entry points: [`web/src/App.tsx`](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/App.tsx) (Page routes), [`api/database.py`](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/database.py) (DB session), [`web/src/hooks/RequestsDb.tsx`](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/hooks/RequestsDb.tsx) (API requests), [`web/src/pages/LoginPage.tsx`](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/pages/LoginPage.tsx) (Account pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_routerapp["Page routes<br/>[App.tsx]"]
  node_sharedlayout["Shared layout<br/>[CommonPage.tsx]"]
  node_catalog["Catalog search<br/>[SearchBar.tsx]"]
  node_gamepages["Game pages<br/>[DetailsPage.tsx]"]
  node_libraryui["Library view<br/>[Library.tsx]"]
  node_statsui["Collection stats<br/>[StatsPage.tsx]"]
  node_authpages["Account pages<br/>[LoginPage.tsx]"]
  node_requests["API requests<br/>[RequestsDb.tsx]"]
  node_authstate["Auth state<br/>[Auth.tsx]"]
  node_localstorage["Local storage<br/>[LocalStorage.tsx]"]
  node_theme["Theme state<br/>[Theme.tsx]"]
end

subgraph group_api["API workflows"]
  node_gameapi["Game routes<br/>[game_router.py]"]
  node_accountapi["Account routes<br/>[account_router.py]"]
  node_meapi["Collection routes<br/>[me_router.py]"]
end

subgraph group_domain["Domain and persistence"]
  node_gamesvc["Catalog logic<br/>[games_services.py]"]
  node_accountsvc["Account logic"]
  node_collections["Favorites and stats<br/>[me_services.py]"]
  node_tokens["Token security<br/>[token_services.py]"]
  node_catalogdata["Seed catalog<br/>[game_data.py]"]
  node_tables["ORM tables"]
  node_database["DB session<br/>[database.py]"]
end

node_visitor(("Visitor"))
node_browser(("Browser"))
node_postgres[("PostgreSQL")]

node_visitor -->|"uses"| node_browser
node_browser -->|"opens"| node_routerapp
node_routerapp -->|"wraps pages"| node_sharedlayout
node_routerapp -->|"routes to"| node_gamepages
node_routerapp -->|"routes to"| node_libraryui
node_routerapp -->|"routes to"| node_statsui
node_routerapp -->|"routes to"| node_authpages
node_sharedlayout -->|"renders"| node_catalog
node_sharedlayout -->|"uses"| node_theme
node_catalog -->|"uses"| node_theme
node_gamepages -->|"requests data"| node_requests
node_libraryui -->|"requests data"| node_requests
node_statsui -->|"requests data"| node_requests
node_authpages -->|"requests data"| node_requests
node_authpages -->|"sets session"| node_authstate
node_authpages -->|"persists data"| node_localstorage
node_requests -.->|"sends API calls"| node_browser
node_browser -.->|"calls API"| node_gameapi
node_browser -.->|"calls API"| node_accountapi
node_browser -.->|"calls API"| node_meapi
node_gameapi -->|"delegates"| node_gamesvc
node_accountapi -->|"delegates"| node_accountsvc
node_meapi -->|"delegates"| node_collections
node_accountapi -->|"checks tokens"| node_tokens
node_meapi -->|"checks tokens"| node_tokens
node_accountsvc -->|"creates tokens"| node_tokens
node_gameapi -->|"gets session"| node_database
node_meapi -->|"gets session"| node_database
node_accountapi -->|"gets session"| node_database
node_gamesvc -.->|"queries catalog"| node_postgres
node_accountsvc -->|"reads and writes"| node_postgres
node_collections -->|"reads and writes"| node_postgres
node_database -->|"connects"| node_postgres
node_database -->|"imports seed data"| node_catalogdata
node_database -->|"creates tables"| node_tables

click node_routerapp "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/App.tsx"
click node_sharedlayout "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/pages/CommonPage.tsx"
click node_catalog "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/components/SearchBar.tsx"
click node_gamepages "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/pages/DetailsPage.tsx"
click node_libraryui "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/components/Library.tsx"
click node_statsui "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/pages/StatsPage.tsx"
click node_authpages "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/pages/LoginPage.tsx"
click node_requests "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/hooks/RequestsDb.tsx"
click node_authstate "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/hooks/Auth.tsx"
click node_localstorage "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/hooks/LocalStorage.tsx"
click node_theme "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/hooks/Theme.tsx"
click node_gameapi "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/routers/game_router.py"
click node_accountapi "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/routers/account_router.py"
click node_meapi "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/routers/me_router.py"
click node_gamesvc "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/services/games_services.py"
click node_accountsvc "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/services/account_services.py"
click node_collections "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/services/me_services.py"
click node_tokens "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/security/token_services.py"
click node_catalogdata "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/data/game_data.py"
click node_tables "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/schemas/users_favorites_table.py"
click node_database "https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/database.py"

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_routerapp,node_sharedlayout,node_catalog,node_gamepages,node_libraryui,node_statsui,node_authpages,node_requests,node_authstate,node_localstorage,node_theme,node_browser toneBlue
class node_gameapi,node_accountapi,node_meapi,node_postgres toneAmber
class node_gamesvc,node_accountsvc,node_collections,node_tokens,node_catalogdata,node_tables,node_database toneMint
class node_visitor toneIndigo
```

## Components

### Web application

- [Page routes](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Shared layout](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/pages/CommonPage.tsx): `web/src/pages/CommonPage.tsx`
- [Catalog search](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/components/SearchBar.tsx): `web/src/components/SearchBar.tsx`
- [Game pages](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/pages/DetailsPage.tsx): `web/src/pages/DetailsPage.tsx`
- [Library view](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/components/Library.tsx): `web/src/components/Library.tsx`
- [Collection stats](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/pages/StatsPage.tsx): `web/src/pages/StatsPage.tsx`
- [Account pages](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/pages/LoginPage.tsx): `web/src/pages/LoginPage.tsx`
- [API requests](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/hooks/RequestsDb.tsx): `web/src/hooks/RequestsDb.tsx`
- [Auth state](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/hooks/Auth.tsx): `web/src/hooks/Auth.tsx`
- [Local storage](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/hooks/LocalStorage.tsx): `web/src/hooks/LocalStorage.tsx`
- [Theme state](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/web/src/hooks/Theme.tsx): `web/src/hooks/Theme.tsx`

### API workflows

- [Game routes](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/routers/game_router.py): `api/routers/game_router.py`
- [Account routes](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/routers/account_router.py): `api/routers/account_router.py`
- [Collection routes](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/routers/me_router.py): `api/routers/me_router.py`

### Domain and persistence

- [Catalog logic](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/services/games_services.py): `api/services/games_services.py`
- [Account logic](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/services/account_services.py): `api/services/account_services.py`
- [Favorites and stats](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/services/me_services.py): `api/services/me_services.py`
- [Token security](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/security/token_services.py): `api/security/token_services.py`
- [Seed catalog](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/data/game_data.py): `api/data/game_data.py`
- [ORM tables](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/schemas/users_favorites_table.py): `api/schemas/users_favorites_table.py`
- [DB session](https://github.com/pierrebdl/ma_collection_jeux_videos/blob/main/api/database.py): `api/database.py`

### Other components

- **Visitor**
- **Browser**
- **PostgreSQL**

## Connections

- Visitor → Browser: uses (evidence: `README.md`)
- Browser → Page routes: opens (evidence: `README.md`)
- Page routes → Shared layout: wraps pages (evidence: `web/src/App.tsx`)
- Page routes → Game pages: routes to (evidence: `web/src/App.tsx`)
- Page routes → Library view: routes to (evidence: `web/src/App.tsx`)
- Page routes → Collection stats: routes to (evidence: `web/src/App.tsx`)
- Page routes → Account pages: routes to (evidence: `web/src/App.tsx`)
- Shared layout → Catalog search: renders (evidence: `web/src/pages/CommonPage.tsx`)
- Shared layout → Theme state: uses (evidence: `web/src/pages/CommonPage.tsx`)
- Catalog search → Theme state: uses (evidence: `web/src/components/SearchBar.tsx`)
- Game pages → API requests: requests data (evidence: `web/src/pages/DetailsPage.tsx`)
- Library view → API requests: requests data
- Collection stats → API requests: requests data (evidence: `web/src/pages/StatsPage.tsx`)
- Account pages → API requests: requests data (evidence: `web/src/pages/LoginPage.tsx`)
- Account pages → Auth state: sets session (evidence: `web/src/pages/LoginPage.tsx`)
- Account pages → Local storage: persists data (evidence: `web/src/pages/LoginPage.tsx`)
- API requests → Browser: sends API calls
- Browser → Game routes: calls API (evidence: `README.md`)
- Browser → Account routes: calls API (evidence: `README.md`)
- Browser → Collection routes: calls API (evidence: `README.md`)
- Game routes → Catalog logic: delegates (evidence: `api/routers/game_router.py`)
- Account routes → Account logic: delegates (evidence: `api/routers/account_router.py`)
- Collection routes → Favorites and stats: delegates (evidence: `api/routers/me_router.py`)
- Account routes → Token security: checks tokens (evidence: `api/routers/account_router.py`)
- Collection routes → Token security: checks tokens (evidence: `api/routers/me_router.py`)
- Account logic → Token security: creates tokens (evidence: `api/services/account_services.py`)
- Game routes → DB session: gets session (evidence: `api/routers/game_router.py`)
- Collection routes → DB session: gets session (evidence: `api/routers/me_router.py`)
- Account routes → DB session: gets session (evidence: `api/routers/account_router.py`)
- Catalog logic → PostgreSQL: queries catalog
- Account logic → PostgreSQL: reads and writes (evidence: `api/services/account_services.py`)
- Favorites and stats → PostgreSQL: reads and writes (evidence: `api/services/me_services.py`)
- DB session → PostgreSQL: connects (evidence: `api/database.py`)
- DB session → Seed catalog: imports seed data (evidence: `api/database.py`)
- DB session → ORM tables: creates tables (evidence: `api/database.py`)
