Skip to content

Instantly share code, notes, and snippets.

@ddrscott
Created October 30, 2025 23:33
Show Gist options
  • Select an option

  • Save ddrscott/c82a1005283927d7e632ca42fde9d124 to your computer and use it in GitHub Desktop.

Select an option

Save ddrscott/c82a1005283927d7e632ca42fde9d124 to your computer and use it in GitHub Desktop.

Open Source E-sports Tournament Management Systems for Database Projects

The research reveals seven standout projects spanning production-ready platforms, specialized engines, and educational implementations. These projects demonstrate excellent database design principles with PostgreSQL and MySQL implementations, well-documented schemas, and active development communities.

Production-ready tournament platforms

Bracket - Modern self-hosted tournament system

Repository: https://github.com/evroon/bracket
Demo: https://www.bracketapp.nl/demo | Documentation: https://docs.bracketapp.nl
Activity: Very active (commits through October 2025) | Stars: 1,400+ | License: AGPL-v3.0

Technology stack: Backend uses Python 3.x with FastAPI (async framework) and Pipenv for dependency management. Frontend built with Next.js and React using the Mantine UI library. Database runs on PostgreSQL with SQLAlchemy ORM providing async support. Alembic handles database migrations. Complete Docker and Docker Compose setup included with Docusaurus for documentation.

Database architecture: SQLAlchemy provides the ORM layer with SQLModel for modern Python type hints and async session management. Alembic manages version-controlled schema migrations. The database implements a hierarchical structure: Clubs contain multiple Tournaments, which contain Stages (tournament phases), which contain Groups (brackets), which contain Matches. Teams link to Players through many-to-many relationships, while Matches connect to Courts for scheduling. Migration scripts live in the Alembic versions directory with upgrade/downgrade functions.

Database design principles: The schema demonstrates excellent normalization with proper foreign key constraints throughout. Relationships cascade logically from clubs down through tournaments to individual matches. Unique constraints prevent duplicate entries. Strategic indexing on foreign keys optimizes join performance. The design supports multi-tenancy through club-based data isolation, with audit trails tracking created/updated timestamps on all entities. Match states implement a state machine pattern (locked, waiting, ready, running, completed, archived).

Tournament features: Supports single elimination, double elimination, round-robin, and Swiss system tournaments. Multi-stage tournament structures allow complex competition designs. Drag-and-drop scheduling lets organizers move matches between courts and time slots. Dynamic Swiss tournament handling includes automatic match scheduling based on current standings. Public dashboards provide customizable tournament pages with live rankings and schedules. The club system enables multi-tenancy with multiple tournaments per organization.

Why excellent for database projects: Bracket showcases modern async Python patterns with production-quality code. The complex hierarchical data model teaches multi-level foreign key relationships and data integrity. Multi-tenant architecture demonstrates isolation patterns. Real-time ranking calculations show view optimization. The active community (1,400+ stars) means excellent support and ongoing improvements. Comprehensive documentation includes database setup guides and schema explanations. Quick Docker setup enables immediate hands-on experimentation with docker compose up -d and development data seeding via ./cli.py create-dev-db.

Etournity - GraphQL-first tournament platform

Repository: https://github.com/etournity/etournity
Activity: Moderately active (updates through February 2024) | Stars: 26 | License: GPL-3.0

Technology stack: Backend runs Node.js with TypeScript and GraphQL API using Nexus. Frontend uses Next.js 15+ with React. The monorepo structure employs Yarn workspaces with separate packages for server and client components.

Database architecture: PostgreSQL database managed through Prisma (next-generation TypeScript ORM). The schema lives in packages/server/prisma/schema.prisma using Prisma Schema Language (PSL), a declarative format that generates TypeScript types automatically. Prisma Migrate handles versioned schema changes. The schema includes comprehensive user management with authentication, tournament structures with multiple stages, team and player management with participant relationships, match tracking, and game platform integrations. GraphQL code generation from the Prisma schema ensures type safety throughout the stack.

Database design principles: Prisma enables fully type-safe database queries with automatic TypeScript generation. The schema-first design approach uses Prisma schema as the single source of truth. Foreign keys maintain referential integrity through Prisma's @relation decorators. Prisma Client provides compile-time query validation. Nexus Prisma automatically generates GraphQL resolvers from database models. Database seeding supports consistent development environments. The architecture demonstrates modern API-first design with GraphQL subscriptions enabling real-time updates.

