# sumroc-coder/lampac architecture

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

- Interactive diagram: https://gitdiagram.com/sumroc-coder/lampac
- Repository: https://github.com/sumroc-coder/lampac

## Overview

Lampac NextGen is a self-hosted ASP.NET Core backend for the Lampa media application. Its principal flow is a Lampa request to provider/API modules, which gather or resolve content and return JSON or plugin-compatible results. The repository also documents torrent discovery, media serving, and account/device features. The README supports the product-level relationships shown here; source excerpts are incomplete, so internal calls between unsampled subsystems are not inferred.

Main entry points: [`Online/OnlineApi.cs`](https://github.com/sumroc-coder/lampac/blob/main/Online/OnlineApi.cs) (Online API), [`Core/Controllers/ApiController.cs`](https://github.com/sumroc-coder/lampac/blob/main/Core/Controllers/ApiController.cs) (JSON API), [`Shared/Controllers/BaseOnlineController.cs`](https://github.com/sumroc-coder/lampac/blob/main/Shared/Controllers/BaseOnlineController.cs) (Online controller base), [`Modules/OnlineRUS`](https://github.com/sumroc-coder/lampac/tree/main/Modules/OnlineRUS) (VOD providers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Client and API"]
  node_api["JSON API<br/>[ApiController.cs]"]
  node_lampaweb["Lampa UI hosting<br/>[ApiController.cs]"]
end

subgraph group_content["Content discovery"]
  node_catalog["Catalog browsing<br/>[ListController.cs]"]
  node_online["Online API<br/>[OnlineApi.cs]"]
  node_providers["VOD providers"]
  node_anime["Anime providers"]
  node_adult["Adult providers"]
  node_jacred["Torrent indexers<br/>[ApiController.cs]"]
end

subgraph group_media["Media services"]
  node_torrserver["TorrServer<br/>[Controller.cs]"]
  node_dlna["DLNA server<br/>[Controller.cs]"]
  node_transcoding["Transcoding"]
  node_tracks["Tracks and subtitles<br/>[Controller.cs]"]
  node_tmdb["TMDB cache<br/>[Controller.cs]"]
end

subgraph group_accounts["Sync and community"]
  node_sync["Bookmarks and history<br/>[SyncController.cs]"]
  node_timecode["Playback positions<br/>[Controller.cs]"]
  node_syncdb[("Sync database<br/>[SqlContext.cs]")]
  node_telegram["Telegram auth"]
end

subgraph group_runtime["Core runtime"]
  node_coreinit["Configuration and modules<br/>[CoreInit.cs]"]
  node_middleware["Request middleware<br/>[Staticache.cs]"]
  node_basecontroller["Controller base<br/>[BaseController.cs]"]
  node_onlinebase["Online controller base"]
  node_http["HTTP client<br/>[Http.cs]"]
  node_proxy["Proxy manager<br/>[ProxyManager.cs]"]
  node_rch["RCH relay client<br/>[RchClient.cs]"]
  node_proxylink["Media proxy links<br/>[ProxyLink.cs]"]
  node_playwright["Browser automation"]
end

node_lampa(("Lampa client"))

node_lampa -->|"requests content"| node_api
node_lampa -->|"loads UI"| node_lampaweb
node_api -.->|"browses catalog"| node_catalog
node_api -.->|"requests sources"| node_online
node_online -.->|"resolves titles"| node_providers
node_online -.->|"resolves titles"| node_anime
node_online -.->|"resolves titles"| node_adult
node_lampa -->|"searches torrents"| node_jacred
node_lampa -->|"plays torrents"| node_torrserver
node_lampa -->|"discovers media"| node_dlna
node_lampa -->|"requests streams"| node_transcoding
node_lampa -->|"manages tracks"| node_tracks
node_lampa -->|"requests metadata"| node_tmdb
node_lampa -->|"syncs bookmarks"| node_sync
node_sync -->|"stores state"| node_syncdb
node_lampa -->|"saves position"| node_timecode
node_lampa -.->|"authenticates account"| node_telegram
node_coreinit -.->|"configures runtime"| node_middleware
node_api -.->|"uses base behavior"| node_basecontroller
node_online -.->|"uses online base"| node_onlinebase
node_onlinebase -->|"selects proxy"| node_proxy
node_onlinebase -->|"creates relay client"| node_rch
node_providers -.->|"fetches source data"| node_http
node_onlinebase -.->|"generates proxy links"| node_proxylink
node_providers -.->|"uses browser automation"| node_playwright

click node_api "https://github.com/sumroc-coder/lampac/blob/main/Core/Controllers/ApiController.cs"
click node_lampaweb "https://github.com/sumroc-coder/lampac/blob/main/Modules/LampaWeb/Controllers/ApiController.cs"
click node_catalog "https://github.com/sumroc-coder/lampac/blob/main/Modules/Catalog/Controllers/ListController.cs"
click node_online "https://github.com/sumroc-coder/lampac/blob/main/Online/OnlineApi.cs"
click node_providers "https://github.com/sumroc-coder/lampac/tree/main/Modules/OnlineRUS"
click node_anime "https://github.com/sumroc-coder/lampac/tree/main/Modules/OnlineAnime"
click node_adult "https://github.com/sumroc-coder/lampac/tree/main/Modules/Adult"
click node_jacred "https://github.com/sumroc-coder/lampac/blob/main/Modules/JacRed/ApiController.cs"
click node_torrserver "https://github.com/sumroc-coder/lampac/blob/main/Modules/TorrServer/Controller.cs"
click node_dlna "https://github.com/sumroc-coder/lampac/blob/main/Modules/DLNA/Controller.cs"
click node_transcoding "https://github.com/sumroc-coder/lampac/blob/main/Modules/Transcoding/Services/TranscodingService.cs"
click node_tracks "https://github.com/sumroc-coder/lampac/blob/main/Modules/Tracks/Controller.cs"
click node_tmdb "https://github.com/sumroc-coder/lampac/blob/main/Modules/Proxy/TmdbProxy/Controller.cs"
click node_sync "https://github.com/sumroc-coder/lampac/blob/main/Modules/Sync/Sync/Controllers/SyncController.cs"
click node_timecode "https://github.com/sumroc-coder/lampac/blob/main/Modules/Sync/TimeCode/Controller.cs"
click node_syncdb "https://github.com/sumroc-coder/lampac/blob/main/Modules/Sync/Sync/SqlContext.cs"
click node_telegram "https://github.com/sumroc-coder/lampac/blob/main/Modules/Community/TelegramAuth/Controllers/TelegramAuthController.cs"
click node_coreinit "https://github.com/sumroc-coder/lampac/blob/main/Shared/CoreInit.cs"
click node_middleware "https://github.com/sumroc-coder/lampac/blob/main/Core/Middlewares/Staticache.cs"
click node_basecontroller "https://github.com/sumroc-coder/lampac/blob/main/Shared/Controllers/BaseController.cs"
click node_onlinebase "https://github.com/sumroc-coder/lampac/blob/main/Shared/Controllers/BaseOnlineController.cs"
click node_http "https://github.com/sumroc-coder/lampac/blob/main/Shared/Services/HTTP/Http.cs"
click node_proxy "https://github.com/sumroc-coder/lampac/blob/main/Shared/Services/ProxyManager.cs"
click node_rch "https://github.com/sumroc-coder/lampac/blob/main/Shared/Services/HTTP/RchClient.cs"
click node_proxylink "https://github.com/sumroc-coder/lampac/blob/main/Shared/Services/ProxyLink.cs"

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_api,node_lampaweb,node_lampa toneBlue
class node_catalog,node_online,node_providers,node_anime,node_adult,node_jacred toneAmber
class node_torrserver,node_dlna,node_transcoding,node_tracks,node_tmdb toneMint
class node_sync,node_timecode,node_syncdb,node_telegram toneRose
class node_coreinit,node_middleware,node_basecontroller,node_onlinebase,node_http,node_proxy,node_rch,node_proxylink,node_playwright toneIndigo
```

## Components

### Client and API

- [JSON API](https://github.com/sumroc-coder/lampac/blob/main/Core/Controllers/ApiController.cs): `Core/Controllers/ApiController.cs`
- [Lampa UI hosting](https://github.com/sumroc-coder/lampac/blob/main/Modules/LampaWeb/Controllers/ApiController.cs): `Modules/LampaWeb/Controllers/ApiController.cs`

### Content discovery

- [Catalog browsing](https://github.com/sumroc-coder/lampac/blob/main/Modules/Catalog/Controllers/ListController.cs): `Modules/Catalog/Controllers/ListController.cs`
- [Online API](https://github.com/sumroc-coder/lampac/blob/main/Online/OnlineApi.cs): `Online/OnlineApi.cs`
- [VOD providers](https://github.com/sumroc-coder/lampac/tree/main/Modules/OnlineRUS): `Modules/OnlineRUS`
- [Anime providers](https://github.com/sumroc-coder/lampac/tree/main/Modules/OnlineAnime): `Modules/OnlineAnime`
- [Adult providers](https://github.com/sumroc-coder/lampac/tree/main/Modules/Adult): `Modules/Adult`
- [Torrent indexers](https://github.com/sumroc-coder/lampac/blob/main/Modules/JacRed/ApiController.cs): `Modules/JacRed/ApiController.cs`

### Media services

- [TorrServer](https://github.com/sumroc-coder/lampac/blob/main/Modules/TorrServer/Controller.cs): `Modules/TorrServer/Controller.cs`
- [DLNA server](https://github.com/sumroc-coder/lampac/blob/main/Modules/DLNA/Controller.cs): `Modules/DLNA/Controller.cs`
- [Transcoding](https://github.com/sumroc-coder/lampac/blob/main/Modules/Transcoding/Services/TranscodingService.cs): `Modules/Transcoding/Services/TranscodingService.cs`
- [Tracks and subtitles](https://github.com/sumroc-coder/lampac/blob/main/Modules/Tracks/Controller.cs): `Modules/Tracks/Controller.cs`
- [TMDB cache](https://github.com/sumroc-coder/lampac/blob/main/Modules/Proxy/TmdbProxy/Controller.cs): `Modules/Proxy/TmdbProxy/Controller.cs`

### Sync and community

- [Bookmarks and history](https://github.com/sumroc-coder/lampac/blob/main/Modules/Sync/Sync/Controllers/SyncController.cs): `Modules/Sync/Sync/Controllers/SyncController.cs`
- [Playback positions](https://github.com/sumroc-coder/lampac/blob/main/Modules/Sync/TimeCode/Controller.cs): `Modules/Sync/TimeCode/Controller.cs`
- [Sync database](https://github.com/sumroc-coder/lampac/blob/main/Modules/Sync/Sync/SqlContext.cs): `Modules/Sync/Sync/SqlContext.cs`
- [Telegram auth](https://github.com/sumroc-coder/lampac/blob/main/Modules/Community/TelegramAuth/Controllers/TelegramAuthController.cs): `Modules/Community/TelegramAuth/Controllers/TelegramAuthController.cs`

### Core runtime

- [Configuration and modules](https://github.com/sumroc-coder/lampac/blob/main/Shared/CoreInit.cs): `Shared/CoreInit.cs`
- [Request middleware](https://github.com/sumroc-coder/lampac/blob/main/Core/Middlewares/Staticache.cs): `Core/Middlewares/Staticache.cs`
- [Controller base](https://github.com/sumroc-coder/lampac/blob/main/Shared/Controllers/BaseController.cs): `Shared/Controllers/BaseController.cs`
- [Online controller base](https://github.com/sumroc-coder/lampac/blob/main/Shared/Controllers/BaseOnlineController.cs): `Shared/Controllers/BaseOnlineController.cs`
- [HTTP client](https://github.com/sumroc-coder/lampac/blob/main/Shared/Services/HTTP/Http.cs): `Shared/Services/HTTP/Http.cs`
- [Proxy manager](https://github.com/sumroc-coder/lampac/blob/main/Shared/Services/ProxyManager.cs): `Shared/Services/ProxyManager.cs`
- [RCH relay client](https://github.com/sumroc-coder/lampac/blob/main/Shared/Services/HTTP/RchClient.cs): `Shared/Services/HTTP/RchClient.cs`
- [Media proxy links](https://github.com/sumroc-coder/lampac/blob/main/Shared/Services/ProxyLink.cs): `Shared/Services/ProxyLink.cs`
- **Browser automation**

### Other components

- **Lampa client**

## Connections

- Lampa client → JSON API: requests content (evidence: `README.md`)
- Lampa client → Lampa UI hosting: loads UI (evidence: `README.md`)
- JSON API → Catalog browsing: browses catalog
- JSON API → Online API: requests sources
- Online API → VOD providers: resolves titles
- Online API → Anime providers: resolves titles
- Online API → Adult providers: resolves titles
- Lampa client → Torrent indexers: searches torrents (evidence: `README.md`)
- Lampa client → TorrServer: plays torrents (evidence: `README.md`)
- Lampa client → DLNA server: discovers media (evidence: `README.md`)
- Lampa client → Transcoding: requests streams (evidence: `README.md`)
- Lampa client → Tracks and subtitles: manages tracks (evidence: `README.md`)
- Lampa client → TMDB cache: requests metadata (evidence: `README.md`)
- Lampa client → Bookmarks and history: syncs bookmarks (evidence: `README.md`)
- Bookmarks and history → Sync database: stores state (evidence: `README.md`)
- Lampa client → Playback positions: saves position (evidence: `README.md`)
- Lampa client → Telegram auth: authenticates account
- Configuration and modules → Request middleware: configures runtime (evidence: `Shared/CoreInit.cs`)
- JSON API → Controller base: uses base behavior
- Online API → Online controller base: uses online base
- Online controller base → Proxy manager: selects proxy (evidence: `Shared/Controllers/BaseOnlineController.cs`)
- Online controller base → RCH relay client: creates relay client (evidence: `Shared/Controllers/BaseOnlineController.cs`)
- VOD providers → HTTP client: fetches source data (evidence: `Modules/OnlineRUS/Zetflix/Controller.cs`)
- Online controller base → Media proxy links: generates proxy links
- VOD providers → Browser automation: uses browser automation
