# LoL Stats — MVP type OP.GG / U.GG Site de statistiques League of Legends. ## Fonctionnalités **Page d'accueil** - Barre de recherche avec autocomplétion (depuis les recherches récentes globales) - Favoris (stockés localement dans le navigateur) - Recherches récentes affichées en cloud **Page de profil** - Riot ID, niveau, icône, bouton favori - Rang Solo/Duo + Flex (avec indicateur de série) - Stats agrégées sur 20 derniers matchs : winrate, KDA moyen, CS/min, vision - Top 5 champions joués avec winrate par champion - Maîtrise des champions (top 5 avec niveau + points) - Historique de matchs avec pagination "Charger plus" - Détail par match : sorts d'invocateur, items, build, durée, ancienneté **Tier list** - Tous les champions classés par tier S/A/B/C/D selon leur winrate - Filtre par rôle (Top / Jungle / Mid / ADC / Support) - Données via meraki-analytics, mises à jour quotidiennement ## Stack - **Backend** : Node.js 20 + Fastify + TypeScript - **Frontend** : Next.js 14 (App Router, Server Components) + TailwindCSS - **Cache** : Redis 7 (TTL différencié + tracking des recherches) - **Reverse proxy** : Nginx (rate limiting + compression) - **Assets** : Data Dragon (officiel) + Community Dragon (runes) - **Stats tier list** : meraki-analytics ## Prérequis - Docker + Docker Compose - Une clé API Riot (https://developer.riotgames.com) ## Démarrage ```bash cp .env.example .env # Éditez .env et collez votre clé Riot ./start.sh ``` Le site est disponible sur **http://localhost**. ## Endpoints API ``` GET /api/profile/:platform/:gameName/:tagLine → profil complet (account, summoner, ranked, masteries, stats, 20 matchs) GET /api/profile/:platform/:gameName/:tagLine/matches?start=N&count=N&queue=N → pagination des matchs GET /api/tier-list?role=TOP|JUNGLE|MIDDLE|BOTTOM|SUPPORT → tier list (filtre rôle optionnel) GET /api/search/recent → 10 dernières recherches globales GET /api/search/suggest?q=fa → autocomplétion ``` ## Commandes utiles ```bash docker compose logs -f backend # Logs du backend docker compose logs -f frontend # Logs du frontend docker compose restart backend # Redémarrer un service docker compose down # Tout arrêter docker compose down -v # Tout arrêter + purger Redis docker compose up -d --build # Reconstruire après modification ``` ## Architecture ``` Internet → Nginx (80) ──┬─→ /api/* → Backend Fastify (3001) ─┬─→ Redis │ ├─→ Riot API │ ├─→ Data Dragon │ └─→ meraki-analytics └─→ /* → Frontend Next.js (3000) ─→ Backend ``` ## Stratégie de cache (TTL Redis) | Donnée | TTL | Raison | |---|---|---| | Account / Summoner | 6-24h | Quasi-immuable | | Champion masteries | 1h | Mise à jour à chaque partie | | Ranked entries | 5 min | Change à chaque partie classée | | Liste de match IDs | 2 min | Nouveau match potentiel | | Détail d'un match | 30 jours | Donnée immuable | | Version DDragon | 1h | Un nouveau patch peut sortir | | Champions DDragon | 6h | Stable sur un patch | | Tier list meraki | 6h | Mise à jour quotidienne | ## Régions supportées `euw1`, `eun1`, `na1`, `kr`, `jp1`, `br1`, `la1`, `la2`, `oc1`, `tr1`, `ru`, `ph2`, `sg2`, `th2`, `tw2`, `vn2` # lol-stats
LoL Stats
A self-hosted League of Legends statistics tracker inspired by OP.GG / U.GG. Look up any player, dig into their ranked history and match performance, and track LP progression over time — fully containerized and running on your own infrastructure.
Features
Profiles & ranked
- Search any player by Riot ID (
Name#Tag) across regions - Profile overview: level, icon, Solo/Duo & Flex rank with emblem and estimated top %
- Champion mastery
Match analysis
- Paginated match history with queue filters
- Full 10-player scoreboard for every game
- Custom Impact Score (0–100) per game and on average
- Loss diagnostic comparing a game against your recent averages
- Item tooltips (stats, passives/actives, cost) that follow the live patch via Data Dragon
Progression
- Ranked LP history graph (Solo/Duo & Flex), accumulated by a background worker
- Per-game ±LP, correlated from LP snapshots
- Current-season Win/Loss
- Automatic playstyle archetype detection
- Performance trend charts (Impact / Win rate / KDA)
- Achievements/badges and a customizable LP goal tracker
- Shareable, downloadable profile card (PNG export)
More
- 1v1 comparator with 10 / 20 / 50 / 100-game windows
- Adaptive light/dark theme
- Champion splash-art banner
Tech stack
- Frontend: Next.js 14 (App Router), TypeScript, Tailwind CSS
- Backend: Node.js, Fastify, TypeScript
- Data: PostgreSQL (matches & LP snapshots), Redis (caching)
- Infra: Docker Compose, Nginx reverse proxy
- Data sources: Riot Games API, Data Dragon, Community Dragon
Getting started
cp .env.example .env # add your RIOT_API_KEY ./start.sh # docker compose up --build
The app is then available behind Nginx on port 80.
Notes
- LP history is built up over time: Riot's API only exposes the current rank, so a background worker periodically snapshots tracked players' LP and correlates it with their ranked games. Older history can't be back-filled.
- A Riot development key expires every 24h and is rate-limited; a production key is required for heavier usage.
Disclaimer
This project isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games and all associated properties are trademarks or registered trademarks of Riot Games, Inc.
0 commit comments