# rafael-vasconcellos/playhub-vanilla architecture

> Architecture diagram of the GitHub repository rafael-vasconcellos/playhub-vanilla, 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/rafael-vasconcellos/playhub-vanilla
- Repository: https://github.com/rafael-vasconcellos/playhub-vanilla

## Overview

PlayHub is a streaming-catalogue replica: visitors browse randomized content and category groupings, with a skeleton-loading experience; its Express API also supports production searches and category listings. The API workflow is visible from its entry point through use-case wiring, controllers, use cases, and repositories. The README documents the browser experience, but the available excerpts do not establish how browser code connects to the API or which frontend modules render each capability, so those links are omitted.

Main entry points: [`api/useCases/GetProductionInfo/index.ts`](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/useCases/GetProductionInfo/index.ts) (Search wiring), [`api/useCases/ListCategories/index.ts`](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/useCases/ListCategories/index.ts) (Category wiring), [`api/useCases/GetProductionInfo/GetProductionInfo.ts`](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/useCases/GetProductionInfo/GetProductionInfo.ts) (Production search), [`api/repositories/CategoriesRepo.ts`](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/repositories/CategoriesRepo.ts) (Category repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Browser experience"]
  node_browser["Streaming replica<br/>[index.html]"]
  node_browser_logic["Page behavior<br/>[script.js]"]
  node_browser_content["Browser catalogue<br/>[content.js]"]
end

subgraph group_api["API requests"]
  node_api_entry["Express API<br/>[api.ts]"]
  node_show_controller["Search controller"]
  node_show_usecase["Production search"]
  node_show_wiring["Search wiring<br/>[index.ts]"]
  node_category_controller["Category controller"]
  node_category_usecase["Category listing<br/>[ListCategories.ts]"]
  node_category_wiring["Category wiring<br/>[index.ts]"]
end

subgraph group_domain["Catalogue domain"]
  node_production_repo["Search repository"]
  node_category_repo["Category repository<br/>[CategoriesRepo.ts]"]
  node_repository_types["Repository contracts<br/>[IRepo.ts]"]
  node_show_type["Production shape<br/>[showInfo.ts]"]
  node_api_catalogue[("API catalogue<br/>[content.json]")]
end

node_visitor(("Visitor"))

node_visitor -->|"views"| node_browser
node_api_entry -->|"loads"| node_show_wiring
node_api_entry -->|"loads"| node_category_wiring
node_show_wiring -->|"constructs"| node_production_repo
node_show_wiring -->|"constructs"| node_show_usecase
node_show_wiring -->|"constructs"| node_show_controller
node_show_controller -->|"executes"| node_show_usecase
node_show_usecase -->|"searches"| node_production_repo
node_show_usecase -->|"reads"| node_api_catalogue
node_category_wiring -->|"constructs"| node_category_repo
node_category_wiring -->|"constructs"| node_category_usecase
node_category_wiring -->|"constructs"| node_category_controller
node_category_controller -->|"executes"| node_category_usecase
node_category_usecase -->|"lists"| node_category_repo
node_category_repo -->|"reads"| node_api_catalogue
node_production_repo -.->|"implements"| node_repository_types
node_category_repo -.->|"implements"| node_repository_types
node_repository_types -->|"uses type"| node_show_type

click node_browser "https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/index.html"
click node_browser_logic "https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/script.js"
click node_browser_content "https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/content.js"
click node_api_entry "https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/api.ts"
click node_show_controller "https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/useCases/GetProductionInfo/GetProductionInfoController.ts"
click node_show_usecase "https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/useCases/GetProductionInfo/GetProductionInfo.ts"
click node_show_wiring "https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/useCases/GetProductionInfo/index.ts"
click node_category_controller "https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/useCases/ListCategories/ListCategoriesController.ts"
click node_category_usecase "https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/useCases/ListCategories/ListCategories.ts"
click node_category_wiring "https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/useCases/ListCategories/index.ts"
click node_production_repo "https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/repositories/ProductionInfoRepo.ts"
click node_category_repo "https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/repositories/CategoriesRepo.ts"
click node_repository_types "https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/repositories/IRepo.ts"
click node_show_type "https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/entities/showInfo.ts"
click node_api_catalogue "https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/content.json"

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_browser,node_browser_logic,node_browser_content toneBlue
class node_api_entry,node_show_controller,node_show_usecase,node_show_wiring,node_category_controller,node_category_usecase,node_category_wiring toneAmber
class node_production_repo,node_category_repo,node_repository_types,node_show_type,node_api_catalogue toneMint
class node_visitor toneIndigo
```

## Components

### Browser experience

- [Streaming replica](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/index.html): `index.html`
- [Page behavior](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/script.js): `script.js`
- [Browser catalogue](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/content.js): `content.js`

### API requests

- [Express API](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/api.ts): `api/api.ts`
- [Search controller](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/useCases/GetProductionInfo/GetProductionInfoController.ts): `api/useCases/GetProductionInfo/GetProductionInfoController.ts`
- [Production search](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/useCases/GetProductionInfo/GetProductionInfo.ts): `api/useCases/GetProductionInfo/GetProductionInfo.ts`
- [Search wiring](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/useCases/GetProductionInfo/index.ts): `api/useCases/GetProductionInfo/index.ts`
- [Category controller](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/useCases/ListCategories/ListCategoriesController.ts): `api/useCases/ListCategories/ListCategoriesController.ts`
- [Category listing](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/useCases/ListCategories/ListCategories.ts): `api/useCases/ListCategories/ListCategories.ts`
- [Category wiring](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/useCases/ListCategories/index.ts): `api/useCases/ListCategories/index.ts`

### Catalogue domain

- [Search repository](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/repositories/ProductionInfoRepo.ts): `api/repositories/ProductionInfoRepo.ts`
- [Category repository](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/repositories/CategoriesRepo.ts): `api/repositories/CategoriesRepo.ts`
- [Repository contracts](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/repositories/IRepo.ts): `api/repositories/IRepo.ts`
- [Production shape](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/entities/showInfo.ts): `api/entities/showInfo.ts`
- [API catalogue](https://github.com/rafael-vasconcellos/playhub-vanilla/blob/main/api/content.json): `api/content.json`

### Other components

- **Visitor**

## Connections

- Visitor → Streaming replica: views (evidence: `readme.md`)
- Express API → Search wiring: loads (evidence: `api/api.ts`)
- Express API → Category wiring: loads (evidence: `api/api.ts`)
- Search wiring → Search repository: constructs (evidence: `api/useCases/GetProductionInfo/index.ts`)
- Search wiring → Production search: constructs (evidence: `api/useCases/GetProductionInfo/index.ts`)
- Search wiring → Search controller: constructs (evidence: `api/useCases/GetProductionInfo/index.ts`)
- Search controller → Production search: executes (evidence: `api/useCases/GetProductionInfo/GetProductionInfoController.ts`)
- Production search → Search repository: searches (evidence: `api/useCases/GetProductionInfo/GetProductionInfo.ts`)
- Production search → API catalogue: reads (evidence: `api/useCases/GetProductionInfo/GetProductionInfo.ts`)
- Category wiring → Category repository: constructs (evidence: `api/useCases/ListCategories/index.ts`)
- Category wiring → Category listing: constructs (evidence: `api/useCases/ListCategories/index.ts`)
- Category wiring → Category controller: constructs (evidence: `api/useCases/ListCategories/index.ts`)
- Category controller → Category listing: executes (evidence: `api/useCases/ListCategories/ListCategoriesController.ts`)
- Category listing → Category repository: lists (evidence: `api/useCases/ListCategories/ListCategories.ts`)
- Category repository → API catalogue: reads (evidence: `api/repositories/CategoriesRepo.ts`)
- Search repository → Repository contracts: implements
- Category repository → Repository contracts: implements
- Repository contracts → Production shape: uses type (evidence: `api/repositories/IRepo.ts`)
