# devlucasmart/youtube-dowloader architecture

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

- Interactive diagram: https://gitdiagram.com/devlucasmart/youtube-dowloader
- Repository: https://github.com/devlucasmart/youtube-dowloader

## Overview

This repository implements a YouTube video downloader with a React interface and an Express endpoint. A user submits a video URL; the interface POSTs it to the backend, which validates it, starts `yt-dlp`, and reports success or failure. The downloader is configured to save files in the backend host’s Downloads directory. The README describes a Python/Flask and MP4-based service, but the sampled runtime is JavaScript/Express and does not show MP4 conversion. The graph includes the required web-vitals module; other frontend behavior is not sampled.

Main entry points: [`frontend/src/App.js`](https://github.com/devlucasmart/youtube-dowloader/blob/main/frontend/src/App.js) (Download form), [`frontend/src/index.js`](https://github.com/devlucasmart/youtube-dowloader/blob/main/frontend/src/index.js) (React entry), [`backend/index.js`](https://github.com/devlucasmart/youtube-dowloader/blob/main/backend/index.js) (Download endpoint), [`frontend/src/reportWebVitals.js`](https://github.com/devlucasmart/youtube-dowloader/blob/main/frontend/src/reportWebVitals.js) (Web vitals)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_app["Download form<br/>[App.js]"]
  node_mount["React entry<br/>[index.js]"]
  node_vitals["Web vitals<br/>[reportWebVitals.js]"]
end

subgraph group_backend["Download backend"]
  node_api["Download endpoint<br/>[index.js]"]
  node_downloads["Downloads directory"]
end

subgraph group_integration["External systems"]
  node_ytdlp["yt-dlp process"]
  node_youtube["YouTube"]
end

node_user(("User"))

node_user -->|"submits URL"| node_app
node_mount -->|"renders"| node_app
node_mount -->|"invokes"| node_vitals
node_app -->|"POSTs URL"| node_api
node_api -->|"spawns with URL"| node_ytdlp
node_ytdlp -->|"downloads video"| node_youtube
node_ytdlp -->|"writes video"| node_downloads

click node_app "https://github.com/devlucasmart/youtube-dowloader/blob/main/frontend/src/App.js"
click node_mount "https://github.com/devlucasmart/youtube-dowloader/blob/main/frontend/src/index.js"
click node_vitals "https://github.com/devlucasmart/youtube-dowloader/blob/main/frontend/src/reportWebVitals.js"
click node_api "https://github.com/devlucasmart/youtube-dowloader/blob/main/backend/index.js"

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_mount,node_vitals,node_user toneBlue
class node_api,node_downloads toneAmber
class node_ytdlp,node_youtube toneMint
```

## Components

### Web interface

- [Download form](https://github.com/devlucasmart/youtube-dowloader/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [React entry](https://github.com/devlucasmart/youtube-dowloader/blob/main/frontend/src/index.js): `frontend/src/index.js`
- [Web vitals](https://github.com/devlucasmart/youtube-dowloader/blob/main/frontend/src/reportWebVitals.js): `frontend/src/reportWebVitals.js`

### Download backend

- [Download endpoint](https://github.com/devlucasmart/youtube-dowloader/blob/main/backend/index.js): `backend/index.js`
- **Downloads directory**

### External systems

- **yt-dlp process**
- **YouTube**

### Other components

- **User**

## Connections

- User → Download form: submits URL (evidence: `frontend/src/App.js`)
- React entry → Download form: renders (evidence: `frontend/src/index.js`)
- React entry → Web vitals: invokes (evidence: `frontend/src/index.js`)
- Download form → Download endpoint: POSTs URL (evidence: `frontend/src/App.js`)
- Download endpoint → yt-dlp process: spawns with URL (evidence: `backend/index.js`)
- yt-dlp process → YouTube: downloads video (evidence: `README.md`)
- yt-dlp process → Downloads directory: writes video
