A real-time scoreboard and match tracker for Dota Underlords using the Game State Integration (GSI) API.
Real-time match tracking with live player stats, WebSocket updates, and comprehensive game state monitoring
- Real-time match tracking with WebSocket updates
- Live scoreboard with player stats, units, and synergies
- Match history management
- Modern React + TypeScript frontend
- Flask backend with SQLite database
- Python 3.x
- Flask + Flask-SocketIO
- SQLite database
- React 19
- TypeScript
- Redux Toolkit (state management)
- React Router (navigation)
- Socket.IO Client (WebSocket)
- Vite (build tool)
pip install -r requirements.txtcd frontend
npm installRun both servers in separate terminals:
Terminal 1 - Flask Backend:
python app.pyThis starts the Flask server on http://localhost:3000
Terminal 2 - React Frontend:
cd frontend
npm run devThis starts the Vite dev server on http://localhost:5173
Open http://localhost:5173 in your browser for the React app with Hot Module Replacement (HMR).
Build the React app and serve it from Flask:
# Build the React app
cd frontend
npm run build
cd ..
# Run Flask with production flag
PRODUCTION=true python app.pyOpen http://localhost:3000 in your browser.
underlords_gsi_unified/
├── app.py                      # Flask backend server
├── database.py                 # Database management
├── requirements.txt            # Python dependencies
├── frontend/                   # React frontend
│   ├── src/
│   │   ├── components/         # React components
│   │   │   ├── Scoreboard/     # Scoreboard components
│   │   │   └── MatchManagement/# Match management components
│   │   ├── pages/              # Page components
│   │   │   ├── Scoreboard.tsx  # Main scoreboard page
│   │   │   └── Matches.tsx     # Match management page
│   │   ├── store/              # Redux store
│   │   │   ├── store.ts        # Store configuration
│   │   │   ├── matchSlice.ts   # Match state
│   │   │   ├── connectionSlice.ts # WebSocket connection
│   │   │   └── matchesSlice.ts # Matches list
│   │   ├── services/           # API & WebSocket services
│   │   │   ├── api.ts          # REST API client
│   │   │   └── websocket.ts    # WebSocket client
│   │   ├── hooks/              # Custom hooks
│   │   │   └── redux.ts        # Typed Redux hooks
│   │   ├── types/              # TypeScript types
│   │   │   └── index.ts        # Type definitions
│   │   ├── styles/             # CSS files
│   │   ├── App.tsx             # Main App component
│   │   └── main.tsx            # Entry point
│   ├── public/                 # Static assets
│   │   ├── icons/              # Hero & UI icons
│   │   └── underlords_heroes.json
│   ├── package.json
│   ├── vite.config.ts          # Vite configuration
│   └── tsconfig.json           # TypeScript configuration
├── static/                     # Legacy static files (deprecated)
├── templates/                  # Legacy templates (deprecated)
└── underlords_gsi_v2.db       # SQLite database
- POST /upload- GSI data endpoint (receives game data)
- GET /api/status- System status
- GET /api/health- Health check
- GET /api/matches- List all matches
- DELETE /api/matches/:id- Delete a match
- POST /api/abandon_match- Abandon current match
- test_connection- Test WebSocket connection
- connection_response- Connection confirmation
- match_update- Real-time match data updates
- match_abandoned- Match abandonment notification
- test_response- Test response
In development mode, Flask is configured to allow CORS from http://localhost:5173 (Vite dev server).
The Vite dev server proxies API requests and WebSocket connections to Flask on port 3000.
In development mode, the React app supports HMR for instant feedback on code changes.
cd frontend
npm run buildThis creates an optimized production build in frontend/dist/ that Flask can serve.
- DEBUG- Enable Flask debug mode (default:- true)
- PRODUCTION- Enable production mode to serve React build (default:- false)
- SECRET_KEY- Flask secret key
- LOG_LEVEL- Logging level
MIT
