# soundtrackgeek/footballmanager architecture

> Architecture diagram of the GitHub repository soundtrackgeek/footballmanager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/soundtrackgeek/footballmanager
- Repository: https://github.com/soundtrackgeek/footballmanager

## Overview

##### Main Components Identification

a) Core Game Engine Layer:
- `main.py` at the top as the entry point
- Core simulation modules:
- `game_simulation.py`
- `football_manager.py`
- `stats.py`
- `table.py`

b) Team Management Layer:
- Team-related modules:
- `team_management.py`
- `tactics.py`
- `transfer_market.py`
- `player.py`

c) Data Storage Layer:
- Teams folder (JSON files)
- Configuration files (txt and csv)
- `fixture_list.json`

##### Component Relationships

a) Data Flow:
- Teams JSON files → team_management.py
- playernames.csv → player.py
- fixture_list.json → fixtures.py

b) Module Dependencies:
- main.py → football_manager.py (primary game loop)
- football_manager.py → game_simulation.py
- game_simulation.py → team_management.py, tactics.py
- team_management.py → player.py, transfer_market.py

##### Specific Implementation Details

**[Game Control]**
- main.py
- football_manager.py

**[Game Logic]**
- game_simulation.py
- fixtures.py
- stats.py
- table.py

**[Team Systems]**
- team_management.py
- tactics.py
- transfer_market.py
- player.py

**[Data Layer]**
- Teams/*.json
- fixture_list.json
- playernames.csv
- sponsors.txt
- banks.txt
- commentatorgoals.txt

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef core fill:#ff9933,stroke:#333,stroke-width:2px
    classDef module fill:#3498db,stroke:#333,stroke-width:2px
    classDef data fill:#2ecc71,stroke:#333,stroke-width:2px
    classDef storage fill:#95a5a6,stroke:#333,stroke-width:2px

    %% Game Control Layer
    subgraph GameControl
        Main["Main Entry Point"]:::core
        FM["Football Manager"]:::core
    end

    %% Game Logic Layer
    subgraph GameLogic
        GS["Game Simulation"]:::module
        FIX["Fixtures"]:::module
        STATS["Statistics"]:::module
        TABLE["League Table"]:::module
    end

    %% Team Systems Layer
    subgraph TeamSystems
        TM["Team Management"]:::module
        TAC["Tactics"]:::module
        TM_MARKET["Transfer Market"]:::module
        PLAYER["Player Management"]:::module
    end

    %% Data Storage Layer
    subgraph DataStorage
        TEAMS[("Teams JSON")]:::storage
        FIXTURES[("Fixture List")]:::storage
        PLAYERS[("Player Names")]:::storage
        CONFIG_BANKS[("Banks")]:::storage
        CONFIG_SPONSORS[("Sponsors")]:::storage
        CONFIG_COMMENTS[("Commentator Goals")]:::storage
    end

    %% Relationships
    Main --> FM
    FM --> GS
    GS --> FIX
    GS --> STATS
    GS --> TABLE
    GS --> TM
    TM --> TAC
    TM --> TM_MARKET
    TM --> PLAYER
    
    %% Data Connections
    TEAMS --> TM
    FIXTURES --> FIX
    PLAYERS --> PLAYER
    CONFIG_BANKS --> FM
    CONFIG_SPONSORS --> FM
    CONFIG_COMMENTS --> GS

    %% Click Events
    click Main "https://github.com/soundtrackgeek/footballmanager/blob/main/main.py"
    click FM "https://github.com/soundtrackgeek/footballmanager/blob/main/football_manager.py"
    click GS "https://github.com/soundtrackgeek/footballmanager/blob/main/game_simulation.py"
    click STATS "https://github.com/soundtrackgeek/footballmanager/blob/main/stats.py"
    click TABLE "https://github.com/soundtrackgeek/footballmanager/blob/main/table.py"
    click FIX "https://github.com/soundtrackgeek/footballmanager/blob/main/fixtures.py"
    click TM "https://github.com/soundtrackgeek/footballmanager/blob/main/team_management.py"
    click TAC "https://github.com/soundtrackgeek/footballmanager/blob/main/tactics.py"
    click TM_MARKET "https://github.com/soundtrackgeek/footballmanager/blob/main/transfer_market.py"
    click PLAYER "https://github.com/soundtrackgeek/footballmanager/blob/main/player.py"
    click TEAMS "https://github.com/soundtrackgeek/footballmanager/tree/main/Teams"
    click FIXTURES "https://github.com/soundtrackgeek/footballmanager/blob/main/fixture_list.json"
    click PLAYERS "https://github.com/soundtrackgeek/footballmanager/blob/main/playernames.csv"
    click CONFIG_BANKS "https://github.com/soundtrackgeek/footballmanager/blob/main/banks.txt"
    click CONFIG_SPONSORS "https://github.com/soundtrackgeek/footballmanager/blob/main/sponsors.txt"
    click CONFIG_COMMENTS "https://github.com/soundtrackgeek/footballmanager/blob/main/commentatorgoals.txt"

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Game Modules"]:::module
        L3["Data Storage"]:::storage
    end
```
