# galaxyshadow99/pcbuildingbot architecture

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

- Interactive diagram: https://gitdiagram.com/galaxyshadow99/pcbuildingbot
- Repository: https://github.com/galaxyshadow99/pcbuildingbot

## Overview

PcBuildingBOT surveille des annonces Vinted pour des recherches et plafonds de prix définis par l’utilisateur. Le parcours principal passe du dashboard Flask à l’API FastAPI, puis à la boucle de scan : scraping, filtrage heuristique et anti-doublon, analyse IA, stockage et notification Discord. L’interface expose aussi la gestion de la watchlist, des annonces et de l’état du scraper. Les relations de l’API et du scan sont partiellement documentées dans les extraits ; les liens non vérifiables directement sont omis.

Main entry points: [`backend/main.py`](https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/main.py) (API FastAPI), [`backend/scrapers/vinted.py`](https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/scrapers/vinted.py) (Scraper Vinted), [`frontend/frontend.py`](https://github.com/galaxyshadow99/pcbuildingbot/blob/main/frontend/frontend.py) (Dashboard Flask), [`backend/services/ai_analyzer.py`](https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/services/ai_analyzer.py) (Analyse IA)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Interface web"]
  node_dashboard["Dashboard Flask<br/>[frontend.py]"]
  node_views["Vues web"]
end

subgraph group_backend["API et orchestration"]
  node_api["API FastAPI<br/>[main.py]"]
  node_scan["Boucle de scan<br/>[main.py]"]
  node_watchlist["Gestion watchlist<br/>[main.py]"]
  node_health["Santé et cooldown<br/>[main.py]"]
end

subgraph group_scraping["Collecte et filtrage"]
  node_vinted["Scraper Vinted<br/>[vinted.py]"]
  node_listing["Modèle d’annonce<br/>[item.py]"]
  node_heuristics["Filtres heuristiques<br/>[filters.py]"]
end

subgraph group_analysis["Analyse des annonces"]
  node_ai["Analyse IA<br/>[ai_analyzer.py]"]
  node_llm["Serveur LLM"]
end

subgraph group_integrations["Stockage et services"]
  node_database[("Base SQLite<br/>[database.py]")]
  node_notifier["Notifications Discord<br/>[notifier.py]"]
  node_logger["Journalisation<br/>[logger.py]"]
end

node_user(("Utilisateur"))
node_discord["Discord"]

node_user -->|"utilise"| node_dashboard
node_dashboard -->|"appelle API"| node_api
node_dashboard -->|"rend vues"| node_views
node_api -->|"déclenche scan"| node_scan
node_api -->|"gère recherches"| node_watchlist
node_api -->|"expose état"| node_health
node_api -->|"lit et écrit"| node_database
node_scan -->|"scrape annonces"| node_vinted
node_vinted -->|"crée annonces"| node_listing
node_vinted -->|"vérifie pertinence"| node_heuristics
node_listing -.->|"évalue état"| node_heuristics
node_scan -->|"déduplique annonces"| node_database
node_scan -->|"réanalyse annonce"| node_ai
node_ai -->|"demande analyse"| node_llm
node_scan -.->|"envoie alertes"| node_notifier
node_notifier -->|"publie messages"| node_discord
node_api -.->|"purge messages"| node_notifier
node_scan -->|"actualise état"| node_health
node_vinted -->|"journalise activité"| node_logger
node_ai -->|"journalise erreurs"| node_logger

click node_dashboard "https://github.com/galaxyshadow99/pcbuildingbot/blob/main/frontend/frontend.py"
click node_views "https://github.com/galaxyshadow99/pcbuildingbot/tree/main/frontend/templates"
click node_api "https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/main.py"
click node_scan "https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/main.py"
click node_watchlist "https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/main.py"
click node_health "https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/main.py"
click node_vinted "https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/scrapers/vinted.py"
click node_listing "https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/scrapers/item.py"
click node_heuristics "https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/filters.py"
click node_ai "https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/services/ai_analyzer.py"
click node_database "https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/database.py"
click node_notifier "https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/notifier.py"
click node_logger "https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/logger.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_dashboard,node_views toneBlue
class node_api,node_scan,node_watchlist,node_health toneAmber
class node_vinted,node_listing,node_heuristics toneMint
class node_ai,node_llm toneRose
class node_database,node_notifier,node_logger,node_user,node_discord toneIndigo
```

## Components

### Interface web

- [Dashboard Flask](https://github.com/galaxyshadow99/pcbuildingbot/blob/main/frontend/frontend.py): `frontend/frontend.py`
- [Vues web](https://github.com/galaxyshadow99/pcbuildingbot/tree/main/frontend/templates): `frontend/templates`

### API et orchestration

- [API FastAPI](https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/main.py): `backend/main.py`
- [Boucle de scan](https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/main.py): `backend/main.py`
- [Gestion watchlist](https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/main.py): `backend/main.py`
- [Santé et cooldown](https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/main.py): `backend/main.py`

### Collecte et filtrage

- [Scraper Vinted](https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/scrapers/vinted.py): `backend/scrapers/vinted.py`
- [Modèle d’annonce](https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/scrapers/item.py): `backend/scrapers/item.py`
- [Filtres heuristiques](https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/filters.py): `backend/filters.py`

### Analyse des annonces

- [Analyse IA](https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/services/ai_analyzer.py): `backend/services/ai_analyzer.py`
- **Serveur LLM**

### Stockage et services

- [Base SQLite](https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/database.py): `backend/database.py`
- [Notifications Discord](https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/notifier.py): `backend/notifier.py`
- [Journalisation](https://github.com/galaxyshadow99/pcbuildingbot/blob/main/backend/logger.py): `backend/logger.py`

### Other components

- **Utilisateur**
- **Discord**

## Connections

- Utilisateur → Dashboard Flask: utilise (evidence: `README.md`)
- Dashboard Flask → API FastAPI: appelle API (evidence: `frontend/frontend.py`)
- Dashboard Flask → Vues web: rend vues (evidence: `frontend/frontend.py`)
- API FastAPI → Boucle de scan: déclenche scan (evidence: `backend/main.py`)
- API FastAPI → Gestion watchlist: gère recherches (evidence: `backend/main.py`)
- API FastAPI → Santé et cooldown: expose état (evidence: `backend/main.py`)
- API FastAPI → Base SQLite: lit et écrit (evidence: `backend/main.py`)
- Boucle de scan → Scraper Vinted: scrape annonces (evidence: `backend/main.py`)
- Scraper Vinted → Modèle d’annonce: crée annonces (evidence: `backend/scrapers/vinted.py`)
- Scraper Vinted → Filtres heuristiques: vérifie pertinence (evidence: `backend/scrapers/vinted.py`)
- Modèle d’annonce → Filtres heuristiques: évalue état
- Boucle de scan → Base SQLite: déduplique annonces (evidence: `backend/main.py`)
- Boucle de scan → Analyse IA: réanalyse annonce (evidence: `backend/main.py`)
- Analyse IA → Serveur LLM: demande analyse (evidence: `backend/services/ai_analyzer.py`)
- Boucle de scan → Notifications Discord: envoie alertes (evidence: `README.md`)
- Notifications Discord → Discord: publie messages (evidence: `backend/notifier.py`)
- API FastAPI → Notifications Discord: purge messages (evidence: `README.md`)
- Boucle de scan → Santé et cooldown: actualise état (evidence: `backend/main.py`)
- Scraper Vinted → Journalisation: journalise activité (evidence: `backend/scrapers/vinted.py`)
- Analyse IA → Journalisation: journalise erreurs (evidence: `backend/services/ai_analyzer.py`)
