# akshaypathakdev/vidio architecture

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

- Interactive diagram: https://gitdiagram.com/akshaypathakdev/vidio
- Repository: https://github.com/akshaypathakdev/vidio

## Overview

Vidio is a full-stack video-sharing platform. Users authenticate, discover videos and channels, then watch, interact, and manage videos, subscriptions, history, and playlists. Uploads enter an asynchronous processing workflow: the API validates and stores the original, queues a job, and a worker transcodes it to HLS qualities for cloud storage and playback. The graph also preserves account, social, collaboration, and real-time capabilities documented in the README. Evidence is limited to the supplied excerpts, SOURCE INDEX references, and README; unsampled implementation links are omitted or marked unverified.

Main entry points: [`server/src/app.js`](https://github.com/akshaypathakdev/vidio/blob/main/server/src/app.js) (Express API), [`client/src/App.jsx`](https://github.com/akshaypathakdev/vidio/blob/main/client/src/App.jsx) (Application routes), [`server/src/controllers/video.controller.js`](https://github.com/akshaypathakdev/vidio/blob/main/server/src/controllers/video.controller.js) (Video handlers), [`server/src/workers/video.worker.js`](https://github.com/akshaypathakdev/vidio/blob/main/server/src/workers/video.worker.js) (Video worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_webapp["Application routes<br/>[App.jsx]"]
  node_clientservices["API services<br/>[api.js]"]
  node_auth["Accounts and verification<br/>[VerifyEmail.jsx]"]
  node_videoexperience["Video discovery and playback"]
  node_channelsubs["Channels and subscriptions"]
  node_playlists["Playlists and collaboration<br/>[Playlists.jsx]"]
  node_social["Comments and notifications"]
end

subgraph group_api["API and domain"]
  node_apiapp["Express API<br/>[app.js]"]
  node_usercontroller["Account and channel handlers<br/>[user.controller.js]"]
  node_videocontroller["Video handlers"]
  node_playlistcontroller["Playlist handlers"]
  node_socialcontrollers["Social and activity handlers"]
end

subgraph group_processing["Video processing"]
  node_queue["Video job queue<br/>[video.queue.js]"]
  node_worker["Video worker<br/>[video.worker.js]"]
  node_transcoder["Transcoding and HLS<br/>[videoProcessor.js]"]
end

subgraph group_state["Persistence and storage"]
  node_mongodb[("MongoDB models")]
  node_b2["Backblaze B2<br/>[b2.service.js]"]
  node_cloudinary["Cloudinary media"]
end

subgraph group_realtime["Real-time communication"]
  node_redis[("Redis infrastructure<br/>[redis.js]")]
  node_socketserver["Socket.IO server"]
  node_socketclient["Live client updates<br/>[SocketContext.jsx]"]
end

node_viewer(("Viewer / creator"))

node_viewer -->|"uses"| node_webapp
node_webapp -.->|"requests data"| node_clientservices
node_webapp -->|"routes to"| node_auth
node_webapp -->|"routes to"| node_videoexperience
node_webapp -->|"routes to"| node_playlists
node_webapp -->|"routes to"| node_channelsubs
node_webapp -->|"calls API"| node_apiapp
node_apiapp -->|"routes requests"| node_usercontroller
node_apiapp -->|"routes requests"| node_videocontroller
node_apiapp -->|"routes requests"| node_playlistcontroller
node_apiapp -->|"routes requests"| node_socialcontrollers
node_usercontroller -->|"reads and writes"| node_mongodb
node_playlistcontroller -->|"reads and writes"| node_mongodb
node_videocontroller -->|"enqueues jobs"| node_queue
node_videocontroller -->|"stores and streams"| node_b2
node_videocontroller -->|"stores thumbnails"| node_cloudinary
node_videocontroller -->|"reads and writes"| node_mongodb
node_queue -->|"dispatches jobs"| node_worker
node_worker -->|"processes video"| node_transcoder
node_transcoder -->|"uploads HLS"| node_b2
node_worker -.->|"updates status"| node_mongodb
node_worker -->|"reports progress"| node_redis
node_redis -->|"relays updates"| node_socketserver
node_socketserver -->|"sends events"| node_socketclient
node_socketclient -->|"shows updates"| node_viewer
node_videoexperience -->|"streams video"| node_apiapp
node_social -.->|"sends interactions"| node_apiapp
node_channelsubs -.->|"manages channels"| node_apiapp
node_playlists -.->|"manages playlists"| node_apiapp

click node_webapp "https://github.com/akshaypathakdev/vidio/blob/main/client/src/App.jsx"
click node_clientservices "https://github.com/akshaypathakdev/vidio/blob/main/client/src/services/api.js"
click node_auth "https://github.com/akshaypathakdev/vidio/blob/main/client/src/features/auth/pages/VerifyEmail.jsx"
click node_videoexperience "https://github.com/akshaypathakdev/vidio/tree/main/client/src/features/video"
click node_channelsubs "https://github.com/akshaypathakdev/vidio/tree/main/client/src/features/channel"
click node_playlists "https://github.com/akshaypathakdev/vidio/blob/main/client/src/features/playlist/pages/Playlists.jsx"
click node_social "https://github.com/akshaypathakdev/vidio/tree/main/client/src/components/comments"
click node_apiapp "https://github.com/akshaypathakdev/vidio/blob/main/server/src/app.js"
click node_usercontroller "https://github.com/akshaypathakdev/vidio/blob/main/server/src/controllers/user.controller.js"
click node_videocontroller "https://github.com/akshaypathakdev/vidio/blob/main/server/src/controllers/video.controller.js"
click node_playlistcontroller "https://github.com/akshaypathakdev/vidio/blob/main/server/src/controllers/playlist.controller.js"
click node_socialcontrollers "https://github.com/akshaypathakdev/vidio/tree/main/server/src/controllers"
click node_queue "https://github.com/akshaypathakdev/vidio/blob/main/server/src/queues/video.queue.js"
click node_worker "https://github.com/akshaypathakdev/vidio/blob/main/server/src/workers/video.worker.js"
click node_transcoder "https://github.com/akshaypathakdev/vidio/blob/main/server/src/utils/video-processing/videoProcessor.js"
click node_mongodb "https://github.com/akshaypathakdev/vidio/tree/main/server/src/models"
click node_b2 "https://github.com/akshaypathakdev/vidio/blob/main/server/src/services/b2.service.js"
click node_cloudinary "https://github.com/akshaypathakdev/vidio/blob/main/server/src/services/cloudinary.service.js"
click node_redis "https://github.com/akshaypathakdev/vidio/blob/main/server/src/config/redis.js"
click node_socketserver "https://github.com/akshaypathakdev/vidio/tree/main/server/src/sockets"
click node_socketclient "https://github.com/akshaypathakdev/vidio/blob/main/client/src/context/SocketContext.jsx"

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_webapp,node_clientservices,node_auth,node_videoexperience,node_channelsubs,node_playlists,node_social,node_viewer toneBlue
class node_apiapp,node_usercontroller,node_videocontroller,node_playlistcontroller,node_socialcontrollers toneAmber
class node_queue,node_worker,node_transcoder toneMint
class node_mongodb,node_b2,node_cloudinary toneRose
class node_redis,node_socketserver,node_socketclient toneIndigo
```

## Components

### React client

- [Application routes](https://github.com/akshaypathakdev/vidio/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [API services](https://github.com/akshaypathakdev/vidio/blob/main/client/src/services/api.js): `client/src/services/api.js`
- [Accounts and verification](https://github.com/akshaypathakdev/vidio/blob/main/client/src/features/auth/pages/VerifyEmail.jsx): `client/src/features/auth/pages/VerifyEmail.jsx`
- [Video discovery and playback](https://github.com/akshaypathakdev/vidio/tree/main/client/src/features/video): `client/src/features/video`
- [Channels and subscriptions](https://github.com/akshaypathakdev/vidio/tree/main/client/src/features/channel): `client/src/features/channel`
- [Playlists and collaboration](https://github.com/akshaypathakdev/vidio/blob/main/client/src/features/playlist/pages/Playlists.jsx): `client/src/features/playlist/pages/Playlists.jsx`
- [Comments and notifications](https://github.com/akshaypathakdev/vidio/tree/main/client/src/components/comments): `client/src/components/comments`

### API and domain

- [Express API](https://github.com/akshaypathakdev/vidio/blob/main/server/src/app.js): `server/src/app.js`
- [Account and channel handlers](https://github.com/akshaypathakdev/vidio/blob/main/server/src/controllers/user.controller.js): `server/src/controllers/user.controller.js`
- [Video handlers](https://github.com/akshaypathakdev/vidio/blob/main/server/src/controllers/video.controller.js): `server/src/controllers/video.controller.js`
- [Playlist handlers](https://github.com/akshaypathakdev/vidio/blob/main/server/src/controllers/playlist.controller.js): `server/src/controllers/playlist.controller.js`
- [Social and activity handlers](https://github.com/akshaypathakdev/vidio/tree/main/server/src/controllers): `server/src/controllers`

### Video processing

- [Video job queue](https://github.com/akshaypathakdev/vidio/blob/main/server/src/queues/video.queue.js): `server/src/queues/video.queue.js`
- [Video worker](https://github.com/akshaypathakdev/vidio/blob/main/server/src/workers/video.worker.js): `server/src/workers/video.worker.js`
- [Transcoding and HLS](https://github.com/akshaypathakdev/vidio/blob/main/server/src/utils/video-processing/videoProcessor.js): `server/src/utils/video-processing/videoProcessor.js`

### Persistence and storage

- [MongoDB models](https://github.com/akshaypathakdev/vidio/tree/main/server/src/models): `server/src/models`
- [Backblaze B2](https://github.com/akshaypathakdev/vidio/blob/main/server/src/services/b2.service.js): `server/src/services/b2.service.js`
- [Cloudinary media](https://github.com/akshaypathakdev/vidio/blob/main/server/src/services/cloudinary.service.js): `server/src/services/cloudinary.service.js`

### Real-time communication

- [Redis infrastructure](https://github.com/akshaypathakdev/vidio/blob/main/server/src/config/redis.js): `server/src/config/redis.js`
- [Socket.IO server](https://github.com/akshaypathakdev/vidio/tree/main/server/src/sockets): `server/src/sockets`
- [Live client updates](https://github.com/akshaypathakdev/vidio/blob/main/client/src/context/SocketContext.jsx): `client/src/context/SocketContext.jsx`

### Other components

- **Viewer / creator**

## Connections

- Viewer / creator → Application routes: uses (evidence: `README.md`)
- Application routes → API services: requests data
- Application routes → Accounts and verification: routes to (evidence: `client/src/App.jsx`)
- Application routes → Video discovery and playback: routes to (evidence: `client/src/App.jsx`)
- Application routes → Playlists and collaboration: routes to (evidence: `client/src/App.jsx`)
- Application routes → Channels and subscriptions: routes to (evidence: `client/src/App.jsx`)
- Application routes → Express API: calls API (evidence: `README.md`)
- Express API → Account and channel handlers: routes requests (evidence: `server/src/app.js`)
- Express API → Video handlers: routes requests (evidence: `server/src/app.js`)
- Express API → Playlist handlers: routes requests (evidence: `server/src/app.js`)
- Express API → Social and activity handlers: routes requests (evidence: `server/src/app.js`)
- Account and channel handlers → MongoDB models: reads and writes (evidence: `server/src/controllers/user.controller.js`)
- Playlist handlers → MongoDB models: reads and writes (evidence: `server/src/controllers/playlist.controller.js`)
- Video handlers → Video job queue: enqueues jobs (evidence: `server/src/controllers/video.controller.js`)
- Video handlers → Backblaze B2: stores and streams (evidence: `server/src/controllers/video.controller.js`)
- Video handlers → Cloudinary media: stores thumbnails (evidence: `server/src/controllers/video.controller.js`)
- Video handlers → MongoDB models: reads and writes (evidence: `server/src/controllers/video.controller.js`)
- Video job queue → Video worker: dispatches jobs (evidence: `README.md`)
- Video worker → Transcoding and HLS: processes video (evidence: `server/src/workers/video.worker.js`)
- Transcoding and HLS → Backblaze B2: uploads HLS (evidence: `README.md`)
- Video worker → MongoDB models: updates status
- Video worker → Redis infrastructure: reports progress (evidence: `README.md`)
- Redis infrastructure → Socket.IO server: relays updates (evidence: `README.md`)
- Socket.IO server → Live client updates: sends events (evidence: `README.md`)
- Live client updates → Viewer / creator: shows updates (evidence: `README.md`)
- Video discovery and playback → Express API: streams video (evidence: `README.md`)
- Comments and notifications → Express API: sends interactions
- Channels and subscriptions → Express API: manages channels
- Playlists and collaboration → Express API: manages playlists
