# run1e/striker architecture

> Architecture diagram of the GitHub repository run1e/striker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/run1e/striker
- Repository: https://github.com/run1e/striker

## Overview

##### Main Components Identification
The project is a microservices-based application with several key components:

a. Core Components:
- Discord Bot Service (bot/)
- Demo Parser Service (microservices/demoparse/)
- Gateway Service (microservices/gateway/)
- Uploader Service (microservices/uploader/)
- CS:GO Recorder Service (recorders/csgo/)

b. Supporting Components:
- Domain Layer (domain/)
- Message Bus System (messages/)
- Data Access Layer (adapters/)
- Services Layer (services/)

##### Component Relationships

a. Primary Flow:
##### Message Bus → Uploader Service

b. External Integrations:
- Bot Service ↔ Discord API
- Adapters ↔ Steam API
- Adapters ↔ FACEIT API

##### Specific Implementation Details

- Rectangles: Main services
- Hexagons: External APIs

- Blue: Core services
- Green: External services
- Yellow: Message bus
- Gray: Storage/Database
- Red: Critical paths

##### Technical Stack Indicators

Technology labels:
- Python (Main services)
- Node.js (Demo parsing)
- HLAE/advancedfx (Recording)
- Message broker system

##### Important Architectural Patterns

- Event-driven architecture (messages/)
- Domain-driven design (domain/)
- Repository pattern (adapters/repo.py)
- Unit of Work pattern (services/uow.py)

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Systems Layer
    subgraph External
        DiscordAPI[Discord API]:::external
        SteamAPI[Steam API]:::external
        FACEITAPI[FACEIT API]:::external
    end

    %% Application Layer
    subgraph Core
        Bot[Discord Bot Service]:::core
        Gateway[Gateway Service]:::core
        MessageBus[Message Bus]:::messagebus
        
        subgraph Microservices
            DemoParser[Demo Parser Service]:::service
            Recorder[CS:GO Recorder Service]:::service
            Uploader[Uploader Service]:::service
        end
        
        subgraph Domain
            DomainLayer[Domain Layer]:::domain
            DomainModels[Domain Models]:::domain
            DomainEnums[Domain Enums]:::domain
        end
        
        subgraph Messages
            Commands[Message Commands]:::message
            Events[Message Events]:::message
            Broker[Message Broker]:::message
        end
    end

    %% Infrastructure Layer
    subgraph Infrastructure
        Database[(Database)]:::storage
        Storage[(Demo Storage)]:::storage
        
        subgraph Adapters
            DataAccess[Data Access Layer]:::adapter
            Repository[Repository Pattern]:::adapter
            SteamInt[Steam Integration]:::adapter
            FACEITInt[FACEIT Integration]:::adapter
        end
        
        subgraph Services
            ServiceLayer[Services Layer]:::service
            UnitOfWork[Unit of Work]:::service
            Views[Service Views]:::service
        end
    end

    %% Relationships
    Bot --> DiscordAPI
    Bot --> Gateway
    Gateway --> MessageBus
    MessageBus --> DemoParser
    MessageBus --> Recorder
    MessageBus --> Uploader
    SteamInt --> SteamAPI
    FACEITInt --> FACEITAPI
    DataAccess --> Database
    Recorder --> Storage
    
    %% Click Events
    click Bot "https://github.com/Run1e/STRIKER/blob/master/bot/bot.py"
    click DemoParser "https://github.com/Run1e/STRIKER/blob/master/microservices/demoparse/demoparse.py"
    click Gateway "https://github.com/Run1e/STRIKER/blob/master/microservices/gateway/gateway.py"
    click Uploader "https://github.com/Run1e/STRIKER/blob/master/microservices/uploader/uploader.py"
    click Recorder "https://github.com/Run1e/STRIKER/blob/master/recorders/csgo/recorder.py"
    click DomainLayer "https://github.com/Run1e/STRIKER/blob/master/domain/domain.py"
    click MessageBus "https://github.com/Run1e/STRIKER/blob/master/messages/bus.py"
    click DataAccess "https://github.com/Run1e/STRIKER/blob/master/adapters/orm.py"
    click ServiceLayer "https://github.com/Run1e/STRIKER/blob/master/services/services.py"
    click SteamInt "https://github.com/Run1e/STRIKER/blob/master/adapters/steam.py"
    click FACEITInt "https://github.com/Run1e/STRIKER/blob/master/adapters/faceit.py"
    click Repository "https://github.com/Run1e/STRIKER/blob/master/adapters/repo.py"
    click UnitOfWork "https://github.com/Run1e/STRIKER/blob/master/services/uow.py"
    click Commands "https://github.com/Run1e/STRIKER/blob/master/messages/commands.py"
    click Events "https://github.com/Run1e/STRIKER/blob/master/messages/events.py"
    click DomainModels "https://github.com/Run1e/STRIKER/blob/master/domain/match.py"
    click Views "https://github.com/Run1e/STRIKER/blob/master/services/views.py"
    click Broker "https://github.com/Run1e/STRIKER/blob/master/messages/broker.py"
    click DomainEnums "https://github.com/Run1e/STRIKER/blob/master/domain/enums.py"

    %% Styles
    classDef core fill:#2374ab,stroke:#000,stroke-width:2px,color:#fff
    classDef service fill:#48a9a6,stroke:#000,stroke-width:1px,color:#fff
    classDef external fill:#4a4e69,stroke:#000,stroke-width:1px,color:#fff
    classDef storage fill:#9a8c98,stroke:#000,stroke-width:1px,color:#fff
    classDef messagebus fill:#c9ada7,stroke:#000,stroke-width:2px,color:#000
    classDef domain fill:#f2e9e4,stroke:#000,stroke-width:1px,color:#000
    classDef message fill:#e7c8a0,stroke:#000,stroke-width:1px,color:#000
    classDef adapter fill:#a4c3b2,stroke:#000,stroke-width:1px,color:#000
```
