# doug-folk/pi_big_data architecture

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

- Interactive diagram: https://gitdiagram.com/doug-folk/pi_big_data
- Repository: https://github.com/doug-folk/pi_big_data

## Overview

GameFinder is a game-discovery and recommendation product: players browse or search games, then request recommendations by mood, game, filters, or cluster. The Laravel API serves catalog results and delegates recommendation queries to a Python service; it hydrates returned IDs from its game model and has local fallback queries. The README describes collaborative and content-based recommendation plus an ETL that loads game data. The frontend is described as plain JavaScript/CSS rather than the sampled React placeholder. ETL and cross-service wiring beyond the shown API calls are documented, not source-verified.

Main entry points: [`backend-api/app/Http/Controllers/GameController.php`](https://github.com/doug-folk/pi_big_data/blob/develop/backend-api/app/Http/Controllers/GameController.php) (Game endpoints), [`frontend/main.js`](https://github.com/doug-folk/pi_big_data/blob/develop/frontend/main.js) (Web interface), [`backend-api/public/index.php`](https://github.com/doug-folk/pi_big_data/blob/develop/backend-api/public/index.php) (Laravel entry), [`backend-api/routes/api.php`](https://github.com/doug-folk/pi_big_data/blob/develop/backend-api/routes/api.php) (API routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Player interface"]
  node_web["Web interface<br/>[main.js]"]
end

subgraph group_api["Game API"]
  node_laravel_entry["Laravel entry<br/>[index.php]"]
  node_api_routes["API routes<br/>[api.php]"]
  node_game_api["Game endpoints<br/>[GameController.php]"]
end

subgraph group_recommendation["Recommendation system"]
  node_recommender_api["Recommendation API"]
  node_hybrid_methods["Hybrid recommenders"]
end

subgraph group_data["Game data"]
  node_game_model["Game model<br/>[Game.php]"]
  node_game_store[("PostgreSQL games<br/>[database.php]")]
  node_game_etl["Game ETL<br/>[etl_script.py]"]
end

node_player(("Player"))

node_player -.->|"uses"| node_web
node_web -.->|"requests games"| node_laravel_entry
node_laravel_entry -->|"routes requests"| node_api_routes
node_api_routes -->|"dispatches"| node_game_api
node_game_api -->|"queries and hydrates"| node_game_model
node_game_model -.->|"persists games"| node_game_store
node_game_api -->|"requests recommendations"| node_recommender_api
node_recommender_api -.->|"serves recommendations"| node_hybrid_methods
node_game_etl -.->|"loads game data"| node_game_store

click node_web "https://github.com/doug-folk/pi_big_data/blob/develop/frontend/main.js"
click node_laravel_entry "https://github.com/doug-folk/pi_big_data/blob/develop/backend-api/public/index.php"
click node_api_routes "https://github.com/doug-folk/pi_big_data/blob/develop/backend-api/routes/api.php"
click node_game_api "https://github.com/doug-folk/pi_big_data/blob/develop/backend-api/app/Http/Controllers/GameController.php"
click node_game_model "https://github.com/doug-folk/pi_big_data/blob/develop/backend-api/app/Models/Game.php"
click node_game_store "https://github.com/doug-folk/pi_big_data/blob/develop/backend-api/config/database.php"
click node_recommender_api "https://github.com/doug-folk/pi_big_data/blob/develop/recommender-service/recommender_service.py"
click node_hybrid_methods "https://github.com/doug-folk/pi_big_data/blob/develop/recommender-service/recommender_service.py"
click node_game_etl "https://github.com/doug-folk/pi_big_data/blob/develop/recommender-service/etl/etl_script.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_web toneBlue
class node_laravel_entry,node_api_routes,node_game_api toneAmber
class node_recommender_api,node_hybrid_methods toneMint
class node_game_model,node_game_store,node_game_etl toneRose
class node_player toneIndigo
```

## Components

### Player interface

- [Web interface](https://github.com/doug-folk/pi_big_data/blob/develop/frontend/main.js): `frontend/main.js`

### Game API

- [Laravel entry](https://github.com/doug-folk/pi_big_data/blob/develop/backend-api/public/index.php): `backend-api/public/index.php`
- [API routes](https://github.com/doug-folk/pi_big_data/blob/develop/backend-api/routes/api.php): `backend-api/routes/api.php`
- [Game endpoints](https://github.com/doug-folk/pi_big_data/blob/develop/backend-api/app/Http/Controllers/GameController.php): `backend-api/app/Http/Controllers/GameController.php`

### Recommendation system

- [Recommendation API](https://github.com/doug-folk/pi_big_data/blob/develop/recommender-service/recommender_service.py): `recommender-service/recommender_service.py`
- [Hybrid recommenders](https://github.com/doug-folk/pi_big_data/blob/develop/recommender-service/recommender_service.py): `recommender-service/recommender_service.py`

### Game data

- [Game model](https://github.com/doug-folk/pi_big_data/blob/develop/backend-api/app/Models/Game.php): `backend-api/app/Models/Game.php`
- [PostgreSQL games](https://github.com/doug-folk/pi_big_data/blob/develop/backend-api/config/database.php): `backend-api/config/database.php`
- [Game ETL](https://github.com/doug-folk/pi_big_data/blob/develop/recommender-service/etl/etl_script.py): `recommender-service/etl/etl_script.py`

### Other components

- **Player**

## Connections

- Player → Web interface: uses (evidence: `README.md`)
- Web interface → Laravel entry: requests games (evidence: `README.md`)
- Laravel entry → API routes: routes requests
- API routes → Game endpoints: dispatches (evidence: `backend-api/routes/api.php`)
- Game endpoints → Game model: queries and hydrates (evidence: `backend-api/app/Http/Controllers/GameController.php`)
- Game model → PostgreSQL games: persists games
- Game endpoints → Recommendation API: requests recommendations (evidence: `backend-api/app/Http/Controllers/GameController.php`)
- Recommendation API → Hybrid recommenders: serves recommendations (evidence: `recommender-service/recommender_service.py`)
- Game ETL → PostgreSQL games: loads game data (evidence: `README.md`)
