# sushilbarman953-eng/spectra-stream architecture

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

- Interactive diagram: https://gitdiagram.com/sushilbarman953-eng/spectra-stream
- Repository: https://github.com/sushilbarman953-eng/spectra-stream

## Overview

Spectra-Stream is a streaming-media discovery and playback web app. The user-facing journey spans browsing or searching a catalog, opening media details, and watching or downloading content; anime, live-TV/IPTV, account access, and personal media shelves are additional capabilities. The tree identifies these routes and modules, but the README gives no behavioral detail, and most UI source was not sampled, so uncertain wiring between pages and services is intentionally omitted.

Main entry points: [`src/lib/tmdb.ts`](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/lib/tmdb.ts) (TMDB Client), [`src/app/api/search/route.ts`](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/api/search/route.ts) (Search API), [`src/app/api/discover/route.ts`](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/api/discover/route.ts) (Discover API), [`src/app/api/iptv-proxy/route.ts`](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/api/iptv-proxy/route.ts) (IPTV Proxy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Catalog Discovery"]
  node_home["Home<br/>[page.tsx]"]
  node_browse["Browse Pages<br/>[page.tsx]"]
  node_genre["Media Categories<br/>[page.tsx]"]
  node_anime["Anime Catalog<br/>[page.tsx]"]
  node_searchui["Search UI<br/>[SearchModal.tsx]"]
  node_searchapi["Search API<br/>[route.ts]"]
  node_discoverapi["Discover API<br/>[route.ts]"]
  node_tmdb["TMDB Client<br/>[tmdb.ts]"]
  node_details["Media Details<br/>[page.tsx]"]
end

subgraph group_playback["Playback &amp; Downloads"]
  node_watch["Watch Page<br/>[page.tsx]"]
  node_player["Video Players<br/>[Player.tsx]"]
  node_streamapi["Stream API<br/>[route.ts]"]
  node_animeplayer["Anime Player<br/>[AnimePlayer.tsx]"]
  node_iptv["IPTV Tools<br/>[iptv.ts]"]
  node_iptvproxy["IPTV Proxy<br/>[route.ts]"]
  node_downloadapi["Download Proxy<br/>[route.ts]"]
  node_downloads["Downloads Page<br/>[page.tsx]"]
  node_downloadmgr["Download Manager<br/>[downloadManager.ts]"]
end

subgraph group_personal["Personal Library"]
  node_watchlist[("Watchlist Manager")]
  node_progress[("Playback History<br/>[playbackHistory.ts]")]
  node_watchprogress[("Watch Progress<br/>[watchProgress.ts]")]
  node_profile["My Media<br/>[page.tsx]"]
end

subgraph group_account["Account &amp; App"]
  node_auth["Auth Pages<br/>[page.tsx]"]
  node_callback["Auth Callback<br/>[route.ts]"]
  node_layout["App Layout<br/>[layout.tsx]"]
  node_swregister["Service Worker Setup"]
  node_sw["Service Worker<br/>[sw.js]"]
end

node_viewer(("Viewer"))
node_tmdbservice["TMDB Service"]
node_supabase["Supabase Auth"]
node_downloadsource["Media Source"]
node_iptvsource["IPTV Source"]

node_viewer -->|"opens"| node_home
node_viewer -->|"browses"| node_browse
node_viewer -->|"searches"| node_searchui
node_viewer -->|"views details"| node_details
node_viewer -->|"watches"| node_watch
node_viewer -->|"signs in"| node_auth
node_viewer -->|"views library"| node_profile
node_viewer -->|"views downloads"| node_downloads
node_searchapi -->|"queries"| node_tmdbservice
node_discoverapi -->|"calls"| node_tmdb
node_tmdb -->|"queries"| node_tmdbservice
node_callback -->|"exchanges code"| node_supabase
node_downloadapi -->|"fetches media"| node_downloadsource
node_iptvproxy -->|"fetches stream"| node_iptvsource
node_swregister -->|"registers"| node_sw

click node_home "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/page.tsx"
click node_browse "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/explore/page.tsx"
click node_genre "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/movies/page.tsx"
click node_anime "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/anime/page.tsx"
click node_searchui "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/components/SearchModal.tsx"
click node_searchapi "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/api/search/route.ts"
click node_discoverapi "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/api/discover/route.ts"
click node_tmdb "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/lib/tmdb.ts"
click node_details "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/details/%5Bid%5D/page.tsx"
click node_watch "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/watch/%5Bid%5D/page.tsx"
click node_player "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/components/Player.tsx"
click node_streamapi "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/api/stream/route.ts"
click node_animeplayer "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/components/AnimePlayer.tsx"
click node_iptv "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/lib/iptv.ts"
click node_iptvproxy "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/api/iptv-proxy/route.ts"
click node_downloadapi "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/api/download/route.ts"
click node_downloads "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/downloads/page.tsx"
click node_downloadmgr "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/lib/downloadManager.ts"
click node_watchlist "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/lib/watchlistManager.ts"
click node_progress "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/lib/playbackHistory.ts"
click node_watchprogress "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/lib/watchProgress.ts"
click node_profile "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/me/page.tsx"
click node_auth "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/auth/page.tsx"
click node_callback "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/auth/callback/route.ts"
click node_layout "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/layout.tsx"
click node_swregister "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/components/ServiceWorkerRegister.tsx"
click node_sw "https://github.com/sushilbarman953-eng/spectra-stream/blob/main/public/sw.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_home,node_browse,node_genre,node_anime,node_searchui,node_searchapi,node_discoverapi,node_tmdb,node_details,node_viewer toneBlue
class node_watch,node_player,node_streamapi,node_animeplayer,node_iptv,node_iptvproxy,node_downloadapi,node_downloads,node_downloadmgr toneAmber
class node_watchlist,node_progress,node_watchprogress,node_profile toneMint
class node_auth,node_callback,node_layout,node_swregister,node_sw toneRose
class node_tmdbservice,node_supabase,node_downloadsource,node_iptvsource toneIndigo
```

## Components

### Catalog Discovery

- [Home](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Browse Pages](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/explore/page.tsx): `src/app/explore/page.tsx`
- [Media Categories](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/movies/page.tsx): `src/app/movies/page.tsx`
- [Anime Catalog](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/anime/page.tsx): `src/app/anime/page.tsx`
- [Search UI](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/components/SearchModal.tsx): `src/components/SearchModal.tsx`
- [Search API](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/api/search/route.ts): `src/app/api/search/route.ts`
- [Discover API](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/api/discover/route.ts): `src/app/api/discover/route.ts`
- [TMDB Client](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/lib/tmdb.ts): `src/lib/tmdb.ts`
- [Media Details](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/details/%5Bid%5D/page.tsx): `src/app/details/[id]/page.tsx`

### Playback & Downloads

- [Watch Page](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/watch/%5Bid%5D/page.tsx): `src/app/watch/[id]/page.tsx`
- [Video Players](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/components/Player.tsx): `src/components/Player.tsx`
- [Stream API](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/api/stream/route.ts): `src/app/api/stream/route.ts`
- [Anime Player](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/components/AnimePlayer.tsx): `src/components/AnimePlayer.tsx`
- [IPTV Tools](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/lib/iptv.ts): `src/lib/iptv.ts`
- [IPTV Proxy](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/api/iptv-proxy/route.ts): `src/app/api/iptv-proxy/route.ts`
- [Download Proxy](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/api/download/route.ts): `src/app/api/download/route.ts`
- [Downloads Page](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/downloads/page.tsx): `src/app/downloads/page.tsx`
- [Download Manager](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/lib/downloadManager.ts): `src/lib/downloadManager.ts`

### Personal Library

- [Watchlist Manager](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/lib/watchlistManager.ts): `src/lib/watchlistManager.ts`
- [Playback History](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/lib/playbackHistory.ts): `src/lib/playbackHistory.ts`
- [Watch Progress](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/lib/watchProgress.ts): `src/lib/watchProgress.ts`
- [My Media](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/me/page.tsx): `src/app/me/page.tsx`

### Account & App

- [Auth Pages](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/auth/page.tsx): `src/app/auth/page.tsx`
- [Auth Callback](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/auth/callback/route.ts): `src/app/auth/callback/route.ts`
- [App Layout](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/app/layout.tsx): `src/app/layout.tsx`
- [Service Worker Setup](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/src/components/ServiceWorkerRegister.tsx): `src/components/ServiceWorkerRegister.tsx`
- [Service Worker](https://github.com/sushilbarman953-eng/spectra-stream/blob/main/public/sw.js): `public/sw.js`

### Other components

- **Viewer**
- **TMDB Service**
- **Supabase Auth**
- **Media Source**
- **IPTV Source**

## Connections

- Viewer → Home: opens
- Viewer → Browse Pages: browses
- Viewer → Search UI: searches
- Viewer → Media Details: views details
- Viewer → Watch Page: watches
- Viewer → Auth Pages: signs in
- Viewer → My Media: views library
- Viewer → Downloads Page: views downloads
- Search API → TMDB Service: queries
- Discover API → TMDB Client: calls
- TMDB Client → TMDB Service: queries
- Auth Callback → Supabase Auth: exchanges code
- Download Proxy → Media Source: fetches media
- IPTV Proxy → IPTV Source: fetches stream
- Service Worker Setup → Service Worker: registers
