# abhi-dhakar/download24 architecture

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

- Interactive diagram: https://gitdiagram.com/abhi-dhakar/download24
- Repository: https://github.com/abhi-dhakar/download24

## Overview

Download24 is a Next.js video-downloader application. A visitor submits a media link, gets extraction results and quality options, then streams the selected file through a guided download flow. yt-dlp handles supported platforms; TeraBox has a native share-resolution path. The public site also provides platform and help pages, while a token-gated admin dashboard exposes PostHog analytics. README documentation establishes the overall flow and major capabilities; source excerpts confirm selected route and helper calls, so some connections are documented rather than verified in full source.

Main entry points: [`app/api/parse/route.ts`](https://github.com/abhi-dhakar/download24/blob/main/app/api/parse/route.ts) (Parse route), [`app/api/download/route.ts`](https://github.com/abhi-dhakar/download24/blob/main/app/api/download/route.ts) (Download route), [`components/Downloader.tsx`](https://github.com/abhi-dhakar/download24/blob/main/components/Downloader.tsx) (Link input), [`lib/ytdlp.ts`](https://github.com/abhi-dhakar/download24/blob/main/lib/ytdlp.ts) (yt-dlp adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public experience"]
  node_home["Landing page<br/>[page.tsx]"]
  node_platform_pages["Platform pages<br/>[page.tsx]"]
  node_site_guides["Guides and FAQ<br/>[page.tsx]"]
  node_platform_catalog["Platform catalog<br/>[platforms.ts]"]
  node_downloader_input["Link input<br/>[Downloader.tsx]"]
  node_parse_ui["Quality selection"]
  node_progress_ui["Download progress<br/>[DownloadFlow.tsx]"]
end

subgraph group_download["Download pipeline"]
  node_parse_api["Parse route<br/>[route.ts]"]
  node_download_api["Download route<br/>[route.ts]"]
  node_progress_api["Progress route<br/>[route.ts]"]
  node_format_builder["Format triage<br/>[formats.ts]"]
  node_ytdlp["yt-dlp adapter<br/>[ytdlp.ts]"]
  node_terabox["TeraBox resolver<br/>[terabox.ts]"]
  node_parse_cache[("Parse cache<br/>[cache.ts]")]
  node_live_jobs[("Live job state<br/>[liveJobs.ts]")]
end

subgraph group_operations["Analytics and admin"]
  node_analytics_client["Browser analytics"]
  node_analytics_server["Server analytics<br/>[posthogServer.ts]"]
  node_admin_ui["Admin dashboard<br/>[page.tsx]"]
  node_admin_auth["Admin authentication<br/>[adminAuth.ts]"]
  node_posthog_api["PostHog API client<br/>[posthogApi.ts]"]
  node_hogql_route["HogQL route<br/>[route.ts]"]
end

node_visitor(("Visitor"))
node_media_platforms(("Media platforms"))
node_cdn(("TeraBox CDN"))
node_posthog[("PostHog")]

node_visitor -->|"submits link"| node_downloader_input
node_home -->|"renders"| node_downloader_input
node_platform_pages -->|"reuses input"| node_downloader_input
node_downloader_input -->|"requests extraction"| node_parse_api
node_parse_api -->|"extracts media"| node_ytdlp
node_parse_api -->|"resolves shares"| node_terabox
node_parse_api -->|"builds options"| node_format_builder
node_parse_api -->|"caches results"| node_parse_cache
node_ytdlp -->|"extracts from"| node_media_platforms
node_parse_api -->|"returns options"| node_parse_ui
node_parse_ui -->|"hands off choice"| node_progress_ui
node_progress_ui -->|"streams selection"| node_download_api
node_download_api -->|"prepares file"| node_ytdlp
node_download_api -->|"opens share file"| node_terabox
node_terabox -->|"proxies bytes"| node_cdn
node_download_api -->|"updates job"| node_live_jobs
node_progress_api -->|"reads job"| node_live_jobs
node_home -->|"shows platforms"| node_platform_catalog
node_platform_pages -->|"uses registry"| node_platform_catalog
node_site_guides -.->|"explains workflow"| node_visitor
node_analytics_client -->|"sends events"| node_posthog
node_analytics_server -->|"sends outcomes"| node_posthog
node_admin_ui -->|"requests insights"| node_posthog_api
node_hogql_route -->|"checks session"| node_admin_auth
node_hogql_route -->|"runs query"| node_posthog_api
node_posthog_api -.->|"queries project"| node_posthog

click node_home "https://github.com/abhi-dhakar/download24/blob/main/app/page.tsx"
click node_platform_pages "https://github.com/abhi-dhakar/download24/blob/main/app/%5Bslug%5D/page.tsx"
click node_site_guides "https://github.com/abhi-dhakar/download24/blob/main/app/how-it-works/page.tsx"
click node_platform_catalog "https://github.com/abhi-dhakar/download24/blob/main/lib/platforms.ts"
click node_downloader_input "https://github.com/abhi-dhakar/download24/blob/main/components/Downloader.tsx"
click node_parse_ui "https://github.com/abhi-dhakar/download24/blob/main/components/download/DownloadDetails.tsx"
click node_progress_ui "https://github.com/abhi-dhakar/download24/blob/main/components/download/DownloadFlow.tsx"
click node_parse_api "https://github.com/abhi-dhakar/download24/blob/main/app/api/parse/route.ts"
click node_download_api "https://github.com/abhi-dhakar/download24/blob/main/app/api/download/route.ts"
click node_progress_api "https://github.com/abhi-dhakar/download24/blob/main/app/api/download/progress/route.ts"
click node_format_builder "https://github.com/abhi-dhakar/download24/blob/main/lib/formats.ts"
click node_ytdlp "https://github.com/abhi-dhakar/download24/blob/main/lib/ytdlp.ts"
click node_terabox "https://github.com/abhi-dhakar/download24/blob/main/lib/terabox.ts"
click node_parse_cache "https://github.com/abhi-dhakar/download24/blob/main/lib/cache.ts"
click node_live_jobs "https://github.com/abhi-dhakar/download24/blob/main/lib/liveJobs.ts"
click node_analytics_client "https://github.com/abhi-dhakar/download24/blob/main/instrumentation-client.ts"
click node_analytics_server "https://github.com/abhi-dhakar/download24/blob/main/lib/posthogServer.ts"
click node_admin_ui "https://github.com/abhi-dhakar/download24/blob/main/app/admin/(dashboard)/page.tsx"
click node_admin_auth "https://github.com/abhi-dhakar/download24/blob/main/lib/adminAuth.ts"
click node_posthog_api "https://github.com/abhi-dhakar/download24/blob/main/lib/posthogApi.ts"
click node_hogql_route "https://github.com/abhi-dhakar/download24/blob/main/app/api/admin/hogql/route.ts"

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_platform_pages,node_site_guides,node_platform_catalog,node_downloader_input,node_parse_ui,node_progress_ui toneBlue
class node_parse_api,node_download_api,node_progress_api,node_format_builder,node_ytdlp,node_terabox,node_parse_cache,node_live_jobs,node_posthog toneAmber
class node_analytics_client,node_analytics_server,node_admin_ui,node_admin_auth,node_posthog_api,node_hogql_route toneMint
class node_visitor,node_media_platforms,node_cdn toneIndigo
```

## Components

### Public experience

- [Landing page](https://github.com/abhi-dhakar/download24/blob/main/app/page.tsx): `app/page.tsx`
- [Platform pages](https://github.com/abhi-dhakar/download24/blob/main/app/%5Bslug%5D/page.tsx): `app/[slug]/page.tsx`
- [Guides and FAQ](https://github.com/abhi-dhakar/download24/blob/main/app/how-it-works/page.tsx): `app/how-it-works/page.tsx`
- [Platform catalog](https://github.com/abhi-dhakar/download24/blob/main/lib/platforms.ts): `lib/platforms.ts`
- [Link input](https://github.com/abhi-dhakar/download24/blob/main/components/Downloader.tsx): `components/Downloader.tsx`
- [Quality selection](https://github.com/abhi-dhakar/download24/blob/main/components/download/DownloadDetails.tsx): `components/download/DownloadDetails.tsx`
- [Download progress](https://github.com/abhi-dhakar/download24/blob/main/components/download/DownloadFlow.tsx): `components/download/DownloadFlow.tsx`

### Download pipeline

- [Parse route](https://github.com/abhi-dhakar/download24/blob/main/app/api/parse/route.ts): `app/api/parse/route.ts`
- [Download route](https://github.com/abhi-dhakar/download24/blob/main/app/api/download/route.ts): `app/api/download/route.ts`
- [Progress route](https://github.com/abhi-dhakar/download24/blob/main/app/api/download/progress/route.ts): `app/api/download/progress/route.ts`
- [Format triage](https://github.com/abhi-dhakar/download24/blob/main/lib/formats.ts): `lib/formats.ts`
- [yt-dlp adapter](https://github.com/abhi-dhakar/download24/blob/main/lib/ytdlp.ts): `lib/ytdlp.ts`
- [TeraBox resolver](https://github.com/abhi-dhakar/download24/blob/main/lib/terabox.ts): `lib/terabox.ts`
- [Parse cache](https://github.com/abhi-dhakar/download24/blob/main/lib/cache.ts): `lib/cache.ts`
- [Live job state](https://github.com/abhi-dhakar/download24/blob/main/lib/liveJobs.ts): `lib/liveJobs.ts`

### Analytics and admin

- [Browser analytics](https://github.com/abhi-dhakar/download24/blob/main/instrumentation-client.ts): `instrumentation-client.ts`
- [Server analytics](https://github.com/abhi-dhakar/download24/blob/main/lib/posthogServer.ts): `lib/posthogServer.ts`
- [Admin dashboard](https://github.com/abhi-dhakar/download24/blob/main/app/admin/(dashboard)/page.tsx): `app/admin/(dashboard)/page.tsx`
- [Admin authentication](https://github.com/abhi-dhakar/download24/blob/main/lib/adminAuth.ts): `lib/adminAuth.ts`
- [PostHog API client](https://github.com/abhi-dhakar/download24/blob/main/lib/posthogApi.ts): `lib/posthogApi.ts`
- [HogQL route](https://github.com/abhi-dhakar/download24/blob/main/app/api/admin/hogql/route.ts): `app/api/admin/hogql/route.ts`

### Other components

- **Visitor**
- **Media platforms**
- **TeraBox CDN**
- **PostHog**

## Connections

- Visitor → Link input: submits link (evidence: `README.md`)
- Landing page → Link input: renders (evidence: `app/page.tsx`)
- Platform pages → Link input: reuses input (evidence: `app/[slug]/page.tsx`)
- Link input → Parse route: requests extraction (evidence: `README.md`)
- Parse route → yt-dlp adapter: extracts media (evidence: `app/api/parse/route.ts`)
- Parse route → TeraBox resolver: resolves shares (evidence: `app/api/parse/route.ts`)
- Parse route → Format triage: builds options (evidence: `README.md`)
- Parse route → Parse cache: caches results (evidence: `README.md`)
- yt-dlp adapter → Media platforms: extracts from (evidence: `README.md`)
- Parse route → Quality selection: returns options (evidence: `README.md`)
- Quality selection → Download progress: hands off choice (evidence: `README.md`)
- Download progress → Download route: streams selection (evidence: `README.md`)
- Download route → yt-dlp adapter: prepares file (evidence: `app/api/download/route.ts`)
- Download route → TeraBox resolver: opens share file (evidence: `app/api/download/route.ts`)
- TeraBox resolver → TeraBox CDN: proxies bytes (evidence: `README.md`)
- Download route → Live job state: updates job (evidence: `app/api/download/route.ts`)
- Progress route → Live job state: reads job (evidence: `app/api/download/progress/route.ts`)
- Landing page → Platform catalog: shows platforms (evidence: `app/page.tsx`)
- Platform pages → Platform catalog: uses registry (evidence: `app/[slug]/page.tsx`)
- Guides and FAQ → Visitor: explains workflow (evidence: `README.md`)
- Browser analytics → PostHog: sends events
- Server analytics → PostHog: sends outcomes
- Admin dashboard → PostHog API client: requests insights (evidence: `app/admin/(dashboard)/page.tsx`)
- HogQL route → Admin authentication: checks session (evidence: `app/api/admin/hogql/route.ts`)
- HogQL route → PostHog API client: runs query (evidence: `app/api/admin/hogql/route.ts`)
- PostHog API client → PostHog: queries project (evidence: `README.md`)
