# kirasync2748/crazy-downloader architecture

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

- Interactive diagram: https://gitdiagram.com/kirasync2748/crazy-downloader
- Repository: https://github.com/kirasync2748/crazy-downloader

## Overview

Crazy Downloader is a browser-to-server YouTube format picker and streaming downloader. Users submit a URL, inspect extracted formats, select a format, and receive a streamed file with browser-side progress; DASH video-only streams are merged with audio. The graph also preserves cookie handling, rate limiting, and the app’s informational pages. Edges follow excerpts or README statements; unsampled implementation details are omitted.

Main entry points: [`frontend/src/pages/Home.tsx`](https://github.com/kirasync2748/crazy-downloader/blob/main/frontend/src/pages/Home.tsx) (URL and results), [`backend/app/routers/download.py`](https://github.com/kirasync2748/crazy-downloader/blob/main/backend/app/routers/download.py) (Format and download routes), [`frontend/src/api/client.ts`](https://github.com/kirasync2748/crazy-downloader/blob/main/frontend/src/api/client.ts) (API client), [`frontend/src/components/FormatList.tsx`](https://github.com/kirasync2748/crazy-downloader/blob/main/frontend/src/components/FormatList.tsx) (Format list and progress)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["App routes<br/>[App.tsx]"]
  node_home["URL and results<br/>[Home.tsx]"]
  node_urlinput["URL input<br/>[UrlInput.tsx]"]
  node_cookies["Cookie manager<br/>[CookieManager.tsx]"]
  node_formats["Format list and progress<br/>[FormatList.tsx]"]
  node_client["API client<br/>[client.ts]"]
  node_info_pages["Policy and fallback pages<br/>[Privacy.tsx]"]
end

subgraph group_api["API and safeguards"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_ratelimit["Rate limiter<br/>[middleware.py]"]
  node_download_router["Format and download routes<br/>[download.py]"]
end

subgraph group_media["Media processing"]
  node_service["Extraction and format service<br/>[services.py]"]
end

node_user(("Downloader user"))
node_youtube["YouTube media"]
node_ffmpeg["ffmpeg merger"]
node_device(("User device"))

node_user -->|"submits URL"| node_home
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_info_pages
node_home -->|"renders"| node_urlinput
node_home -->|"renders"| node_cookies
node_home -->|"renders"| node_formats
node_cookies -->|"manages cookies"| node_client
node_home -->|"requests formats"| node_client
node_formats -->|"requests downloads"| node_client
node_client -->|"calls API"| node_api_app
node_api_app -->|"registers middleware"| node_ratelimit
node_api_app -->|"mounts routes"| node_download_router
node_download_router -->|"extracts and selects"| node_service
node_service -->|"extracts metadata"| node_youtube
node_download_router -->|"proxies stream"| node_youtube
node_download_router -->|"merges DASH streams"| node_ffmpeg
node_formats -->|"tracks and saves file"| node_device
node_download_router -->|"streams response"| node_device

click node_app "https://github.com/kirasync2748/crazy-downloader/blob/main/frontend/src/App.tsx"
click node_home "https://github.com/kirasync2748/crazy-downloader/blob/main/frontend/src/pages/Home.tsx"
click node_urlinput "https://github.com/kirasync2748/crazy-downloader/blob/main/frontend/src/components/UrlInput.tsx"
click node_cookies "https://github.com/kirasync2748/crazy-downloader/blob/main/frontend/src/components/CookieManager.tsx"
click node_formats "https://github.com/kirasync2748/crazy-downloader/blob/main/frontend/src/components/FormatList.tsx"
click node_client "https://github.com/kirasync2748/crazy-downloader/blob/main/frontend/src/api/client.ts"
click node_info_pages "https://github.com/kirasync2748/crazy-downloader/blob/main/frontend/src/pages/Privacy.tsx"
click node_api_app "https://github.com/kirasync2748/crazy-downloader/blob/main/backend/app/main.py"
click node_ratelimit "https://github.com/kirasync2748/crazy-downloader/blob/main/backend/app/middleware.py"
click node_download_router "https://github.com/kirasync2748/crazy-downloader/blob/main/backend/app/routers/download.py"
click node_service "https://github.com/kirasync2748/crazy-downloader/blob/main/backend/app/services.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_app,node_home,node_urlinput,node_cookies,node_formats,node_client,node_info_pages,node_user,node_device toneBlue
class node_api_app,node_ratelimit,node_download_router toneAmber
class node_service toneMint
class node_youtube,node_ffmpeg toneIndigo
```

## Components

### Web experience

- [App routes](https://github.com/kirasync2748/crazy-downloader/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [URL and results](https://github.com/kirasync2748/crazy-downloader/blob/main/frontend/src/pages/Home.tsx): `frontend/src/pages/Home.tsx`
- [URL input](https://github.com/kirasync2748/crazy-downloader/blob/main/frontend/src/components/UrlInput.tsx): `frontend/src/components/UrlInput.tsx`
- [Cookie manager](https://github.com/kirasync2748/crazy-downloader/blob/main/frontend/src/components/CookieManager.tsx): `frontend/src/components/CookieManager.tsx`
- [Format list and progress](https://github.com/kirasync2748/crazy-downloader/blob/main/frontend/src/components/FormatList.tsx): `frontend/src/components/FormatList.tsx`
- [API client](https://github.com/kirasync2748/crazy-downloader/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Policy and fallback pages](https://github.com/kirasync2748/crazy-downloader/blob/main/frontend/src/pages/Privacy.tsx): `frontend/src/pages/Privacy.tsx`

### API and safeguards

- [FastAPI app](https://github.com/kirasync2748/crazy-downloader/blob/main/backend/app/main.py): `backend/app/main.py`
- [Rate limiter](https://github.com/kirasync2748/crazy-downloader/blob/main/backend/app/middleware.py): `backend/app/middleware.py`
- [Format and download routes](https://github.com/kirasync2748/crazy-downloader/blob/main/backend/app/routers/download.py): `backend/app/routers/download.py`

### Media processing

- [Extraction and format service](https://github.com/kirasync2748/crazy-downloader/blob/main/backend/app/services.py): `backend/app/services.py`

### Other components

- **Downloader user**
- **YouTube media**
- **ffmpeg merger**
- **User device**

## Connections

- Downloader user → URL and results: submits URL (evidence: `frontend/src/pages/Home.tsx`)
- App routes → URL and results: routes to (evidence: `frontend/src/App.tsx`)
- App routes → Policy and fallback pages: routes to (evidence: `frontend/src/App.tsx`)
- URL and results → URL input: renders (evidence: `frontend/src/pages/Home.tsx`)
- URL and results → Cookie manager: renders (evidence: `frontend/src/pages/Home.tsx`)
- URL and results → Format list and progress: renders (evidence: `frontend/src/pages/Home.tsx`)
- Cookie manager → API client: manages cookies (evidence: `frontend/src/components/CookieManager.tsx`)
- URL and results → API client: requests formats (evidence: `frontend/src/pages/Home.tsx`)
- Format list and progress → API client: requests downloads (evidence: `frontend/src/components/FormatList.tsx`)
- API client → FastAPI app: calls API (evidence: `README.md`)
- FastAPI app → Rate limiter: registers middleware (evidence: `backend/app/main.py`)
- FastAPI app → Format and download routes: mounts routes (evidence: `backend/app/main.py`)
- Format and download routes → Extraction and format service: extracts and selects (evidence: `backend/app/routers/download.py`)
- Extraction and format service → YouTube media: extracts metadata (evidence: `README.md`)
- Format and download routes → YouTube media: proxies stream (evidence: `README.md`)
- Format and download routes → ffmpeg merger: merges DASH streams (evidence: `README.md`)
- Format list and progress → User device: tracks and saves file (evidence: `frontend/src/components/FormatList.tsx`)
- Format and download routes → User device: streams response (evidence: `README.md`)
