# ohenriquesilva/spottube architecture

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

- Interactive diagram: https://gitdiagram.com/ohenriquesilva/spottube
- Repository: https://github.com/ohenriquesilva/spottube

## Overview

SpotTube is a browser-based music recommender whose main workflow turns Cold Start star ratings into a user vector, builds a ranked and exploration-augmented feed, then updates the profile from later ratings. The dashboard visualizes the resulting state. The graph follows calls visible in the excerpts and the README’s documented workflow; it does not infer script-loading relationships or inspect unsampled files.

Main entry points: [`js/app.js`](https://github.com/ohenriquesilva/spottube/blob/main/js/app.js) (App orchestration), [`js/matematica.js`](https://github.com/ohenriquesilva/spottube/blob/main/js/matematica.js) (Vector mathematics), [`js/exploracao.js`](https://github.com/ohenriquesilva/spottube/blob/main/js/exploracao.js) (Anti-bubble exploration), [`js/dashboard.js`](https://github.com/ohenriquesilva/spottube/blob/main/js/dashboard.js) (Math dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["User workflow"]
  node_app["App orchestration<br/>[app.js]"]
end

subgraph group_model["Recommendation model"]
  node_profile["Profile formation<br/>[perfil.js]"]
  node_math["Vector mathematics<br/>[matematica.js]"]
  node_ranking["Similarity ranking<br/>[recomendacao.js]"]
  node_exploration["Anti-bubble exploration<br/>[exploracao.js]"]
end

subgraph group_presentation["Interface and insight"]
  node_interface["Rating and feed UI<br/>[interface.js]"]
  node_dashboard["Math dashboard<br/>[dashboard.js]"]
end

subgraph group_foundation["Session foundation"]
  node_catalog[("Music catalog<br/>[catalogo.js]")]
  node_config["Model configuration<br/>[config.js]"]
  node_state["Session state<br/>[estado.js]"]
end

node_listener(("Listener"))

node_listener -->|"rates and navigates"| node_app
node_app -->|"looks up and validates"| node_catalog
node_app -->|"forms and updates"| node_profile
node_app -->|"updates session"| node_state
node_app -->|"requests feed"| node_ranking
node_app -->|"requests feed"| node_exploration
node_exploration -->|"gets ranked items"| node_ranking
node_ranking -->|"scores cosine"| node_math
node_exploration -->|"scores candidates"| node_math
node_profile -->|"calculates updates"| node_math
node_app -->|"renders and navigates"| node_interface
node_app -->|"configures and renders"| node_dashboard
node_dashboard -->|"reads songs"| node_catalog
node_dashboard -->|"computes displays"| node_math
node_config -->|"sets parameters"| node_math

click node_app "https://github.com/ohenriquesilva/spottube/blob/main/js/app.js"
click node_catalog "https://github.com/ohenriquesilva/spottube/blob/main/js/catalogo.js"
click node_config "https://github.com/ohenriquesilva/spottube/blob/main/js/config.js"
click node_state "https://github.com/ohenriquesilva/spottube/blob/main/js/estado.js"
click node_profile "https://github.com/ohenriquesilva/spottube/blob/main/js/perfil.js"
click node_math "https://github.com/ohenriquesilva/spottube/blob/main/js/matematica.js"
click node_ranking "https://github.com/ohenriquesilva/spottube/blob/main/js/recomendacao.js"
click node_exploration "https://github.com/ohenriquesilva/spottube/blob/main/js/exploracao.js"
click node_interface "https://github.com/ohenriquesilva/spottube/blob/main/js/interface.js"
click node_dashboard "https://github.com/ohenriquesilva/spottube/blob/main/js/dashboard.js"

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_app toneBlue
class node_profile,node_math,node_ranking,node_exploration toneAmber
class node_interface,node_dashboard toneMint
class node_catalog,node_config,node_state toneRose
class node_listener toneIndigo
```

## Components

### User workflow

- [App orchestration](https://github.com/ohenriquesilva/spottube/blob/main/js/app.js): `js/app.js`

### Recommendation model

- [Profile formation](https://github.com/ohenriquesilva/spottube/blob/main/js/perfil.js): `js/perfil.js`
- [Vector mathematics](https://github.com/ohenriquesilva/spottube/blob/main/js/matematica.js): `js/matematica.js`
- [Similarity ranking](https://github.com/ohenriquesilva/spottube/blob/main/js/recomendacao.js): `js/recomendacao.js`
- [Anti-bubble exploration](https://github.com/ohenriquesilva/spottube/blob/main/js/exploracao.js): `js/exploracao.js`

### Interface and insight

- [Rating and feed UI](https://github.com/ohenriquesilva/spottube/blob/main/js/interface.js): `js/interface.js`
- [Math dashboard](https://github.com/ohenriquesilva/spottube/blob/main/js/dashboard.js): `js/dashboard.js`

### Session foundation

- [Music catalog](https://github.com/ohenriquesilva/spottube/blob/main/js/catalogo.js): `js/catalogo.js`
- [Model configuration](https://github.com/ohenriquesilva/spottube/blob/main/js/config.js): `js/config.js`
- [Session state](https://github.com/ohenriquesilva/spottube/blob/main/js/estado.js): `js/estado.js`

### Other components

- **Listener**

## Connections

- Listener → App orchestration: rates and navigates (evidence: `js/app.js`)
- App orchestration → Music catalog: looks up and validates (evidence: `js/app.js`)
- App orchestration → Profile formation: forms and updates (evidence: `js/app.js`)
- App orchestration → Session state: updates session (evidence: `js/app.js`)
- App orchestration → Similarity ranking: requests feed
- App orchestration → Anti-bubble exploration: requests feed (evidence: `js/exploracao.js`)
- Anti-bubble exploration → Similarity ranking: gets ranked items (evidence: `js/exploracao.js`)
- Similarity ranking → Vector mathematics: scores cosine (evidence: `js/recomendacao.js`)
- Anti-bubble exploration → Vector mathematics: scores candidates (evidence: `js/exploracao.js`)
- Profile formation → Vector mathematics: calculates updates (evidence: `js/perfil.js`)
- App orchestration → Rating and feed UI: renders and navigates (evidence: `js/app.js`)
- App orchestration → Math dashboard: configures and renders (evidence: `js/app.js`)
- Math dashboard → Music catalog: reads songs (evidence: `js/dashboard.js`)
- Math dashboard → Vector mathematics: computes displays (evidence: `js/dashboard.js`)
- Model configuration → Vector mathematics: sets parameters (evidence: `js/matematica.js`)
