A full-stack web app that recreates OP.GG's summoner stats interface for League of Legends, powered by Riot's official APIs.
- Live Summoner Search: Find any player across all regions with real-time name and tag validation
- Region Selection: Choose from 16 regions worldwide (NA, EUW, EUNE, Korea, Brazil, etc.)
- Ranked Stats: View Solo Queue and Flex Rank with LP, win/loss records, and tier
- Champion Mastery: Top 5 most-played champions with mastery level and progression
- Match History: Last 10 matches with KDA, CS/min, kill participation, game duration
- Responsive Design: Mobile-friendly layout with gradient atmosphere and modern UI
- Node.js 18+
- A Riot API Key (get it free at https://developer.riotgames.com/)
-
Clone/open this repository in VS Code
-
Install dependencies:
npm install
-
Create a
.envfile in the root directory:RIOT_API_KEY=your_riot_api_key_here PORT=3001Replace
your_riot_api_key_herewith your actual Riot API key.
Start both the React frontend and Express backend together:
npm run devThis runs:
- Frontend on http://localhost:5173 (Vite)
- Backend on http://localhost:3001 (Express proxy)
The app will automatically proxy all API calls through the backend for security (your API key is never exposed to the browser).
npm run buildThis generates optimized bundles in the dist/ folder.
┌─────────────────────────────────────────┐
│ Browser (React Frontend) │
│ - Search form, summoner cards, UI │
└──────────┬──────────────────────────────┘
│ http://localhost:3001/api
▼
┌─────────────────────────────────────────┐
│ Express Backend (Riot Proxy) │
│ - Validates requests │
│ - Manages API key securely │
│ - Fetches data from Riot │
└──────────┬──────────────────────────────┘
│ https://api.riotgames.com
▼
┌─────────────────────────────────────────┐
│ Riot Official APIs │
│ - Account v1, Summoner v4 │
│ - League v4 (ranked entries) │
│ - Champion Mastery v4 │
│ - Match v5 (last 10 games) │
└─────────────────────────────────────────┘
Returns a list of all supported regions:
[
{ "value": "na1", "label": "North America" },
{ "value": "euw1", "label": "EU West" },
...
]Fetches complete summoner profile with ranked, mastery, and match data:
GET /api/riot/summoner?region=na1&gameName=Faker&tagLine=NAC
Returns profile object with ranked stats, champion mastery, and match history.
- Frontend: React 19 + TypeScript + Vite
- Backend: Express.js + Node.js
- Styling: Custom CSS with design system (gradients, animations)
- API: Riot Games Official APIs (Account, Summoner, League, Champion Mastery, Match)
opggcopy/
├── src/
│ ├── App.tsx # Main React component with search and UI
│ ├── index.css # Custom design system and responsive styles
│ └── main.tsx # React entry point
├── server/
│ └── index.js # Express API proxy and Riot integration
├── package.json # Dependencies and scripts
├── .env # Environment variables (add your API key here)
└── README.md # This file
- Get your API key at https://developer.riotgames.com/
- Add it to
.envasRIOT_API_KEY=your_key_here - Run
npm run dev - Search for any summoner by name and tag across any region
"RIOT_API_KEY is missing": Ensure your .env file exists in the project root with your API key.
"Player not found": Verify the summoner name and tag are correct and the region is valid.
"Port 3001 already in use": Change the PORT in .env to another value (e.g., 3002).
For full Riot API documentation, visit Riot Developer Portal.
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])