Tournament features: Complete tournament lifecycle management from creation through completion. Team creation, registration, and roster management with role-based access control (RBAC). Match scheduling and results tracking with validation. Built-in Discord integration for community features. Real-time updates via GraphQL subscriptions keep all clients synchronized. The platform aims to compete with commercial solutions like start.gg.

Why excellent for database projects: Etournity demonstrates cutting-edge type-safe database development with Prisma and TypeScript. The GraphQL API showcases modern API design patterns. Automatic schema-to-code generation illustrates metaprogramming approaches. The monorepo structure teaches professional code organization. Comprehensive validation systems show input sanitization. Clear separation between database models and GraphQL types demonstrates layered architecture. The project includes ESLint, Prettier, and automated testing for code quality.

Contentify - Full-featured esports CMS

Repository: https://github.com/Contentify/Contentify
Activity: Stable (last updated April 2023) | Stars: 218 | License: MIT

Technology stack: PHP 7.0+ backend with Laravel 6 framework. Frontend uses jQuery, Bootstrap, and LESS. Modular CMS architecture with 37+ modules including tournaments, teams, matches, forums, galleries, and streams.

Database architecture: MySQL/MariaDB primary database (also supports PostgreSQL and SQLite). Laravel Eloquent ORM provides Active Record pattern implementation. Laravel Migrations manage schema versioning with PHP-based migration files containing up/down methods. Module-based migrations live in app/Modules/*/Database/Migrations/. Schema follows Laravel conventions with pluralized, lowercase table names using underscores (e.g., "games", "teams"). Built-in automated backup job system protects data.

Database design principles: Eloquent relationships (hasMany, belongsTo, belongsToMany) define associations. Soft deletes preserve data integrity while allowing logical deletion. Model events and observers handle lifecycle hooks. Query scopes enable reusable query logic. Accessors and mutators transform attributes. The caching layer optimizes frequently accessed data. Seeder classes provide sample data for development. Migration version control enables rollback capabilities.

Tournament features: This goes beyond pure tournament management to provide a complete esports website platform. Includes tournament bracket management, team/clan pages with rosters, match scheduling and results, content management for news and articles, forum system, stream integration (Twitch), user management with Steam login, admin panel, six language support, responsive mobile-ready design, and modular architecture for custom extensions.

Why excellent for database projects: Contentify demonstrates battle-tested Laravel database patterns used in production. The comprehensive Wiki on GitHub documents installation, configuration, code conventions, and module development. The modular architecture shows how to organize large database-driven applications. Multiple entity types (users, teams, matches, forums, galleries) demonstrate various relationship patterns. Active Record pattern provides clear examples of ORM usage. The mature codebase (218 stars, 81 forks) has solved real-world scaling challenges. Excellent for students wanting to understand full-stack CMS architecture with traditional MVC patterns.

Specialized tournament engines and libraries

brackets-manager.js - Storage-agnostic tournament engine

Repository: https://github.com/Drarig29/brackets-manager.js
Documentation: https://drarig29.github.io/brackets-docs/
Activity: Mature, stable library | License: MIT

Technology stack: JavaScript/TypeScript for Node.js and browsers. Storage abstraction via CrudInterface allows multiple backends: brackets-json-db (file-based JSON using node-json-db), brackets-memory-db (in-memory for client-side/testing), brackets-sql-db (community SQL implementation), or custom implementations. Companion library brackets-viewer.js handles visualization.

Database architecture: The abstracted data model works with both NoSQL and relational databases. Core tables/collections include tournament (top-level container), stage (tournament phases with different formats), group (subdivisions within stages), round (round within groups), match (individual matchups), match_game (best-of-N sub-matches), and participant (competitors/teams). Foreign keys link entities: tournamentId, stageId, groupId. Position tracking enables bracket visualization. The schema supports single elimination, double elimination with Grand Finals, round-robin, multiple stages, BYE handling, and forfeit processing.

Database design principles: Interface-driven design demonstrates storage abstraction patterns. Well-defined relational structure works despite storage flexibility. State machine pattern manages match states (locked, waiting, ready, running, completed, archived). Seeding algorithms handle tournament initialization. Match result propagation flows through bracket stages. The design accommodates both NoSQL document-style storage and traditional SQL relational models.

Tournament features: Comprehensive bracket management with progression logic built in. BYE support with intelligent seeding and balancing. Forfeit handling with automatic winner determination. Multi-stage tournaments combine different formats. Dynamic pairing for round-robin stages. Grand Finals with bracket reset for double elimination. The manager module separates tournament logic from visualization concerns.

Why excellent for database projects: This project excels at teaching storage abstraction and data access layers. Students learn how to design schemas that work across different database paradigms. The separation of concerns between tournament logic (manager) and presentation (viewer) demonstrates clean architecture. Comprehensive API documentation with examples for all operations. Active community discussions on GitHub about SQL implementations provide learning insights. The project shows how to implement complex algorithms (seeding, pairing, progression) with database queries. Students can implement their own storage backend as a learning exercise.

Swiss Tournament (Udacity project) - Educational implementation

Repository: https://github.com/bencam/tournament-database (and multiple forks)
Educational blog: https://benjaminbrandt.com/relational-databases-final-project/
Context: Created for Udacity Full Stack Nanodegree "Intro to Relational Databases" course

Technology stack: PostgreSQL database with Python 2.7/3.x using psycopg2 driver. Schema defined in tournament.sql file with explicit DDL statements.

Database architecture: The schema demonstrates fundamental database concepts with clarity. Core tables include players (player_id serial primary key, player_name), tournaments (tournament metadata enabling multiple concurrent tournaments), registrations (junction table linking players to tournaments with timestamps), matches (match_id, tournament_id, winner_id, loser_id as foreign keys to registrations, points scored, match outcome, round number), and scoreboard (tournament_id, player_id, wins, losses, matches, points, bye tracking).

Advanced implementations include seven database views that encapsulate Swiss tournament logic: wins_v counts wins per player per tournament, matches_v counts total matches, standings_v implements complex ranking with tie-breakers (win count descending, then Opponent Match Wins for strength of schedule, then total points, then registration time), row_num_v uses window functions for pairing, and evens_v/odds_v/pairings_v generate Swiss pairings by splitting ranked players and matching adjacent pairs.

Database design principles: The project demonstrates proper normalization (3NF) by eliminating redundancy and organizing data into logical entities. Foreign key constraints maintain referential integrity between players, registrations, and matches. Check constraints enforce business rules (valid outcomes, non-negative scores). Views encapsulate complex query logic for reusability. Window functions (ROW_NUMBER()) enable ranking calculations. COALESCE handles NULL values gracefully for bye rounds. Strategic indexing on foreign keys optimizes join performance. The design supports one bye per player maximum by tracking bye status in registrations.

Tournament features: Swiss-system pairing algorithm that matches players with similar records without rematches. Handles even or odd numbers of players with intelligent bye assignment. Supports ties/draws in match results. Multiple simultaneous tournaments in the same database. Automated standings calculation with sophisticated tie-breaking (win count, opponent match wins for strength of schedule, total points scored, registration order). Round-by-round pairing generation based on current standings.

Why excellent for database projects: This is the ideal first database project for learning fundamentals. The schema is simple enough to understand quickly (basic version uses just 2 tables) yet sophisticated enough to teach important concepts. Comprehensive unit tests (tournament_test.py) provided by Udacity give clear success criteria. Benjamin Brandt's detailed walkthrough explains every design decision with excellent pedagogical commentary. Multiple student implementations on GitHub enable comparison of different approaches. The Swiss pairing algorithm demonstrates how database views can implement complex logic. Perfect for teaching: foreign keys and referential integrity, views for query encapsulation, window functions and ranking, transaction handling, index usage, and prepared statements for SQL injection prevention.

Educational database projects

Sports League Management System - Real-world sports database

Repository: https://github.com/kaimg/Sports-League-Management-System
Dataset: Kaggle European Football Leagues Database 2023-2024
Activity: Recently updated (2024) | License: MIT

Technology stack: Frontend uses HTML, CSS (Bootstrap), and JavaScript. Backend built with Flask (Python framework) and SQLAlchemy (Flask-SQLAlchemy integration). PostgreSQL database with psycopg2 adapter. Python-Dotenv manages configuration. Gunicorn production server. Real-time data integration from football-data.org API using Requests library.

Database architecture: The schema includes 13+ interconnected tables representing a complete sports league ecosystem. Explicit ER diagram included in repository shows relationships between: Users (authentication/authorization with privilege levels), Stadiums (venue information), Leagues (competition containers), Seasons (time periods within leagues), Teams (club information), Coaches (team management), Players (roster members), Matches (game records), Scores (match results), Scorers (goal tracking), Standings (calculated league tables), Referees (match officials), and Match_Referees (junction table for many-to-many between matches and referees).

The schema demonstrates hierarchical organization: League → Season → Match, with standings calculated from aggregated match results. Historical data preservation enables time-series analysis. Foreign key constraints maintain referential integrity across all relationships. Unique constraints prevent duplicate match pairings. Check constraints validate scores and dates. Indexes optimize frequent queries for standings and statistics.

Database design principles: Full 3NF normalization minimizes redundancy while maintaining data integrity. Junction tables properly model many-to-many relationships (match officials). Transactional integrity ensures atomic updates when match results change standings. Audit trails track data modifications. Business rules enforced at database level through constraints. Performance-optimized views cache aggregated statistics. The architecture demonstrates ETL pipeline design with weekly automated data imports from external APIs. Clear separation between transactional data (matches) and derived data (standings).

Tournament features: Admin functions include comprehensive user management with role-based privileges, complete CRUD operations for teams and players, match scheduling with venue and time management, and score updates with automatic standings recalculation. Public views provide team profiles with historical performance, player statistics and career information, league standings with live updates, match schedules with filtering (upcoming/past/by team), top scorers by league, and powerful search functionality across players, teams, stadiums, and coaches. Real-time integration pulls production data from football-data.org with minimal manual entry required.

Why excellent for database projects: This project showcases production-scale database architecture with real data from professional sports. The comprehensive ER diagram teaches complex relationship modeling. Real API integration demonstrates ETL pipeline design and data warehousing concepts. Docker setup teaches professional deployment practices. The complexity makes it ideal for senior capstone projects or graduate database courses. Flask-SQLAlchemy shows ORM usage in web applications. The combination of transactional and analytical workloads demonstrates hybrid database design. Weekly automated updates illustrate batch processing and data synchronization. Kaggle dataset provides clean, validated data for testing. Students learn: large-scale schema design, API integration patterns, aggregation and derived data, time-series data management, and full-stack database application development.

Red Gate Tennis Tournament - Design methodology tutorial

Article: https://www.red-gate.com/blog/a-data-model-to-track-tennis-tournaments
Author: Shantanu Kher (Professional database educator)
Context: Educational article teaching database design methodology

Technology stack: Focuses on database design concepts rather than implementation. The model translates to any relational database (PostgreSQL, MySQL, SQL Server). ER diagrams use standard notation. Complete SQL DDL would be straightforward to implement from the documentation.

Database architecture: The article presents a carefully designed schema organized into four subject areas demonstrating modular design principles. Player Details includes player table (id, first_name, last_name, country_code, date_of_birth, ATP/WTA registration numbers) and country table with ISO codes. Tournament Details spans tournament (id, name, location, dates, rounds, tournament_type_id, surface_type_id), tournament_type (Grand Slam, Masters, etc.), surface_type (grass, clay, hard court), playing_category (singles/doubles/mixed doubles), and tournament_playing_category junction table.

The Player Registration area demonstrates sophisticated many-to-many modeling with registration (id, registration_number), registration_player (links registration to players—doubles teams need multiple players per registration), and playing_in (links registrations to tournament categories with seeding information). Fixtures and Results includes fixture (matches with round information), fixture_result (winner and retirement tracking), set_score (games per set), game_score (points per game), and tie_breaker (tie-breaker scores when needed).

Database design principles: The article provides exceptional documentation of design rationale. Each design decision includes explanation of alternatives considered and why they were rejected. For example, the registration pattern elegantly handles singles versus doubles: rather than direct player_id foreign keys in the playing_in table, a registration table enables the same player to participate in multiple categories with different seeds/partners. The article explicitly teaches normalization: First Normal Form (atomic values), Second Normal Form (partial dependency elimination), and Third Normal Form (transitive dependency elimination) using sports examples.

The model demonstrates appropriate granularity levels based on requirements: match-level tracking (who won), set-level granularity (games per set for tennis scoring), and game-level detail (points per game) when needed. The design discussion includes when to stop normalizing based on diminishing returns. Junction tables properly model complex relationships. Subject area decomposition teaches modular schema design.

Tournament features: Complete tennis tournament structure from player registration through match completion. Handles singles, doubles, and mixed doubles with elegant registration pattern. Seeding and ranking per category. Multi-round knockout bracket structure. Detailed tennis scoring (sets, games, points, tie-breakers). Tournament type categorization (Grand Slam, Masters, etc.). Surface type tracking (affects play style). Player career history across tournaments. Retirement tracking during matches.

Why excellent for database projects: This is the best resource for teaching database design methodology and ER modeling. The step-by-step design process demonstrates how to translate business requirements into database structures. Explicit design rationale documents why each decision was made. The article serves as a perfect teaching tool for normalization theory, with clear examples of violations and corrections. Discussion questions at the end encourage critical thinking about extending to other sports.

The tennis domain is universally understood, removing domain complexity so students focus on database concepts. Complete ER diagrams with all relationships clearly marked. The registration pattern teaches an advanced concept (when not to use direct foreign keys) that students often struggle with. Used in academic courses (referenced by Saylor Academy CS403 for teaching 3NF violations). Students can implement the design as a project, comparing their solution to the documented approach. Ideal for intermediate undergraduate database design courses introducing complex many-to-many relationships and junction table patterns.

Comparison matrix for selection

Project Best For Complexity Database Stars Activity Documentation
Bracket Modern production app High PostgreSQL 1,400+ Very Active (2025) Excellent
Etournity GraphQL & TypeScript Medium-High PostgreSQL 26 Moderate (2024) Good
Contentify Full CMS platform High MySQL 218 Stable (2023) Excellent
brackets-manager.js Storage abstraction Medium Flexible N/A Mature Excellent
Swiss Tournament Database fundamentals Medium PostgreSQL N/A Educational Excellent
Sports League Real-world capstone High PostgreSQL N/A Active (2024) Good
Red Gate Tennis Design methodology Medium Any SQL N/A Tutorial Excellent

Technology stack summary

Backend Languages: Python (Bracket, Swiss Tournament, Sports League), TypeScript/Node.js (Etournity, brackets-manager.js), PHP (Contentify)

Frameworks: FastAPI (Bracket), GraphQL/Nexus (Etournity), Laravel (Contentify), Flask (Sports League)

Databases: PostgreSQL dominates (Bracket, Etournity, Swiss Tournament, Sports League, brackets-manager optional), MySQL (Contentify, with PostgreSQL support)

ORMs: SQLAlchemy (Bracket, Sports League), Prisma (Etournity), Eloquent (Contentify), psycopg2 raw SQL (Swiss Tournament)

Migration Tools: Alembic (Bracket), Prisma Migrate (Etournity), Laravel Migrations (Contentify)

Recommended learning path

Beginners (first database project): Start with Swiss Tournament from Udacity. Simple schema teaches fundamentals. Comprehensive test suite provides clear goals. Benjamin Brandt's walkthrough explains every concept. Multiple GitHub implementations enable comparison.

Intermediate (database design focus): Study Red Gate Tennis Tournament article to learn ER modeling and normalization theory. Then implement the design as a practical exercise. The documented design rationale teaches professional thinking.

Advanced (modern web applications): Explore Bracket for production Python/FastAPI patterns, or Etournity for GraphQL/Prisma/TypeScript stack. Both demonstrate contemporary full-stack architecture with excellent database practices.

Capstone projects (complete systems): Build with Sports League Management (real production data, API integration) or Contentify (mature platform, extensive features). Both showcase enterprise-scale database architecture.

Storage layer specialists: Deep dive into brackets-manager.js to understand storage abstraction and data access layer design. Implement custom storage backend as learning exercise.

Key database concepts demonstrated

All these projects collectively teach: Normalization (1NF through 3NF with clear examples), Foreign keys (referential integrity across relationships), Junction tables (proper many-to-many modeling), Views (query encapsulation and optimization), Indexes (performance optimization strategies), Constraints (CHECK, UNIQUE, NOT NULL for data integrity), Transactions (atomic operations and consistency), Migrations (version-controlled schema evolution), ORMs (object-relational mapping patterns), State machines (tournament/match state management), Hierarchical data (tournament → stage → group → match structures), Temporal data (time-series tracking and historical queries), Aggregations (derived data like standings from base match data), Multi-tenancy (data isolation patterns), and ETL pipelines (external data integration).

These seven projects provide comprehensive coverage of database systems topics suitable for undergraduate through graduate level coursework. Each offers accessible code on GitHub, well-documented schemas, and clear examples of professional database design principles in real tournament management contexts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment