Skip to content
Projets

CraazzzyyFoxx/overwatch-tournaments

Voir sur GitHub

À propos

OWT is a multi-tenant platform for running Overwatch tournaments from registration to post-tournament analytics. It combines public tournament history and player statistics with organizer tooling for workspaces, brackets, live drafts, map vetoes, match-log processing, achievements, streams, and access control.

Sciences et ingénierie

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

OWT — Overwatch Tournament Platform

Backend lint Backend tests Gateway CI Frontend CI Coverage License: AGPL v3

OWT is a multi-tenant platform for running Overwatch tournaments from registration to post-tournament analytics. It combines public tournament history and player statistics with organizer tooling for workspaces, brackets, live drafts, map vetoes, match-log processing, achievements, streams, and access control.

What OWT does

For players and spectators

  • Browse tournaments, divisions, teams, matches, maps, heroes, and player performance.
  • Register teams, complete check-in, and follow tournament progress.
  • Watch bracket, standings, map-veto, draft, analytics-job, and stream updates in real time.
  • Link Discord, Twitch, Battle.net, Riot, and Steam identities to one OWT account.
  • Follow live Twitch channels attached to a tournament.

For organizers

  • Run isolated workspaces with custom branding, domains, memberships, API keys, and RBAC.
  • Manage tournament registration, roster shapes, check-in, stages, brackets, standings, and lifecycle transitions.
  • Synchronize tournament data with Challonge and Google Sheets.
  • Build balanced teams with a native Rust multi-objective solver or run an interactive captain draft.
  • Configure map pools and pick/ban veto sessions.
  • Upload and parse Overwatch match logs, calculate statistics, evaluate achievements, and run post-tournament analytics.
  • Gate registration or check-in through Discord/Twitch subscription requirements.
  • Operate a Discord bot for log uploads, commands, and notifications.

Architecture

OWT is a monorepo with one public edge and headless backend workers:

flowchart LR
    Client[Browser / API client] --> Nginx[nginx]
    Nginx -- "/api, WebSocket" --> Gateway[Go gateway\nHTTP + WebSocket]
    Nginx -- "pages" --> Frontend[Next.js frontend]
    Frontend -- "SSR" --> Gateway
    Gateway --> RabbitMQ[(RabbitMQ RPC)]
    RabbitMQ --> Workers[Python FastStream workers]
    Gateway --> PostgreSQL[(PostgreSQL)]
    Gateway --> Redis[(Redis)]
    Workers --> PostgreSQL
    Workers --> Redis
    Workers --> Storage[(S3-compatible storage)]

