# 1x7xxxxxxx/dashboard_music_platform_algo_spotify architecture

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

- Interactive diagram: https://gitdiagram.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify
- Repository: https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify

## Overview

streaMLytics is a multi-tenant music-analytics SaaS: platform data is collected or uploaded, stored in PostgreSQL, and presented through an artist dashboard, with ML analysis and a REST API as additional product surfaces. The README documents the broad collection and dashboard capabilities; the source excerpts/index confirm key application, routing, authentication, parsing, and storage components. Several detailed collector-to-storage and model-serving calls were not sampled, so those links are omitted or marked unverified.

Main entry points: [`src/dashboard/app.py`](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/dashboard/app.py) (Streamlit application), [`src/database/postgres_handler.py`](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/database/postgres_handler.py) (PostgreSQL handler), [`src/dashboard/views`](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/tree/main/src/dashboard/views) (Analytics and workflow views), [`src/transformers`](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/tree/main/src/transformers) (CSV parsers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Data ingestion"]
  node_airflow["Airflow schedules"]
  node_collectors["Platform collectors"]
  node_csv["CSV parsers"]
end

subgraph group_persistence["Persistence and quality"]
  node_pg[("PostgreSQL handler")]
  node_stripe_schema[("Subscription schema<br/>[stripe_schema.py]")]
  node_quality["Data invariants<br/>[gold_invariants.py]"]
end

subgraph group_experience["Artist experience"]
  node_dashboard["Streamlit application<br/>[app.py]"]
  node_routing["Page routing<br/>[routes.py]"]
  node_views["Analytics and workflow views"]
  node_auth["Dashboard authentication<br/>[auth.py]"]
  node_navigation["Dashboard navigation<br/>[navigation.py]"]
  node_settings["Application settings<br/>[app_settings.py]"]
  node_i18n["Localization<br/>[i18n.py]"]
  node_throttle["Request throttling<br/>[throttle.py]"]
  node_ui["Shared UI utilities<br/>[ui.py]"]
end

subgraph group_services["API and analytics"]
  node_api["REST API<br/>[main.py]"]
  node_webhook["Stripe webhook<br/>[stripe_webhook.py]"]
  node_ml["ML inference<br/>[ml_inference.py]"]
  node_matching["Track matching<br/>[track_matching.py]"]
  node_email["Verification email"]
  node_identity["Instance identity"]
  node_metrics["Metrics<br/>[metrics.py]"]
end

node_artist(("Artist or operator"))

node_artist -->|"uses"| node_dashboard
node_airflow -.->|"schedules collection"| node_collectors
node_artist -->|"uploads platform data"| node_csv
node_collectors -.->|"stores collected data"| node_pg
node_csv -.->|"loads parsed data"| node_pg
node_dashboard -->|"authenticates users"| node_auth
node_dashboard -->|"dispatches pages"| node_routing
node_routing -->|"resolves page modules"| node_views
node_dashboard -->|"builds navigation"| node_navigation
node_auth -->|"reads user records"| node_pg
node_dashboard -->|"loads configuration"| node_settings
node_dashboard -->|"uses translations"| node_i18n
node_views -->|"uses throttling"| node_throttle
node_views -->|"uses shared UI"| node_ui
node_views -.->|"queries analytics data"| node_pg
node_api -->|"checks database health"| node_pg
node_api -->|"publishes metrics"| node_metrics
node_webhook -->|"updates subscription records"| node_pg
node_webhook -.->|"maintains subscription state"| node_stripe_schema
node_ml -->|"matches tracks"| node_matching
node_csv -->|"matches imported tracks"| node_matching
node_quality -.->|"validates stored data"| node_pg
node_email -->|"labels email instance"| node_identity

click node_airflow "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/airflow/dags/spotify_api_daily.py"
click node_collectors "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/tree/main/src/collectors"
click node_csv "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/tree/main/src/transformers"
click node_pg "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/database/postgres_handler.py"
click node_stripe_schema "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/database/stripe_schema.py"
click node_quality "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/utils/gold_invariants.py"
click node_dashboard "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/dashboard/app.py"
click node_routing "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/dashboard/routes.py"
click node_views "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/tree/main/src/dashboard/views"
click node_auth "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/dashboard/auth.py"
click node_navigation "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/dashboard/utils/navigation.py"
click node_settings "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/dashboard/utils/app_settings.py"
click node_i18n "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/dashboard/utils/i18n.py"
click node_throttle "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/dashboard/utils/throttle.py"
click node_ui "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/dashboard/utils/ui.py"
click node_api "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/api/main.py"
click node_webhook "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/api/routers/stripe_webhook.py"
click node_ml "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/utils/ml_inference.py"
click node_matching "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/utils/track_matching.py"
click node_email "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/utils/verification_email.py"
click node_identity "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/utils/instance_identity.py"
click node_metrics "https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/utils/metrics.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_airflow,node_collectors,node_csv toneBlue
class node_pg,node_stripe_schema,node_quality toneAmber
class node_dashboard,node_routing,node_views,node_auth,node_navigation,node_settings,node_i18n,node_throttle,node_ui toneMint
class node_api,node_webhook,node_ml,node_matching,node_email,node_identity,node_metrics toneRose
class node_artist toneIndigo
```

## Components

### Data ingestion

- [Airflow schedules](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/airflow/dags/spotify_api_daily.py): `airflow/dags/spotify_api_daily.py`
- [Platform collectors](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/tree/main/src/collectors): `src/collectors`
- [CSV parsers](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/tree/main/src/transformers): `src/transformers`

### Persistence and quality

- [PostgreSQL handler](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/database/postgres_handler.py): `src/database/postgres_handler.py`
- [Subscription schema](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/database/stripe_schema.py): `src/database/stripe_schema.py`
- [Data invariants](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/utils/gold_invariants.py): `src/utils/gold_invariants.py`

### Artist experience

- [Streamlit application](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/dashboard/app.py): `src/dashboard/app.py`
- [Page routing](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/dashboard/routes.py): `src/dashboard/routes.py`
- [Analytics and workflow views](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/tree/main/src/dashboard/views): `src/dashboard/views`
- [Dashboard authentication](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/dashboard/auth.py): `src/dashboard/auth.py`
- [Dashboard navigation](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/dashboard/utils/navigation.py): `src/dashboard/utils/navigation.py`
- [Application settings](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/dashboard/utils/app_settings.py): `src/dashboard/utils/app_settings.py`
- [Localization](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/dashboard/utils/i18n.py): `src/dashboard/utils/i18n.py`
- [Request throttling](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/dashboard/utils/throttle.py): `src/dashboard/utils/throttle.py`
- [Shared UI utilities](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/dashboard/utils/ui.py): `src/dashboard/utils/ui.py`

### API and analytics

- [REST API](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/api/main.py): `src/api/main.py`
- [Stripe webhook](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/api/routers/stripe_webhook.py): `src/api/routers/stripe_webhook.py`
- [ML inference](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/utils/ml_inference.py): `src/utils/ml_inference.py`
- [Track matching](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/utils/track_matching.py): `src/utils/track_matching.py`
- [Verification email](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/utils/verification_email.py): `src/utils/verification_email.py`
- [Instance identity](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/utils/instance_identity.py): `src/utils/instance_identity.py`
- [Metrics](https://github.com/1x7xxxxxxx/dashboard_music_platform_algo_spotify/blob/main/src/utils/metrics.py): `src/utils/metrics.py`

### Other components

- **Artist or operator**

## Connections

- Artist or operator → Streamlit application: uses (evidence: `README.md`)
- Airflow schedules → Platform collectors: schedules collection
- Artist or operator → CSV parsers: uploads platform data (evidence: `README.md`)
- Platform collectors → PostgreSQL handler: stores collected data
- CSV parsers → PostgreSQL handler: loads parsed data
- Streamlit application → Dashboard authentication: authenticates users (evidence: `src/dashboard/app.py`)
- Streamlit application → Page routing: dispatches pages (evidence: `src/dashboard/routes.py`)
- Page routing → Analytics and workflow views: resolves page modules (evidence: `src/dashboard/routes.py`)
- Streamlit application → Dashboard navigation: builds navigation (evidence: `src/dashboard/app.py`)
- Dashboard authentication → PostgreSQL handler: reads user records (evidence: `src/dashboard/auth.py`)
- Streamlit application → Application settings: loads configuration (evidence: `src/dashboard/app.py`)
- Streamlit application → Localization: uses translations (evidence: `src/dashboard/app.py`)
- Analytics and workflow views → Request throttling: uses throttling (evidence: `src/dashboard/views/service.py`)
- Analytics and workflow views → Shared UI utilities: uses shared UI
- Analytics and workflow views → PostgreSQL handler: queries analytics data
- REST API → PostgreSQL handler: checks database health (evidence: `src/api/main.py`)
- REST API → Metrics: publishes metrics (evidence: `src/api/main.py`)
- Stripe webhook → PostgreSQL handler: updates subscription records (evidence: `src/api/routers/stripe_webhook.py`)
- Stripe webhook → Subscription schema: maintains subscription state
- ML inference → Track matching: matches tracks (evidence: `src/utils/ml_inference.py`)
- CSV parsers → Track matching: matches imported tracks (evidence: `src/transformers/s4a_csv_parser.py`)
- Data invariants → PostgreSQL handler: validates stored data
- Verification email → Instance identity: labels email instance (evidence: `src/utils/service_request_mail.py`)
