# itssubroto/reelvault architecture

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

- Interactive diagram: https://gitdiagram.com/itssubroto/reelvault
- Repository: https://github.com/itssubroto/reelvault

## Overview

ReelVault lets users save Instagram reels and YouTube Shorts, organize them into collections, and search their captions, transcripts, summaries, and tags. The main path runs from the web app or browser extension through the REST API to reel storage; saved reels can then be enriched by the AI service and searched. The graph includes authentication, collection management, metadata extraction, and AI processing. Backend-to-AI dispatch details are not shown in the sampled code, so that relationship is marked unverified.

Main entry points: [`backend/src/main/java/com/reelvault/service/ReelService.java`](https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/service/ReelService.java) (Reel management), [`backend/src/main/java/com/reelvault/BackendApplication.java`](https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/BackendApplication.java) (REST API application), [`ai-service/services/ai_pipeline.py`](https://github.com/itssubroto/reelvault/blob/main/ai-service/services/ai_pipeline.py) (Transcription and summaries), [`backend/src/main/java/com/reelvault/service/AuthService.java`](https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/service/AuthService.java) (Authentication logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User Clients"]
  node_web["Web application<br/>[App.jsx]"]
  node_api_client["API client<br/>[client.js]"]
  node_extension["Browser extension<br/>[content.js]"]
  node_extension_worker["Extension service worker<br/>[background.js]"]
  node_auth_ui["Authentication UI<br/>[AuthModal.jsx]"]
end

subgraph group_api["REST API"]
  node_backend["REST API application"]
  node_reel_routes["Reel endpoints"]
  node_collection_routes["Collection endpoints"]
  node_auth_routes["Authentication endpoints"]
end

subgraph group_domain["Reel Domain"]
  node_reel_service["Reel management<br/>[ReelService.java]"]
  node_collection_service["Collection management"]
  node_auth_service["Authentication logic<br/>[AuthService.java]"]
  node_search_service["Search logic<br/>[SearchService.java]"]
  node_instagram["Platform metadata fetcher"]
  node_entities["User, collection and reel models<br/>[Reel.java]"]
  node_reel_repository["Reel repository"]
  node_collection_repository["Collection repository"]
  node_user_repository["User repository"]
end

subgraph group_ai["AI Enrichment"]
  node_ai_api["AI processing API<br/>[main.py]"]
  node_metadata["Video metadata extraction<br/>[metadata.py]"]
  node_pipeline["Transcription and summaries<br/>[ai_pipeline.py]"]
end

node_user(("ReelVault user"))
node_postgres[("PostgreSQL")]
node_yt_dlp["Video platform sources"]
node_ai_provider["AI model providers"]

node_user -->|"uses"| node_web
node_web -->|"requests data"| node_api_client
node_auth_ui -->|"authenticates via"| node_api_client
node_api_client -->|"calls REST API"| node_backend
node_user -->|"saves reels"| node_extension
node_extension -.->|"requests API proxy"| node_extension_worker
node_extension_worker -.->|"proxies API requests"| node_backend
node_backend -.->|"serves endpoints"| node_reel_routes
node_backend -.->|"serves endpoints"| node_collection_routes
node_backend -.->|"serves endpoints"| node_auth_routes
node_reel_routes -->|"delegates reel operations"| node_reel_service
node_collection_routes -->|"delegates collection operations"| node_collection_service
node_auth_routes -->|"delegates authentication"| node_auth_service
node_reel_service -->|"reads and writes reels"| node_reel_repository
node_collection_service -->|"reads and writes collections"| node_collection_repository
node_auth_service -->|"looks up and saves users"| node_user_repository
node_auth_service -->|"creates default collection"| node_collection_repository
node_reel_service -->|"resolves collections"| node_collection_service
node_reel_service -->|"fetches platform metadata"| node_instagram
node_search_service -->|"searches indexed fields"| node_reel_repository
node_search_service -->|"formats results"| node_reel_service
node_reel_repository -.->|"persists reel data"| node_postgres
node_collection_repository -.->|"persists collections"| node_postgres
node_user_repository -.->|"persists users"| node_postgres
node_reel_service -.->|"requests processing"| node_ai_api
node_ai_api -->|"extracts metadata"| node_metadata
node_ai_api -->|"runs AI pipeline"| node_pipeline
node_metadata -->|"extracts video details"| node_yt_dlp
node_pipeline -->|"uses metadata service"| node_metadata
node_pipeline -->|"generates summaries"| node_ai_provider
node_pipeline -->|"patches reel results"| node_backend

click node_web "https://github.com/itssubroto/reelvault/blob/main/frontend/src/App.jsx"
click node_api_client "https://github.com/itssubroto/reelvault/blob/main/frontend/src/api/client.js"
click node_extension "https://github.com/itssubroto/reelvault/blob/main/extension/content.js"
click node_extension_worker "https://github.com/itssubroto/reelvault/blob/main/extension/background.js"
click node_auth_ui "https://github.com/itssubroto/reelvault/blob/main/frontend/src/components/AuthModal.jsx"
click node_backend "https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/BackendApplication.java"
click node_reel_routes "https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/controller/ReelController.java"
click node_collection_routes "https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/controller/CollectionController.java"
click node_auth_routes "https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/controller/AuthController.java"
click node_reel_service "https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/service/ReelService.java"
click node_collection_service "https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/service/CollectionService.java"
click node_auth_service "https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/service/AuthService.java"
click node_search_service "https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/service/SearchService.java"
click node_instagram "https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/service/InstagramService.java"
click node_entities "https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/entity/Reel.java"
click node_reel_repository "https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/repository/ReelRepository.java"
click node_collection_repository "https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/repository/CollectionRepository.java"
click node_user_repository "https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/repository/UserRepository.java"
click node_ai_api "https://github.com/itssubroto/reelvault/blob/main/ai-service/main.py"
click node_metadata "https://github.com/itssubroto/reelvault/blob/main/ai-service/services/metadata.py"
click node_pipeline "https://github.com/itssubroto/reelvault/blob/main/ai-service/services/ai_pipeline.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_web,node_api_client,node_extension,node_extension_worker,node_auth_ui,node_user toneBlue
class node_backend,node_reel_routes,node_collection_routes,node_auth_routes,node_postgres toneAmber
class node_reel_service,node_collection_service,node_auth_service,node_search_service,node_instagram,node_entities,node_reel_repository,node_collection_repository,node_user_repository toneMint
class node_ai_api,node_metadata,node_pipeline toneRose
class node_yt_dlp,node_ai_provider toneIndigo
```

## Components

### User Clients

- [Web application](https://github.com/itssubroto/reelvault/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [API client](https://github.com/itssubroto/reelvault/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`
- [Browser extension](https://github.com/itssubroto/reelvault/blob/main/extension/content.js): `extension/content.js`
- [Extension service worker](https://github.com/itssubroto/reelvault/blob/main/extension/background.js): `extension/background.js`
- [Authentication UI](https://github.com/itssubroto/reelvault/blob/main/frontend/src/components/AuthModal.jsx): `frontend/src/components/AuthModal.jsx`

### REST API

- [REST API application](https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/BackendApplication.java): `backend/src/main/java/com/reelvault/BackendApplication.java`
- [Reel endpoints](https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/controller/ReelController.java): `backend/src/main/java/com/reelvault/controller/ReelController.java`
- [Collection endpoints](https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/controller/CollectionController.java): `backend/src/main/java/com/reelvault/controller/CollectionController.java`
- [Authentication endpoints](https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/controller/AuthController.java): `backend/src/main/java/com/reelvault/controller/AuthController.java`

### Reel Domain

- [Reel management](https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/service/ReelService.java): `backend/src/main/java/com/reelvault/service/ReelService.java`
- [Collection management](https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/service/CollectionService.java): `backend/src/main/java/com/reelvault/service/CollectionService.java`
- [Authentication logic](https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/service/AuthService.java): `backend/src/main/java/com/reelvault/service/AuthService.java`
- [Search logic](https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/service/SearchService.java): `backend/src/main/java/com/reelvault/service/SearchService.java`
- [Platform metadata fetcher](https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/service/InstagramService.java): `backend/src/main/java/com/reelvault/service/InstagramService.java`
- [User, collection and reel models](https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/entity/Reel.java): `backend/src/main/java/com/reelvault/entity/Reel.java`
- [Reel repository](https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/repository/ReelRepository.java): `backend/src/main/java/com/reelvault/repository/ReelRepository.java`
- [Collection repository](https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/repository/CollectionRepository.java): `backend/src/main/java/com/reelvault/repository/CollectionRepository.java`
- [User repository](https://github.com/itssubroto/reelvault/blob/main/backend/src/main/java/com/reelvault/repository/UserRepository.java): `backend/src/main/java/com/reelvault/repository/UserRepository.java`

### AI Enrichment

- [AI processing API](https://github.com/itssubroto/reelvault/blob/main/ai-service/main.py): `ai-service/main.py`
- [Video metadata extraction](https://github.com/itssubroto/reelvault/blob/main/ai-service/services/metadata.py): `ai-service/services/metadata.py`
- [Transcription and summaries](https://github.com/itssubroto/reelvault/blob/main/ai-service/services/ai_pipeline.py): `ai-service/services/ai_pipeline.py`

### Other components

- **ReelVault user**
- **PostgreSQL**
- **Video platform sources**
- **AI model providers**

## Connections

- ReelVault user → Web application: uses
- Web application → API client: requests data (evidence: `frontend/src/App.jsx`)
- Authentication UI → API client: authenticates via (evidence: `frontend/src/components/AuthModal.jsx`)
- API client → REST API application: calls REST API (evidence: `frontend/src/api/client.js`)
- ReelVault user → Browser extension: saves reels
- Browser extension → Extension service worker: requests API proxy
- Extension service worker → REST API application: proxies API requests
- REST API application → Reel endpoints: serves endpoints
- REST API application → Collection endpoints: serves endpoints
- REST API application → Authentication endpoints: serves endpoints
- Reel endpoints → Reel management: delegates reel operations (evidence: `backend/src/main/java/com/reelvault/controller/ReelController.java`)
- Collection endpoints → Collection management: delegates collection operations (evidence: `backend/src/main/java/com/reelvault/controller/CollectionController.java`)
- Authentication endpoints → Authentication logic: delegates authentication (evidence: `backend/src/main/java/com/reelvault/controller/AuthController.java`)
- Reel management → Reel repository: reads and writes reels (evidence: `backend/src/main/java/com/reelvault/service/ReelService.java`)
- Collection management → Collection repository: reads and writes collections (evidence: `backend/src/main/java/com/reelvault/service/CollectionService.java`)
- Authentication logic → User repository: looks up and saves users (evidence: `backend/src/main/java/com/reelvault/service/AuthService.java`)
- Authentication logic → Collection repository: creates default collection (evidence: `backend/src/main/java/com/reelvault/service/AuthService.java`)
- Reel management → Collection management: resolves collections (evidence: `backend/src/main/java/com/reelvault/service/ReelService.java`)
- Reel management → Platform metadata fetcher: fetches platform metadata (evidence: `backend/src/main/java/com/reelvault/service/ReelService.java`)
- Search logic → Reel repository: searches indexed fields (evidence: `backend/src/main/java/com/reelvault/service/SearchService.java`)
- Search logic → Reel management: formats results (evidence: `backend/src/main/java/com/reelvault/service/SearchService.java`)
- Reel repository → PostgreSQL: persists reel data
- Collection repository → PostgreSQL: persists collections
- User repository → PostgreSQL: persists users
- Reel management → AI processing API: requests processing
- AI processing API → Video metadata extraction: extracts metadata (evidence: `ai-service/main.py`)
- AI processing API → Transcription and summaries: runs AI pipeline (evidence: `ai-service/main.py`)
- Video metadata extraction → Video platform sources: extracts video details (evidence: `ai-service/services/metadata.py`)
- Transcription and summaries → Video metadata extraction: uses metadata service (evidence: `ai-service/services/ai_pipeline.py`)
- Transcription and summaries → AI model providers: generates summaries (evidence: `ai-service/services/ai_pipeline.py`)
- Transcription and summaries → REST API application: patches reel results (evidence: `ai-service/services/ai_pipeline.py`)