The Go gateway is the only HTTP/WebSocket backend entry point. It validates JWTs, applies edge policy, maps REST routes to request/reply RPC over RabbitMQ, serves API documentation, caches anonymous reads, and relays Redis-backed realtime events. nginx routes /api/* and the WebSocket endpoints to the gateway and every other path straight to the Next.js frontend. Python services expose no HTTP API; they share SQLAlchemy models and cross-service infrastructure from backend/shared/.

See docs/architecture.md for request flow, messaging guarantees, multitenancy, realtime replay, and deployment topology.

Backend services

Directory Runtime Responsibility
backend/app-service app-svc Game catalog, player identity, workspace administration, notifications, and binary assets
backend/identity-service identity-svc JWT sessions, OAuth, RBAC, memberships, API keys, custom domains, and player linking
backend/tournament-service tournament-svc Tournament lifecycle, registration, brackets, standings, Challonge/Sheets sync, map veto, organizer dashboard, and transactional outbox
backend/stats-service stats-svc, stats-worker Match-log ingestion, parsing, rank synchronization, achievements, backfills, and the public statistics and player-statistics reads
backend/balancer-service balancer-svc Genetic team balancing, native Rust tournament_balancer, and live captain drafts
backend/analytics-service analytics-svc, analytics-worker Analytics RPC plus long-running ML training and inference jobs
backend/stream-service stream-svc Twitch live-status polling and public tournament stream state
backend/discord-service discord-worker Discord bot, match-log upload, notifications, and commands
backend/shared library Shared ORM models, schemas, tenancy, RBAC, messaging, and observability

The edge implementation is documented separately in gateway/README.md. Frontend conventions and scripts live in frontend/README.md.

Technology stack

Layer Technologies
Frontend Next.js 16.4, React 19.3, TypeScript 6.0, Tailwind CSS 4, Radix/Shadcn, TanStack Query/Table, Zustand, Vitest
Gateway Go 1.26, net/http, RabbitMQ, Redis, PostgreSQL/pgx, OpenTelemetry
Backend Python 3.15, FastStream, SQLAlchemy 2, Pydantic 2, Alembic, pytest
Balancing and analytics Rust tournament_balancer, OpenSkill, LightGBM/XGBoost, Bayesian and Monte Carlo workflows
Data and messaging PostgreSQL 16, Valkey 9, RabbitMQ 3.13, S3-compatible object storage
Operations Docker Compose, nginx, Prometheus, Grafana, Loki, Tempo, OpenTelemetry Collector, Sentry

Repository layout

.
├── frontend/                   # Next.js application
├── gateway/                    # Sole HTTP/WebSocket gateway
├── backend/
│   ├── shared/                 # Shared Python package and ORM source of truth
│   ├── *-service/              # Headless FastStream workers
│   ├── migrations/             # Alembic migrations
│   └── env/                    # Per-service environment templates
├── nginx/                      # Internal HTTP edge
├── monitoring/                 # Metrics, logs, traces, dashboards, and alerts
├── loadtests/                  # Locust scenarios
├── ops/backup/                 # Backup tooling
├── docs/                       # Architecture, data model, runbooks, and designs
├── docker-compose.yml          # Development stack
├── docker-compose.production.yml
└── Makefile                    # Common development and operations commands

Quick start with Docker

Prerequisites

  • Git
  • Docker Engine or Docker Desktop with Docker Compose v2
  • make for the convenience commands below; every target is a thin wrapper around docker compose

Host toolchains are optional when using Docker. Direct development requires Python 3.15 with uv, Bun, and Go 1.26.

1. Clone the repository

git clone https://github.com/CraazzzyyFoxx/overwatch-tournaments.git
cd overwatch-tournaments

2. Create development environment files

Copy every maintained template without modifying the templates themselves:

for file in backend/env/*.env.example; do cp "$file" "${file%.example}"; done
cp frontend/.env.example frontend/.env.local

Create the root .env used by Docker Compose. These values are suitable only for local development; use generated secrets in any shared or production environment.

COMPOSE_PROFILES=db
APP_PORT=80
GATEWAY_HOST_PORT=8080

RABBITMQ_DEFAULT_USER=admin
RABBITMQ_DEFAULT_PASS=secure_password

POSTGRES_USER=postgres
POSTGRES_PASSWORD=your_secure_password_here
POSTGRES_DB=aqt_db

The RabbitMQ and PostgreSQL values must match backend/env/common.env. Two more keys must be filled in before the stack boots:

  • JWT_SECRET_KEY in backend/env/auth.env: at least 32 random characters. identity derives its token-signing key from it; the gateway holds only the matching public key. Run make jwt-public-key (it runs in the identity image, building it on first use) and put its output into JWT_PUBLIC_KEY in backend/env/gateway.env. Redo it whenever JWT_SECRET_KEY changes.
  • OAUTH_TOKEN_ENCRYPTION_KEY: identity refuses to start without it while Discord or Twitch OAuth is enabled, which the template's placeholder credentials count as. Generate one with python -c "import base64,secrets;print(base64.urlsafe_b64encode(secrets.token_bytes(32)).decode().rstrip('='))" and put the same value into auth.env, stats.env and tournament.env.

OAuth, Challonge, Twitch, Discord, Battle.net, S3, analytics, and observability credentials are feature-specific; their templates explain when they are required.

3. Start the stack and migrate the database

make dev-up
make migrate

COMPOSE_PROFILES=db enables the local PostgreSQL container. Without it, the Compose file expects the database settings in backend/env/common.env to point at an external PostgreSQL instance.

Open:

Start optional long-running workers for ML jobs and Discord integration:

make dev-up-full

4. Inspect or stop the stack

make dev-health
make dev-logs
make dev-down

Local development without rebuilding containers

Backend

The backend is one uv workspace. Service code is bind-mounted into development containers and FastStream reloads it automatically.

cd backend
uv sync

Apply migrations and run the containerized backend suite from the repository root:

make migrate
make test

Frontend

cd frontend
bun install --frozen-lockfile
bun run dev

The browser uses same-origin /api/... paths. Server-side Next.js requests use NEXT_INTERNAL_API_URL, which defaults to the gateway address configured in frontend/.env.local.

Gateway

cd gateway
go test ./...
go run ./cmd/gateway

Gateway configuration is documented in backend/env/gateway.env.example and gateway/README.md.

Common commands

Command Purpose
make dev-build Build development images
make dev-up Start the core development stack
make dev-up-full Start the core stack plus workers profile
make dev-rebuild Rebuild and restart the core stack
make dev-health Show container state and health
make dev-logs Follow development logs
make migrate Apply Alembic migrations in app-svc
make test Run backend pytest suite in app-svc
make loadtest Run headless Locust load tests
make monitoring-up Start the separate monitoring stack
make backup-run Create and verify a database backup
make prod-up Start production (PROD_SIZE=small|medium|large)

Run make help for the complete command list. Component-specific log and restart targets are defined in the root Makefile.

Quality checks

make test                                          # backend pytest suite
cd backend && uv run bash scripts/lint.sh          # ruff check + format check
cd frontend && bun run typecheck && bun run lint
cd gateway && go test -race ./...

That is the fast local signal, not the full gate. The complete list — including the generated artifacts CI verifies and the frontend's two test runners — is in CONTRIBUTING.md. GitHub Actions runs independent backend lint/test, frontend, gateway, and production deployment workflows from .github/workflows.

Operations

  • Production: docker-compose.production.yml and make prod-*. Production scaling requires pgBouncer; the limits and non-replicable workers are documented in the Makefile. Host sizing (minimum 4 vCPU / 8 GB RAM / 80 GB SSD) and the bundled Postgres + pgBouncer (db profile): docs/production-host.md.
  • Monitoring: monitoring/README.md covers Prometheus, Alertmanager, Grafana, Loki, Tempo, Promtail, exporters, and OpenTelemetry.
  • Backups: docs/backup-rustfs.md covers PostgreSQL dumps to S3, verification, and restore.
  • Load testing: loadtests/README.md documents Locust configuration, seeding, and reports.

Do not reuse development credentials in production. Keep secrets in untracked environment files, restrict the admin API documentation endpoint, and configure allowed WebSocket origins. Security policy and vulnerability reporting: SECURITY.md.

Credits

  • OverFast API for Overwatch data.
  • Special thanks to Demogram, creator of the mix balancer and the inspiration behind OWT's tournament balancer.

License

Copyright © 2024-2026 CraazzzyyFoxx.

Licensed under the GNU Affero General Public License v3.0 with additional attribution terms under AGPL §7. Unmodified self-hosting is allowed. Modified network deployments must keep the work under the same license, publish the corresponding source to network users, and display the attribution required by the Additional Terms. The LICENSE file is authoritative.

Explorer des projets similaires

Chargement…