How yatichbrian99-svg/torrent-cdn works
TorrentCDN delivers uploaded video through browser-based WebTorrent peers, with origin fallback, and also offers live streaming and a separate decentralized-inference product. The graph preserves those product branches and the shared account/API layer. Relationship evidence is limited to the README and the supplied source excerpts and index; unsampled subsystems are included where the README documents them, but uncertain internal links are omitted.
Main entry points: service.py AI coordinator · sdk.js Embed SDK · upload.py Upload workflow · auth.py Authentication routes
Components 27
Video Delivery
- Upload interface
frontend/components/UploadForm.tsx - Upload workflow
backend/app/routes/upload.py - Object storage
- Magnet generation
backend/app/torrent_builder.py - Embed SDK
frontend/public/sdk.js - Video player
frontend/components/VideoPlayer.tsx
Live Streaming
- Channel interface
frontend/app/live/channels/page.tsx - Live channel API
backend/app/routes/live.py - Stream ingest
- MediaMTX
- Live P2P delivery
frontend/lib/live/segments.ts - Live player
frontend/components/LivePlayer.tsx
Platform Accounts
- Account interface
frontend/components/AuthModal.tsx - Authentication routes
backend/app/routes/auth.py - Session authentication
backend/app/auth.py - Platform database
backend/app/database.py - API application
backend/app/main.py
TCDN-AI
- AI console routes
backend/app/ai/routes_console.py - Inference API
backend/app/ai/routes.py - OpenAI-compatible API
backend/app/ai/routes_openai.py - AI coordinator
backend/app/ai/service.py - AI state and ledger
backend/app/ai/store.py - Rented GPU workers
backend/app/ai/worker.py - Inference SDK
backend/tcdn_ai_sdk/client.py - AI console UI
frontend/lib/aiConsole.ts
Other components
- Content creator
- Video viewer
Connections 26
- Content creator → Upload interface: submits video
- Upload interface → Upload workflow: sends upload
- Upload workflow → Object storage: stores media
- Upload workflow → Magnet generation: builds magnet
backend/app/routes/upload.py - Video viewer → Embed SDK: opens embed
- Embed SDK → Object storage: fetches media
- Embed SDK → Video player: delivers playback
- Embed SDK → Video viewer: shares bytes
- Content creator → Channel interface: manages channel
- Channel interface → Live channel API: configures channel
- Stream ingest → MediaMTX: sends RTMP
- MediaMTX → Live P2P delivery: outputs HLS
- Live P2P delivery → Live player: serves segments
- Live player → Video viewer: plays stream
- Account interface → Authentication routes: authenticates
- Authentication routes → Session authentication: uses sessions
backend/app/routes/auth.py - Authentication routes → Platform database: reads and writes
backend/app/routes/auth.py - API application → Authentication routes: mounts routes
backend/app/main.py - API application → Upload workflow: mounts routes
backend/app/main.py - AI console UI → AI console routes: calls console API
- AI console routes → AI coordinator: delegates operations
backend/app/ai/routes_console.py - Inference API → AI coordinator: delegates requests
backend/app/ai/routes.py - OpenAI-compatible API → AI coordinator: delegates requests
backend/app/ai/routes_openai.py - AI coordinator → AI state and ledger: reads and writes
backend/app/ai/service.py - Inference SDK → OpenAI-compatible API: sends inference requests
- AI coordinator → Rented GPU workers: dispatches jobs