# merlino91/streamsport architecture

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

- Interactive diagram: https://gitdiagram.com/merlino91/streamsport
- Repository: https://github.com/merlino91/streamsport

## Overview

StreamSport is a FastAPI Stremio addon. Users configure an EasyProxy URL and timezone, install the generated addon link, browse genre-filtered sporting events, then request metadata and streams: events are gathered and reconciled into a catalog, time rules determine live versus post-event options, and stream results include live sources or highlights/replays. The README documents Italian and international channels, DoH support, and SQLite retention. Sampled excerpts are partial, so some provider wiring and route details are not represented as edges.

Main entry points: [`app/services/stream_service.py`](https://github.com/merlino91/streamsport/blob/main/app/services/stream_service.py) (Stream assembly), [`app/services/catalog_service.py`](https://github.com/merlino91/streamsport/blob/main/app/services/catalog_service.py) (Catalog assembly), [`app/main.py`](https://github.com/merlino91/streamsport/blob/main/app/main.py) (FastAPI routes), [`app/services/youtube_service.py`](https://github.com/merlino91/streamsport/blob/main/app/services/youtube_service.py) (YouTube highlights)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Addon API"]
  node_main["FastAPI routes<br/>[main.py]"]
end

subgraph group_events["Event catalog"]
  node_config["Addon settings<br/>[config.py]"]
  node_catalog["Catalog assembly<br/>[catalog_service.py]"]
  node_genres["Genre classification"]
  node_espn["ESPN events<br/>[espn_service.py]"]
  node_blacktop["Motorsport sessions"]
  node_sportsdb["Official calendar"]
end

subgraph group_playback["Playback"]
  node_stream["Stream assembly<br/>[stream_service.py]"]
  node_streamed["Streamed sources<br/>[streamed_api.py]"]
  node_daddy["DaddyLive sources<br/>[daddylive_api.py]"]
  node_tvvoo["TV channel sources<br/>[tvvoo_service.py]"]
  node_youtube["YouTube highlights<br/>[youtube_service.py]"]
  node_daily["Dailymotion highlights"]
  node_replay["Sport replays"]
end

subgraph group_state["Assets and state"]
  node_sqlite[("Match database<br/>[db_service.py]")]
  node_poster["Poster rendering<br/>[banner_service.py]"]
  node_tennis["Tennis posters"]
  node_doh["DoH client<br/>[doh_client.py]"]
end

subgraph group_external["External services"]
  node_proxy{{"EasyProxy"}}
  node_sportsfeeds{{"Sports data feeds"}}
  node_video{{"Video providers"}}
end

node_user(("Stremio user"))

node_user -->|"requests addon"| node_main
node_main -->|"fetches catalog/meta"| node_catalog
node_main -->|"requests streams"| node_stream
node_main -->|"requests poster"| node_poster
node_main -->|"resolves video"| node_daily
node_main -->|"reads settings"| node_config
node_catalog -->|"classifies events"| node_genres
node_catalog -->|"reconciles events"| node_espn
node_catalog -->|"verifies motorsport"| node_blacktop
node_catalog -->|"enriches events"| node_sportsdb
node_catalog -->|"persists matches"| node_sqlite
node_stream -->|"reads matches"| node_sqlite
node_stream -->|"resolves sources"| node_streamed
node_stream -->|"looks up fallback"| node_daddy
node_stream -->|"uses channel sources"| node_tvvoo
node_stream -->|"gets highlights"| node_youtube
node_stream -->|"gets highlights"| node_daily
node_stream -->|"gets replays"| node_replay
node_stream -.->|"builds proxy links"| node_proxy
node_espn -.->|"fetches schedules"| node_sportsfeeds
node_blacktop -.->|"fetches sessions"| node_sportsfeeds
node_sportsdb -.->|"fetches calendar"| node_sportsfeeds
node_youtube -->|"fetches metadata"| node_doh
node_youtube -.->|"extracts media"| node_video
node_daily -.->|"resolves media"| node_video
node_poster -->|"reads cached match"| node_catalog
node_tennis -.->|"looks up player art"| node_sportsfeeds

click node_main "https://github.com/merlino91/streamsport/blob/main/app/main.py"
click node_config "https://github.com/merlino91/streamsport/blob/main/app/config.py"
click node_catalog "https://github.com/merlino91/streamsport/blob/main/app/services/catalog_service.py"
click node_genres "https://github.com/merlino91/streamsport/blob/main/app/services/genre_classifier.py"
click node_espn "https://github.com/merlino91/streamsport/blob/main/app/services/espn_service.py"
click node_blacktop "https://github.com/merlino91/streamsport/blob/main/app/services/ocblacktop_service.py"
click node_sportsdb "https://github.com/merlino91/streamsport/blob/main/app/services/thesportsdb_service.py"
click node_sqlite "https://github.com/merlino91/streamsport/blob/main/app/services/db_service.py"
click node_stream "https://github.com/merlino91/streamsport/blob/main/app/services/stream_service.py"
click node_streamed "https://github.com/merlino91/streamsport/blob/main/app/services/streamed_api.py"
click node_daddy "https://github.com/merlino91/streamsport/blob/main/app/services/daddylive_api.py"
click node_tvvoo "https://github.com/merlino91/streamsport/blob/main/app/services/tvvoo_service.py"
click node_youtube "https://github.com/merlino91/streamsport/blob/main/app/services/youtube_service.py"
click node_daily "https://github.com/merlino91/streamsport/blob/main/app/services/dailymotion_service.py"
click node_replay "https://github.com/merlino91/streamsport/blob/main/app/services/sportvideo_service.py"
click node_poster "https://github.com/merlino91/streamsport/blob/main/app/services/banner_service.py"
click node_tennis "https://github.com/merlino91/streamsport/blob/main/app/services/tennis_poster_service.py"
click node_doh "https://github.com/merlino91/streamsport/blob/main/app/services/doh_client.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_main,node_user toneBlue
class node_config,node_catalog,node_genres,node_espn,node_blacktop,node_sportsdb toneAmber
class node_stream,node_streamed,node_daddy,node_tvvoo,node_youtube,node_daily,node_replay toneMint
class node_sqlite,node_poster,node_tennis,node_doh toneRose
class node_proxy,node_sportsfeeds,node_video toneIndigo
```

## Components

### Addon API

- [FastAPI routes](https://github.com/merlino91/streamsport/blob/main/app/main.py): `app/main.py`

### Event catalog

- [Addon settings](https://github.com/merlino91/streamsport/blob/main/app/config.py): `app/config.py`
- [Catalog assembly](https://github.com/merlino91/streamsport/blob/main/app/services/catalog_service.py): `app/services/catalog_service.py`
- [Genre classification](https://github.com/merlino91/streamsport/blob/main/app/services/genre_classifier.py): `app/services/genre_classifier.py`
- [ESPN events](https://github.com/merlino91/streamsport/blob/main/app/services/espn_service.py): `app/services/espn_service.py`
- [Motorsport sessions](https://github.com/merlino91/streamsport/blob/main/app/services/ocblacktop_service.py): `app/services/ocblacktop_service.py`
- [Official calendar](https://github.com/merlino91/streamsport/blob/main/app/services/thesportsdb_service.py): `app/services/thesportsdb_service.py`

### Playback

- [Stream assembly](https://github.com/merlino91/streamsport/blob/main/app/services/stream_service.py): `app/services/stream_service.py`
- [Streamed sources](https://github.com/merlino91/streamsport/blob/main/app/services/streamed_api.py): `app/services/streamed_api.py`
- [DaddyLive sources](https://github.com/merlino91/streamsport/blob/main/app/services/daddylive_api.py): `app/services/daddylive_api.py`
- [TV channel sources](https://github.com/merlino91/streamsport/blob/main/app/services/tvvoo_service.py): `app/services/tvvoo_service.py`
- [YouTube highlights](https://github.com/merlino91/streamsport/blob/main/app/services/youtube_service.py): `app/services/youtube_service.py`
- [Dailymotion highlights](https://github.com/merlino91/streamsport/blob/main/app/services/dailymotion_service.py): `app/services/dailymotion_service.py`
- [Sport replays](https://github.com/merlino91/streamsport/blob/main/app/services/sportvideo_service.py): `app/services/sportvideo_service.py`

### Assets and state

- [Match database](https://github.com/merlino91/streamsport/blob/main/app/services/db_service.py): `app/services/db_service.py`
- [Poster rendering](https://github.com/merlino91/streamsport/blob/main/app/services/banner_service.py): `app/services/banner_service.py`
- [Tennis posters](https://github.com/merlino91/streamsport/blob/main/app/services/tennis_poster_service.py): `app/services/tennis_poster_service.py`
- [DoH client](https://github.com/merlino91/streamsport/blob/main/app/services/doh_client.py): `app/services/doh_client.py`

### External services

- **EasyProxy**
- **Sports data feeds**
- **Video providers**

### Other components

- **Stremio user**

## Connections

- Stremio user → FastAPI routes: requests addon
- FastAPI routes → Catalog assembly: fetches catalog/meta
- FastAPI routes → Stream assembly: requests streams
- FastAPI routes → Poster rendering: requests poster
- FastAPI routes → Dailymotion highlights: resolves video
- FastAPI routes → Addon settings: reads settings
- Catalog assembly → Genre classification: classifies events
- Catalog assembly → ESPN events: reconciles events
- Catalog assembly → Motorsport sessions: verifies motorsport
- Catalog assembly → Official calendar: enriches events
- Catalog assembly → Match database: persists matches
- Stream assembly → Match database: reads matches
- Stream assembly → Streamed sources: resolves sources
- Stream assembly → DaddyLive sources: looks up fallback
- Stream assembly → TV channel sources: uses channel sources
- Stream assembly → YouTube highlights: gets highlights
- Stream assembly → Dailymotion highlights: gets highlights
- Stream assembly → Sport replays: gets replays
- Stream assembly → EasyProxy: builds proxy links
- ESPN events → Sports data feeds: fetches schedules
- Motorsport sessions → Sports data feeds: fetches sessions
- Official calendar → Sports data feeds: fetches calendar
- YouTube highlights → DoH client: fetches metadata
- YouTube highlights → Video providers: extracts media
- Dailymotion highlights → Video providers: resolves media
- Poster rendering → Catalog assembly: reads cached match
- Tennis posters → Sports data feeds: looks up player art
