Overview
The API serves as the central backend coordinating:- Server registration and discovery
- Player authentication and authorization
- Real-time server status via WebSockets
- Player statistics and leaderboards
- Mod distribution and updates
- Integration with third-party services (Discord, Patreon, EA)
Tech Stack
Language
Go 1.24+
RPC Framework
gRPC + HTTP/REST
Database
MongoDB
Cache
Redis
Key Dependencies
go.mod
Architecture
The API follows a clean architecture with clear service boundaries:Core Services
Building
Prerequisites
Build Commands
- Linux
- Windows
Docker Build
Dockerfile
Configuration
The API is configured via environment variables:- Required
- Optional
.env
API Endpoints
gRPC Services
REST Endpoints
GET /api/v1/servers
Get list of active servers
GET /api/v1/player/:id
Get player profile and stats
GET /api/v1/leaderboard
Get global leaderboard
POST /api/v1/auth/login
Authenticate user
WebSocket Events
Real-time events pushed to connected clients:Database Schema
MongoDB Collections
servers
servers
players
players
mods
mods
Development
Running Locally
Testing
Performance Tuning
- Redis Caching
- Database Indexes
- Connection Pooling