# noushad970/youtube-video-uploading-agent-from-drive architecture

> Architecture diagram of the GitHub repository noushad970/youtube-video-uploading-agent-from-drive, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/noushad970/youtube-video-uploading-agent-from-drive
- Repository: https://github.com/noushad970/youtube-video-uploading-agent-from-drive

## Overview

This repository implements a web-managed agent that catalogs videos in a selected Google Drive folder and uploads them to YouTube, optionally generating metadata with Ollama. Users connect Google, configure the folder and upload settings, then trigger or schedule runs; the agent validates readiness, syncs and selects a video, downloads it, prepares metadata, uploads it, and records the outcome. The frontend also exposes video, upload-history, account, settings, and log views. Some route and service wiring is inferred only where the sampled agent or application source supports it; unsampled details are omitted.

Main entry points: [`backend/app/services/agent_service.py`](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/agent_service.py) (Agent orchestrator), [`backend/app/services/google_auth_service.py`](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/google_auth_service.py) (Google credentials), [`frontend/src/App.tsx`](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/frontend/src/App.tsx) (Dashboard app), [`backend/app/main.py`](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/main.py) (FastAPI application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web dashboard"]
  node_app["Dashboard app<br/>[App.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_pages["Dashboard pages"]
end

subgraph group_api["Backend API"]
  node_server["FastAPI application<br/>[main.py]"]
  node_routes["API routes"]
  node_auth_route["Google auth route<br/>[auth.py]"]
end

subgraph group_agent["Upload workflow"]
  node_agent_service["Agent orchestrator<br/>[agent_service.py]"]
  node_scheduler["Background scheduler"]
  node_drive_service["Drive catalog and download<br/>[drive_service.py]"]
  node_video_service["Video handling<br/>[video_service.py]"]
  node_ai_service["Metadata generation<br/>[ai_service.py]"]
  node_youtube_service["YouTube publishing<br/>[youtube_service.py]"]
  node_upload_service["Upload records<br/>[upload_service.py]"]
end

subgraph group_integrations["External services and state"]
  node_auth_service["Google credentials"]
  node_repository["Data repository<br/>[repository.py]"]
  node_database[("Application database<br/>[database.py]")]
  node_drive["Google Drive"]
  node_youtube["YouTube"]
  node_ollama["Ollama"]
end

node_user(("Operator"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_pages
node_app -->|"requests"| node_api_client
node_api_client -->|"calls API"| node_server
node_server -->|"mounts"| node_routes
node_routes -->|"dispatches runs"| node_agent_service
node_auth_route -->|"handles OAuth"| node_auth_service
node_server -->|"starts and stops"| node_scheduler
node_scheduler -->|"triggers runs"| node_agent_service
node_agent_service -->|"checks credentials"| node_auth_service
node_agent_service -->|"syncs and downloads"| node_drive_service
node_drive_service -->|"gets credentials"| node_auth_service
node_drive_service -->|"lists and downloads"| node_drive
node_agent_service -->|"handles video"| node_video_service
node_agent_service -->|"generates metadata"| node_ai_service
node_ai_service -.->|"requests generation"| node_ollama
node_agent_service -->|"uploads video"| node_youtube_service
node_youtube_service -->|"publishes"| node_youtube
node_agent_service -->|"records upload"| node_upload_service
node_agent_service -->|"reads and updates"| node_repository
node_auth_service -->|"stores credentials"| node_repository
node_repository -->|"reads and writes"| node_database

click node_app "https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/frontend/src/services/api.ts"
click node_pages "https://github.com/noushad970/youtube-video-uploading-agent-from-drive/tree/main/frontend/src/pages"
click node_server "https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/main.py"
click node_routes "https://github.com/noushad970/youtube-video-uploading-agent-from-drive/tree/main/backend/app/api"
click node_auth_route "https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/api/auth.py"
click node_agent_service "https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/agent_service.py"
click node_scheduler "https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/scheduler_service.py"
click node_drive_service "https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/drive_service.py"
click node_video_service "https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/video_service.py"
click node_ai_service "https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/ai_service.py"
click node_youtube_service "https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/youtube_service.py"
click node_upload_service "https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/upload_service.py"
click node_auth_service "https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/google_auth_service.py"
click node_repository "https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/database/repository.py"
click node_database "https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/database/database.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_api_client,node_pages toneBlue
class node_server,node_routes,node_auth_route toneAmber
class node_agent_service,node_scheduler,node_drive_service,node_video_service,node_ai_service,node_youtube_service,node_upload_service toneMint
class node_auth_service,node_repository,node_database,node_drive,node_youtube,node_ollama toneRose
class node_user toneIndigo
```

## Components

### Web dashboard

- [Dashboard app](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API client](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Dashboard pages](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/tree/main/frontend/src/pages): `frontend/src/pages`

### Backend API

- [FastAPI application](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/main.py): `backend/app/main.py`
- [API routes](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/tree/main/backend/app/api): `backend/app/api`
- [Google auth route](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/api/auth.py): `backend/app/api/auth.py`

### Upload workflow

- [Agent orchestrator](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/agent_service.py): `backend/app/services/agent_service.py`
- [Background scheduler](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/scheduler_service.py): `backend/app/services/scheduler_service.py`
- [Drive catalog and download](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/drive_service.py): `backend/app/services/drive_service.py`
- [Video handling](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/video_service.py): `backend/app/services/video_service.py`
- [Metadata generation](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/ai_service.py): `backend/app/services/ai_service.py`
- [YouTube publishing](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/youtube_service.py): `backend/app/services/youtube_service.py`
- [Upload records](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/upload_service.py): `backend/app/services/upload_service.py`

### External services and state

- [Google credentials](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/services/google_auth_service.py): `backend/app/services/google_auth_service.py`
- [Data repository](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/database/repository.py): `backend/app/database/repository.py`
- [Application database](https://github.com/noushad970/youtube-video-uploading-agent-from-drive/blob/main/backend/app/database/database.py): `backend/app/database/database.py`
- **Google Drive**
- **YouTube**
- **Ollama**

### Other components

- **Operator**

## Connections

- Operator → Dashboard app: uses
- Dashboard app → Dashboard pages: renders
- Dashboard app → API client: requests
- API client → FastAPI application: calls API
- FastAPI application → API routes: mounts
- API routes → Agent orchestrator: dispatches runs
- Google auth route → Google credentials: handles OAuth
- FastAPI application → Background scheduler: starts and stops
- Background scheduler → Agent orchestrator: triggers runs
- Agent orchestrator → Google credentials: checks credentials
- Agent orchestrator → Drive catalog and download: syncs and downloads
- Drive catalog and download → Google credentials: gets credentials
- Drive catalog and download → Google Drive: lists and downloads
- Agent orchestrator → Video handling: handles video
- Agent orchestrator → Metadata generation: generates metadata
- Metadata generation → Ollama: requests generation
- Agent orchestrator → YouTube publishing: uploads video
- YouTube publishing → YouTube: publishes
- Agent orchestrator → Upload records: records upload
- Agent orchestrator → Data repository: reads and updates
- Google credentials → Data repository: stores credentials
- Data repository → Application database: reads and writes
