# suzzux/steam_games_system architecture

> Architecture diagram of the GitHub repository suzzux/steam_games_system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/suzzux/steam_games_system
- Repository: https://github.com/suzzux/steam_games_system

## Overview

This is a game-catalog service organized around command/query responsibilities and ports with driven storage adapters. The main workflow accepts game ingestion or search/filter requests through an API controller; command handling builds domain objects and saves a game, while query handling searches or filters game IDs and loads game details. The source shows the service calls and adapter interfaces, but not runtime wiring to concrete adapters; those links are therefore omitted. Adapter implementations not excerpted are represented only where the tree and SOURCE INDEX support their role.

Main entry points: [`src/ports/outbound.py`](https://github.com/suzzux/steam_games_system/blob/main/src/ports/outbound.py) (Outbound ports), [`src/services/command_service.py`](https://github.com/suzzux/steam_games_system/blob/main/src/services/command_service.py) (Ingest service), [`src/adapters/driving/api_controller.py`](https://github.com/suzzux/steam_games_system/blob/main/src/adapters/driving/api_controller.py) (Game API), [`src/ports/dtos.py`](https://github.com/suzzux/steam_games_system/blob/main/src/ports/dtos.py) (Game DTOs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and use cases"]
  node_controller["Game API<br/>[api_controller.py]"]
  node_command["Ingest service<br/>[command_service.py]"]
  node_query["Query service<br/>[query_service.py]"]
end

subgraph group_domain["Game domain"]
  node_entities["Game entities<br/>[entities.py]"]
  node_values["Value objects<br/>[value_objects.py]"]
end

subgraph group_ports["Application ports"]
  node_dto["Game DTOs<br/>[dtos.py]"]
  node_inbound["Inbound ports<br/>[inbound.py]"]
  node_outbound["Outbound ports<br/>[outbound.py]"]
end

subgraph group_adapters["Storage adapters"]
  node_mongo[("Mongo adapter<br/>[mongo_adapter.py]")]
  node_elastic[("Elasticsearch adapter<br/>[elastic_adapter.py]")]
  node_neo4j[("Neo4j adapter<br/>[neo4j_adapter.py]")]
  node_redis[("Redis adapter<br/>[redis_adapter.py]")]
  node_kafka["Kafka adapter<br/>[kafka_adapter.py]"]
end

node_user(("API client"))

node_user -->|"sends requests"| node_controller
node_controller -->|"builds command"| node_dto
node_controller -->|"invokes command port"| node_inbound
node_controller -->|"delegates queries"| node_query
node_command -->|"builds game"| node_entities
node_command -->|"creates values"| node_values
node_command -->|"accepts command"| node_dto
node_command -->|"saves and publishes"| node_outbound
node_query -->|"searches and loads"| node_outbound
node_query -->|"returns responses"| node_dto
node_entities -->|"uses value types"| node_values
node_inbound -->|"uses DTOs"| node_dto
node_outbound -->|"exchanges games"| node_entities
node_mongo -->|"implements repository port"| node_outbound
node_elastic -->|"implements search port"| node_outbound
node_neo4j -->|"implements graph port"| node_outbound
node_redis -->|"implements cache port"| node_outbound
node_kafka -->|"implements publisher port"| node_outbound

click node_controller "https://github.com/suzzux/steam_games_system/blob/main/src/adapters/driving/api_controller.py"
click node_command "https://github.com/suzzux/steam_games_system/blob/main/src/services/command_service.py"
click node_query "https://github.com/suzzux/steam_games_system/blob/main/src/services/query_service.py"
click node_dto "https://github.com/suzzux/steam_games_system/blob/main/src/ports/dtos.py"
click node_inbound "https://github.com/suzzux/steam_games_system/blob/main/src/ports/inbound.py"
click node_outbound "https://github.com/suzzux/steam_games_system/blob/main/src/ports/outbound.py"
click node_entities "https://github.com/suzzux/steam_games_system/blob/main/src/domain/entities.py"
click node_values "https://github.com/suzzux/steam_games_system/blob/main/src/domain/value_objects.py"
click node_mongo "https://github.com/suzzux/steam_games_system/blob/main/src/adapters/driven/mongo_adapter.py"
click node_elastic "https://github.com/suzzux/steam_games_system/blob/main/src/adapters/driven/elastic_adapter.py"
click node_neo4j "https://github.com/suzzux/steam_games_system/blob/main/src/adapters/driven/neo4j_adapter.py"
click node_redis "https://github.com/suzzux/steam_games_system/blob/main/src/adapters/driven/redis_adapter.py"
click node_kafka "https://github.com/suzzux/steam_games_system/blob/main/src/adapters/driven/kafka_adapter.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_controller,node_command,node_query,node_user toneBlue
class node_entities,node_values toneAmber
class node_dto,node_inbound,node_outbound toneMint
class node_mongo,node_elastic,node_neo4j,node_redis,node_kafka toneRose
```

## Components

### API and use cases

- [Game API](https://github.com/suzzux/steam_games_system/blob/main/src/adapters/driving/api_controller.py): `src/adapters/driving/api_controller.py`
- [Ingest service](https://github.com/suzzux/steam_games_system/blob/main/src/services/command_service.py): `src/services/command_service.py`
- [Query service](https://github.com/suzzux/steam_games_system/blob/main/src/services/query_service.py): `src/services/query_service.py`

### Game domain

- [Game entities](https://github.com/suzzux/steam_games_system/blob/main/src/domain/entities.py): `src/domain/entities.py`
- [Value objects](https://github.com/suzzux/steam_games_system/blob/main/src/domain/value_objects.py): `src/domain/value_objects.py`

### Application ports

- [Game DTOs](https://github.com/suzzux/steam_games_system/blob/main/src/ports/dtos.py): `src/ports/dtos.py`
- [Inbound ports](https://github.com/suzzux/steam_games_system/blob/main/src/ports/inbound.py): `src/ports/inbound.py`
- [Outbound ports](https://github.com/suzzux/steam_games_system/blob/main/src/ports/outbound.py): `src/ports/outbound.py`

### Storage adapters

- [Mongo adapter](https://github.com/suzzux/steam_games_system/blob/main/src/adapters/driven/mongo_adapter.py): `src/adapters/driven/mongo_adapter.py`
- [Elasticsearch adapter](https://github.com/suzzux/steam_games_system/blob/main/src/adapters/driven/elastic_adapter.py): `src/adapters/driven/elastic_adapter.py`
- [Neo4j adapter](https://github.com/suzzux/steam_games_system/blob/main/src/adapters/driven/neo4j_adapter.py): `src/adapters/driven/neo4j_adapter.py`
- [Redis adapter](https://github.com/suzzux/steam_games_system/blob/main/src/adapters/driven/redis_adapter.py): `src/adapters/driven/redis_adapter.py`
- [Kafka adapter](https://github.com/suzzux/steam_games_system/blob/main/src/adapters/driven/kafka_adapter.py): `src/adapters/driven/kafka_adapter.py`

### Other components

- **API client**

## Connections

- API client → Game API: sends requests (evidence: `src/adapters/driving/api_controller.py`)
- Game API → Game DTOs: builds command (evidence: `src/adapters/driving/api_controller.py`)
- Game API → Inbound ports: invokes command port (evidence: `src/adapters/driving/api_controller.py`)
- Game API → Query service: delegates queries (evidence: `src/adapters/driving/api_controller.py`)
- Ingest service → Game entities: builds game (evidence: `src/services/command_service.py`)
- Ingest service → Value objects: creates values (evidence: `src/services/command_service.py`)
- Ingest service → Game DTOs: accepts command (evidence: `src/services/command_service.py`)
- Ingest service → Outbound ports: saves and publishes (evidence: `src/services/command_service.py`)
- Query service → Outbound ports: searches and loads (evidence: `src/services/query_service.py`)
- Query service → Game DTOs: returns responses (evidence: `src/services/query_service.py`)
- Game entities → Value objects: uses value types (evidence: `src/domain/entities.py`)
- Inbound ports → Game DTOs: uses DTOs (evidence: `src/ports/inbound.py`)
- Outbound ports → Game entities: exchanges games (evidence: `src/ports/outbound.py`)
- Mongo adapter → Outbound ports: implements repository port (evidence: `src/adapters/driven/mongo_adapter.py`)
- Elasticsearch adapter → Outbound ports: implements search port (evidence: `src/adapters/driven/elastic_adapter.py`)
- Neo4j adapter → Outbound ports: implements graph port (evidence: `src/adapters/driven/neo4j_adapter.py`)
- Redis adapter → Outbound ports: implements cache port (evidence: `src/adapters/driven/redis_adapter.py`)
- Kafka adapter → Outbound ports: implements publisher port (evidence: `src/adapters/driven/kafka_adapter.py`)
