How zoxexivo/open-football works
Project Type and Purpose
• This is a full-stack simulation application (“Open Football”) that models soccer leagues, clubs, matches, training, transfers, etc., without manual control.
• It comprises:
• A Rust-based simulation engine (“core”)
• A Rust-based HTTP API/backend (“server”)
• A static/JSON data generator (“database” crate)
• An Angular frontend (“ui” folder)
• Optional experimental tooling (“neural” and “dev” crates for graphics and neural network experiments)
High-Level Architecture Components
• Frontend (Angular UI)
• Backend API (Rust server crate)
• Simulation Engine (Rust core crate)
• Data Layer (Rust database crate)
• Experimental Subsystems (Rust neural and dev crates)
• Infrastructure/CI (Dockerfile, Drone CI, run configurations)
Component Responsibilities and Technologies
a. UI (ui/)
• Angular app (TypeScript, HTML, SCSS)
• Modules for pages: countries, leagues, teams, players, matches
• Services to call REST endpoints on the backend
• Hosted on port 4200 in dev; served by backend in production
b. API Server (server/)
• Rust HTTP server (actix-web or similar via Cargo.toml)
• Routes organized by resource: countries, leagues, teams, players, matches, game processing, date
• Uses core crate for simulation logic and database crate for static data loading
• Listens on port 18000
c. Simulation Engine (src/core/)
• Domain model for club, league, match engine, transfers, training, etc.
• Organized by domain subpackages (club, league, match, transfers, utils)
• Exposes public API (lib.rs) used by server and dev tools
d. Data Generator/Loader (src/database/)
• Loads JSON files (clubs.json, continents.json, etc.)
• Provides “loader” modules to populate core domain types
• Optional “generator” modules to create synthetic players/staff
e. Experimental Tools (src/neural/, src/dev/)
• Neural: machine learning models for match decisions (binary model files + Rust wrappers)
f. Infrastructure
• build/Football.Dockerfile for containerization
• .drone.yml for CI pipelines
• .run/*.run.xml for IDE launch configurations
• Scripts for publishing and updating
Relationships and Data Flows
• User → Browser → Angular UI
• UI → HTTP REST endpoints on Server (GET /countries, /leagues, /matches/:id, POST /game/process)
• Server routes → invoke core simulation engine and data layer
• Simulation engine reads static data from database loaders and may consult neural models
• Results → JSON responses → UI renders pages or match play controls
• Docker wraps Server + UI in one container for production
• CI triggers tests/builds of core, database, server, neural, and ui modules
Architectural Patterns and Principles
• Layered architecture: Presentation (UI) → API layer → Domain layer (core) → Data layer (database)
• Modularization via Rust crates for strong boundaries and compile-time safety
• RESTful resource design on the API
• Domain-driven design: rich domain model for clubs, matches, leagues, etc.
• Experimental separation: neural and graphics modules do not pollute core domain