# hummax/driveconnector architecture

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

- Interactive diagram: https://gitdiagram.com/hummax/driveconnector
- Repository: https://github.com/hummax/driveconnector
- Video tour (about a minute): https://gitdiagram.com/hummax/driveconnector/video

## Overview

Cloud Cinema is a private media server with web and Android clients. Users sign in or connect a server, browse local and Google Drive libraries or discover releases, then stream, download, or manage media; the backend catalogs, enriches, transfers, and serves playback. The graph includes the documented subtitles, playlists, admin, and mobile browser/download capabilities. Source excerpts and the index support the shown links; some runtime wiring is documented only in the README, so uncertain implementation-level links are omitted.

Main entry points: [`backend/routes/media.py`](https://github.com/hummax/driveconnector/blob/main/backend/routes/media.py) (Media routes), [`backend/app.py`](https://github.com/hummax/driveconnector/blob/main/backend/app.py) (API application), [`frontend/src/App.tsx`](https://github.com/hummax/driveconnector/blob/main/frontend/src/App.tsx) (Web experience), [`mobile/src/App.tsx`](https://github.com/hummax/driveconnector/blob/main/mobile/src/App.tsx) (Android app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Client apps"]
  node_web["Web experience<br/>[App.tsx]"]
  node_webapi["Web API client<br/>[client.ts]"]
  node_webplayer["Web player"]
  node_weblibrary["Library and discovery<br/>[MediaLibrary.tsx]"]
  node_webadmin["Admin console<br/>[AdminConsole.tsx]"]
  node_mobile["Android app<br/>[App.tsx]"]
  node_mobcinema["Cinema and player<br/>[CinemaScreen.tsx]"]
  node_mobdiscover["Mobile discovery<br/>[DiscoverScreen.tsx]"]
  node_mobbrowser["Browser and sniffer<br/>[BrowserScreen.tsx]"]
  node_mobdownloads["Phone downloads<br/>[downloadManager.ts]"]
  node_mobapi["Mobile API client<br/>[api.ts]"]
end

subgraph group_api["Backend API"]
  node_auth["Authentication<br/>[auth.py]"]
  node_routes["API application<br/>[app.py]"]
  node_media_routes["Media routes<br/>[media.py]"]
  node_discover_routes["Discover routes<br/>[discover.py]"]
  node_sessions["Client sessions<br/>[client_sessions.py]"]
  node_drive_sync["Drive sync<br/>[sync.py]"]
  node_playlists["Playlists<br/>[playlists.py]"]
end

subgraph group_media["Media workflows"]
  node_catalog["Media catalog<br/>[drive_catalog.py]"]
  node_enrichment["Metadata enrichment"]
  node_streaming["Stream delivery<br/>[streaming.py]"]
  node_hls["HLS sessions<br/>[hls_manager.py]"]
  node_downloader["Media transfers<br/>[downloader.py]"]
  node_transcode["Transcoding worker<br/>[ffmpeg_worker.py]"]
  node_torrent["Torrent discovery<br/>[torrent_client.py]"]
  node_metadata["Metadata lookup<br/>[metadata.py]"]
end

subgraph group_platform["State and integrations"]
  node_store[("Repository storage<br/>[database.py]")]
  node_providers["Media providers<br/>[base.py]"]
  node_gdrive["Google Drive provider<br/>[gdrive.py]"]
  node_local["Local provider<br/>[local.py]"]
  node_config["Runtime settings<br/>[config.py]"]
end

node_viewer(("Viewer"))

node_viewer -->|"uses web app"| node_web
node_web -->|"requests data"| node_webapi
node_web -->|"renders library"| node_weblibrary
node_web -.->|"opens playback"| node_webplayer
node_web -.->|"renders admin"| node_webadmin
node_webapi -->|"calls API"| node_routes
node_viewer -->|"uses Android app"| node_mobile
node_mobile -->|"shows cinema"| node_mobcinema
node_mobile -->|"shows discovery"| node_mobdiscover
node_mobile -->|"shows browser"| node_mobbrowser
node_mobile -->|"manages downloads"| node_mobdownloads
node_mobcinema -->|"requests media"| node_mobapi
node_mobapi -->|"calls API"| node_routes
node_routes -->|"checks identity"| node_auth
node_routes -->|"registers routes"| node_media_routes
node_routes -->|"registers routes"| node_discover_routes
node_routes -->|"registers routes"| node_sessions
node_routes -->|"registers routes"| node_drive_sync
node_routes -->|"registers routes"| node_playlists
node_media_routes -->|"reads and writes"| node_store
node_media_routes -->|"starts transfers"| node_downloader
node_media_routes -->|"serves streams"| node_streaming
node_media_routes -->|"controls HLS"| node_hls
node_media_routes -->|"enriches records"| node_enrichment
node_media_routes -->|"uses Drive source"| node_gdrive
node_media_routes -->|"uses local source"| node_local
node_discover_routes -->|"fetches candidates"| node_torrent
node_discover_routes -->|"queues releases"| node_downloader
node_discover_routes -->|"reads and writes"| node_store
node_discover_routes -->|"enriches ready media"| node_enrichment
node_catalog -->|"indexes media"| node_store
node_catalog -->|"uses Drive provider"| node_gdrive
node_catalog -->|"requests enrichment"| node_enrichment
node_gdrive -->|"implements provider"| node_providers
node_local -->|"implements provider"| node_providers
node_drive_sync -.->|"syncs library"| node_catalog
node_enrichment -.->|"looks up metadata"| node_metadata
node_downloader -->|"updates transfers"| node_store
node_downloader -->|"uses worker"| node_transcode
node_downloader -->|"uses catalog"| node_catalog
node_config -->|"configures storage"| node_store
node_viewer -->|"streams and downloads"| node_webplayer

click node_web "https://github.com/hummax/driveconnector/blob/main/frontend/src/App.tsx"
click node_webapi "https://github.com/hummax/driveconnector/blob/main/frontend/src/api/client.ts"
click node_webplayer "https://github.com/hummax/driveconnector/blob/main/frontend/src/components/VideoPlayerModal.tsx"
click node_weblibrary "https://github.com/hummax/driveconnector/blob/main/frontend/src/components/MediaLibrary.tsx"
click node_webadmin "https://github.com/hummax/driveconnector/blob/main/frontend/src/components/AdminConsole.tsx"
click node_mobile "https://github.com/hummax/driveconnector/blob/main/mobile/src/App.tsx"
click node_mobcinema "https://github.com/hummax/driveconnector/blob/main/mobile/src/screens/CinemaScreen.tsx"
click node_mobdiscover "https://github.com/hummax/driveconnector/blob/main/mobile/src/screens/DiscoverScreen.tsx"
click node_mobbrowser "https://github.com/hummax/driveconnector/blob/main/mobile/src/screens/BrowserScreen.tsx"
click node_mobdownloads "https://github.com/hummax/driveconnector/blob/main/mobile/src/services/downloadManager.ts"
click node_mobapi "https://github.com/hummax/driveconnector/blob/main/mobile/src/services/api.ts"
click node_auth "https://github.com/hummax/driveconnector/blob/main/backend/auth.py"
click node_routes "https://github.com/hummax/driveconnector/blob/main/backend/app.py"
click node_media_routes "https://github.com/hummax/driveconnector/blob/main/backend/routes/media.py"
click node_discover_routes "https://github.com/hummax/driveconnector/blob/main/backend/routes/discover.py"
click node_sessions "https://github.com/hummax/driveconnector/blob/main/backend/routes/client_sessions.py"
click node_drive_sync "https://github.com/hummax/driveconnector/blob/main/backend/routes/sync.py"
click node_playlists "https://github.com/hummax/driveconnector/blob/main/backend/routes/playlists.py"
click node_catalog "https://github.com/hummax/driveconnector/blob/main/backend/drive_catalog.py"
click node_enrichment "https://github.com/hummax/driveconnector/blob/main/backend/media_enrichment.py"
click node_streaming "https://github.com/hummax/driveconnector/blob/main/backend/streaming.py"
click node_hls "https://github.com/hummax/driveconnector/blob/main/backend/hls_manager.py"
click node_downloader "https://github.com/hummax/driveconnector/blob/main/backend/downloader.py"
click node_transcode "https://github.com/hummax/driveconnector/blob/main/backend/ffmpeg_worker.py"
click node_torrent "https://github.com/hummax/driveconnector/blob/main/backend/torrent_client.py"
click node_metadata "https://github.com/hummax/driveconnector/blob/main/backend/metadata.py"
click node_store "https://github.com/hummax/driveconnector/blob/main/backend/database.py"
click node_providers "https://github.com/hummax/driveconnector/blob/main/backend/providers/base.py"
click node_gdrive "https://github.com/hummax/driveconnector/blob/main/backend/providers/gdrive.py"
click node_local "https://github.com/hummax/driveconnector/blob/main/backend/providers/local.py"
click node_config "https://github.com/hummax/driveconnector/blob/main/backend/config.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_web,node_webapi,node_webplayer,node_weblibrary,node_webadmin,node_mobile,node_mobcinema,node_mobdiscover,node_mobbrowser,node_mobdownloads,node_mobapi,node_viewer toneBlue
class node_auth,node_routes,node_media_routes,node_discover_routes,node_sessions,node_drive_sync,node_playlists toneAmber
class node_catalog,node_enrichment,node_streaming,node_hls,node_downloader,node_transcode,node_torrent,node_metadata toneMint
class node_store,node_providers,node_gdrive,node_local,node_config toneRose
```

## Components

### Client apps

- [Web experience](https://github.com/hummax/driveconnector/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Web API client](https://github.com/hummax/driveconnector/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Web player](https://github.com/hummax/driveconnector/blob/main/frontend/src/components/VideoPlayerModal.tsx): `frontend/src/components/VideoPlayerModal.tsx`
- [Library and discovery](https://github.com/hummax/driveconnector/blob/main/frontend/src/components/MediaLibrary.tsx): `frontend/src/components/MediaLibrary.tsx`
- [Admin console](https://github.com/hummax/driveconnector/blob/main/frontend/src/components/AdminConsole.tsx): `frontend/src/components/AdminConsole.tsx`
- [Android app](https://github.com/hummax/driveconnector/blob/main/mobile/src/App.tsx): `mobile/src/App.tsx`
- [Cinema and player](https://github.com/hummax/driveconnector/blob/main/mobile/src/screens/CinemaScreen.tsx): `mobile/src/screens/CinemaScreen.tsx`
- [Mobile discovery](https://github.com/hummax/driveconnector/blob/main/mobile/src/screens/DiscoverScreen.tsx): `mobile/src/screens/DiscoverScreen.tsx`
- [Browser and sniffer](https://github.com/hummax/driveconnector/blob/main/mobile/src/screens/BrowserScreen.tsx): `mobile/src/screens/BrowserScreen.tsx`
- [Phone downloads](https://github.com/hummax/driveconnector/blob/main/mobile/src/services/downloadManager.ts): `mobile/src/services/downloadManager.ts`
- [Mobile API client](https://github.com/hummax/driveconnector/blob/main/mobile/src/services/api.ts): `mobile/src/services/api.ts`

### Backend API

- [Authentication](https://github.com/hummax/driveconnector/blob/main/backend/auth.py): `backend/auth.py`
- [API application](https://github.com/hummax/driveconnector/blob/main/backend/app.py): `backend/app.py`
- [Media routes](https://github.com/hummax/driveconnector/blob/main/backend/routes/media.py): `backend/routes/media.py`
- [Discover routes](https://github.com/hummax/driveconnector/blob/main/backend/routes/discover.py): `backend/routes/discover.py`
- [Client sessions](https://github.com/hummax/driveconnector/blob/main/backend/routes/client_sessions.py): `backend/routes/client_sessions.py`
- [Drive sync](https://github.com/hummax/driveconnector/blob/main/backend/routes/sync.py): `backend/routes/sync.py`
- [Playlists](https://github.com/hummax/driveconnector/blob/main/backend/routes/playlists.py): `backend/routes/playlists.py`

### Media workflows

- [Media catalog](https://github.com/hummax/driveconnector/blob/main/backend/drive_catalog.py): `backend/drive_catalog.py`
- [Metadata enrichment](https://github.com/hummax/driveconnector/blob/main/backend/media_enrichment.py): `backend/media_enrichment.py`
- [Stream delivery](https://github.com/hummax/driveconnector/blob/main/backend/streaming.py): `backend/streaming.py`
- [HLS sessions](https://github.com/hummax/driveconnector/blob/main/backend/hls_manager.py): `backend/hls_manager.py`
- [Media transfers](https://github.com/hummax/driveconnector/blob/main/backend/downloader.py): `backend/downloader.py`
- [Transcoding worker](https://github.com/hummax/driveconnector/blob/main/backend/ffmpeg_worker.py): `backend/ffmpeg_worker.py`
- [Torrent discovery](https://github.com/hummax/driveconnector/blob/main/backend/torrent_client.py): `backend/torrent_client.py`
- [Metadata lookup](https://github.com/hummax/driveconnector/blob/main/backend/metadata.py): `backend/metadata.py`

### State and integrations

- [Repository storage](https://github.com/hummax/driveconnector/blob/main/backend/database.py): `backend/database.py`
- [Media providers](https://github.com/hummax/driveconnector/blob/main/backend/providers/base.py): `backend/providers/base.py`
- [Google Drive provider](https://github.com/hummax/driveconnector/blob/main/backend/providers/gdrive.py): `backend/providers/gdrive.py`
- [Local provider](https://github.com/hummax/driveconnector/blob/main/backend/providers/local.py): `backend/providers/local.py`
- [Runtime settings](https://github.com/hummax/driveconnector/blob/main/backend/config.py): `backend/config.py`

### Other components

- **Viewer**

## Connections

- Viewer → Web experience: uses web app (evidence: `README.md`)
- Web experience → Web API client: requests data (evidence: `frontend/src/App.tsx`)
- Web experience → Library and discovery: renders library (evidence: `frontend/src/App.tsx`)
- Web experience → Web player: opens playback (evidence: `frontend/src/App.tsx`)
- Web experience → Admin console: renders admin (evidence: `frontend/src/App.tsx`)
- Web API client → API application: calls API (evidence: `README.md`)
- Viewer → Android app: uses Android app (evidence: `README.md`)
- Android app → Cinema and player: shows cinema (evidence: `mobile/src/App.tsx`)
- Android app → Mobile discovery: shows discovery (evidence: `mobile/src/App.tsx`)
- Android app → Browser and sniffer: shows browser (evidence: `mobile/src/App.tsx`)
- Android app → Phone downloads: manages downloads (evidence: `mobile/src/App.tsx`)
- Cinema and player → Mobile API client: requests media (evidence: `mobile/src/screens/CinemaScreen.tsx`)
- Mobile API client → API application: calls API (evidence: `README.md`)
- API application → Authentication: checks identity (evidence: `backend/app.py`)
- API application → Media routes: registers routes (evidence: `backend/app.py`)
- API application → Discover routes: registers routes (evidence: `backend/app.py`)
- API application → Client sessions: registers routes (evidence: `backend/app.py`)
- API application → Drive sync: registers routes (evidence: `backend/app.py`)
- API application → Playlists: registers routes (evidence: `backend/app.py`)
- Media routes → Repository storage: reads and writes (evidence: `backend/routes/media.py`)
- Media routes → Media transfers: starts transfers (evidence: `backend/routes/media.py`)
- Media routes → Stream delivery: serves streams (evidence: `backend/routes/media.py`)
- Media routes → HLS sessions: controls HLS (evidence: `backend/routes/media.py`)
- Media routes → Metadata enrichment: enriches records (evidence: `backend/routes/media.py`)
- Media routes → Google Drive provider: uses Drive source (evidence: `backend/routes/media.py`)
- Media routes → Local provider: uses local source (evidence: `backend/routes/media.py`)
- Discover routes → Torrent discovery: fetches candidates (evidence: `backend/routes/discover.py`)
- Discover routes → Media transfers: queues releases (evidence: `backend/routes/discover.py`)
- Discover routes → Repository storage: reads and writes (evidence: `backend/routes/discover.py`)
- Discover routes → Metadata enrichment: enriches ready media (evidence: `backend/routes/discover.py`)
- Media catalog → Repository storage: indexes media (evidence: `backend/drive_catalog.py`)
- Media catalog → Google Drive provider: uses Drive provider (evidence: `backend/drive_catalog.py`)
- Media catalog → Metadata enrichment: requests enrichment (evidence: `backend/drive_catalog.py`)
- Google Drive provider → Media providers: implements provider (evidence: `backend/providers/gdrive.py`)
- Local provider → Media providers: implements provider (evidence: `backend/providers/local.py`)
- Drive sync → Media catalog: syncs library
- Metadata enrichment → Metadata lookup: looks up metadata
- Media transfers → Repository storage: updates transfers (evidence: `backend/downloader.py`)
- Media transfers → Transcoding worker: uses worker (evidence: `backend/downloader.py`)
- Media transfers → Media catalog: uses catalog (evidence: `backend/downloader.py`)
- Runtime settings → Repository storage: configures storage (evidence: `backend/database.py`)
- Viewer → Web player: streams and downloads (evidence: `README.md`)
