How mitthui2k5/cobalt works
Project type and purpose
• This is a full-stack monorepo for “cobalt,” a friendly media-downloader service.
• It consists of three logical units:
• An API backend (Node.js) under /api that handles link processing, streaming, security and rate-limiting.
• A SvelteKit frontend under /web that provides the user interface in the browser.
• Shared libraries and tooling in /packages, plus documentation in /docs.
File structure (top-level)
• Dockerfile, CI configs and workspace files define the build and deploy environment.
• /api – a modular Node.js service:
• src/core (entrypoint, environment, tunnel)
• src/processing (URL matching, service-specific adapters)
• src/stream (internal/external HLS, stream management)
• src/security (API keys, JWT, Turnstile anti-bot)
• src/store (in-memory or Redis back-ends for sessions & rate limits)
• /web – a SvelteKit app:
• src/routes (page & API routes)
• src/lib (API client, state management, task-manager, storage)
• src/components (UI building blocks)
• /packages – reusable npm modules (e.g., API client, version-info).
README for additional insights
• Describes “cobalt” as a proxy-like downloader that never caches content permanently.
• References environment variables and deployment docs.
• Points to Docker and CI flows for “run-an-instance” and “protect-an-instance.”
Essential details
• Ffmpeg worker pool under stream processing.
• Don’t over-compartmentalize; show modules only if they represent distinct runtime components.