🌐 English | Português
A web app to manage Counter-Strike matches and communities: register players, run sweepstakes with automatic team balancing, track per-map scores, build rankings, and pull stats — including reading scoreboards straight from a screenshot.
- Players — manage players with name, Steam ID, 1–5★ rating and active status.
- Maps — catalog maps by game type (5v5, 2v2, …) and map type.
- Sweepstakes — create a draw with selected players and maps, balance teams automatically by player strength (star rating + average damage on the chosen maps), and track per-map scores for two teams across two halves, with automatic match status.
- Rankings — yearly ranking (
get_ranking_by_yearRPC), per-map ranking and per-sweepstake ranking, with kills/deaths/damage/headshot stats. - Scoreboard OCR — extract player stats from a leaderboard screenshot via OpenAI Vision.
- Premier rank — fetch CS2 Premier peaks by scraping csstats.gg.
- Player comparison — head-to-head stats between two players, with AI-generated commentary.
- Auth — Supabase email/password sessions stored in a
csm.tokencookie (nookies, 7-day TTL).
| Route | Description |
|---|---|
POST /api/read-scores |
OCR a leaderboard screenshot into player stats (OpenAI Vision) |
POST /api/premier-rank |
Scrape csstats.gg (via scrape.do) for CS2 Premier peaks |
POST /api/comparative-messages |
AI-generated commentary for player comparisons |
GET /api/sweepstakes/[id] |
Fetch a sweepstake with all map scores and results |
- Next.js 16 (App Router) + React 19
- TypeScript
- Chakra UI 3 + Recharts
- Supabase (database + auth)
- TanStack Query & TanStack Table
- React Hook Form + Yup (
yup-locale-pt) - OpenAI (OCR, commentary)
- @julianobazzi/utils & @julianobazzi/nextjs-utils
- Biome (lint/format)
Requires Node ≥ 20.9.
# 1. Clone the repository
git clone git@github.com:JulianoBazzi/CSManager.git
cd CSManager
# 2. Install dependencies
npm install
# 3. Configure the environment
cp .env.example .env.local # then fill in the values below
# 4. Run the dev server
npm run devApp runs at http://localhost:3000.
| Variable | Description |
|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Supabase project URL (client-side) |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
Supabase anonymous key (client-side) |
OPENAI_API_KEY |
OpenAI key for OCR and commentary |
SCRAPE_DO_TOKEN |
scrape.do token for Premier rank scraping |
NODE_ENV |
Application environment (development / production) |
| Script | Description |
|---|---|
npm run dev |
Start the development server |
npm run build |
Production build |
npm run start |
Start the production server |
npm run lint |
Lint with Biome |
npm run lint:fix |
Lint and auto-fix with Biome |
Released under the MIT License. See LICENSE.md.