# ehsaanullah0/ehsaanplay architecture

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

- Interactive diagram: https://gitdiagram.com/ehsaanullah0/ehsaanplay
- Repository: https://github.com/ehsaanullah0/ehsaanplay

## Overview

EHSAAN PLAY is a personal movie and TV library, not a streaming service. Users discover or search titles, add them to a local library, track watch status and progress, rate and annotate items, and organize custom lists. Artwork is handled separately from personal data; the app also offers IMDb metadata fallback, offline/PWA support, and beta peer-to-peer device sync. The graph reflects documented capabilities and visible imports; many UI-to-app wiring paths were not sampled, so those connections are omitted.

Main entry points: [`src/components/imdb/ImdbPreviewModal.tsx`](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/components/imdb/ImdbPreviewModal.tsx) (IMDb Import), [`src/services/webrtcManager.ts`](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/services/webrtcManager.ts) (Peer Sync), [`src/services/storage.ts`](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/services/storage.ts) (Library Storage), [`src/services/imageStorage.ts`](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/services/imageStorage.ts) (Artwork Cache)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_library["Library Experience"]
  node_app["EHSAAN PLAY<br/>[App.tsx]"]
  node_home["Home Discovery<br/>[HomeView.tsx]"]
  node_watchlist["Watchlist Tracking<br/>[WatchlistView.tsx]"]
  node_lists["Custom Lists<br/>[ListsView.tsx]"]
  node_preview["Title Preview"]
  node_movie_model["Media Model<br/>[movie.ts]"]
end

subgraph group_metadata["Discovery Metadata"]
  node_search["Title Search<br/>[SearchModal.tsx]"]
  node_metadata_fallback["Metadata Fallback"]
  node_imdb_preview["IMDb Import"]
  node_imdb_parser["IMDb Parser<br/>[imdbParser.ts]"]
  node_omdb["OMDb Metadata<br/>[omdb.ts]"]
end

subgraph group_persistence["Local Data Artwork"]
  node_local_storage[("Library Storage<br/>[storage.ts]")]
  node_image_storage[("Artwork Cache<br/>[imageStorage.ts]")]
  node_service_worker["PWA Shell<br/>[sw.js]"]
end

subgraph group_sync["Device Sync"]
  node_device_transfer["Transfer Logic<br/>[deviceTransfer.ts]"]
  node_webrtc["Peer Sync<br/>[webrtcManager.ts]"]
  node_signaling_server["Signaling Server<br/>[server.ts]"]
end

node_user(("Viewer"))

node_user -->|"uses"| node_app
node_search -->|"searches via"| node_metadata_fallback
node_imdb_preview -->|"parses input"| node_imdb_parser
node_imdb_preview -->|"fetches metadata"| node_omdb
node_preview -->|"saves library"| node_local_storage
node_local_storage -->|"stores media"| node_movie_model
node_image_storage -->|"uses artwork fields"| node_movie_model
node_service_worker -.->|"falls back to artwork cache"| node_image_storage
node_webrtc -->|"uses device identity"| node_device_transfer
node_webrtc -.->|"signals peers"| node_signaling_server

click node_app "https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/App.tsx"
click node_home "https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/components/home/HomeView.tsx"
click node_watchlist "https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/components/watchlist/WatchlistView.tsx"
click node_lists "https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/components/lists/ListsView.tsx"
click node_preview "https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/components/preview/MoviePreviewModal.tsx"
click node_movie_model "https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/types/movie.ts"
click node_search "https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/components/search/SearchModal.tsx"
click node_metadata_fallback "https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/services/metadataFallback.ts"
click node_imdb_preview "https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/components/imdb/ImdbPreviewModal.tsx"
click node_imdb_parser "https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/services/imdbParser.ts"
click node_omdb "https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/services/omdb.ts"
click node_local_storage "https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/services/storage.ts"
click node_image_storage "https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/services/imageStorage.ts"
click node_service_worker "https://github.com/ehsaanullah0/ehsaanplay/blob/main/public/sw.js"
click node_device_transfer "https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/services/deviceTransfer.ts"
click node_webrtc "https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/services/webrtcManager.ts"
click node_signaling_server "https://github.com/ehsaanullah0/ehsaanplay/blob/main/server.ts"

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_watchlist,node_lists,node_preview,node_movie_model,node_user toneBlue
class node_search,node_metadata_fallback,node_imdb_preview,node_imdb_parser,node_omdb toneAmber
class node_local_storage,node_image_storage,node_service_worker toneMint
class node_device_transfer,node_webrtc,node_signaling_server toneRose
```

## Components

### Library Experience

- [EHSAAN PLAY](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/App.tsx): `src/App.tsx`
- [Home Discovery](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/components/home/HomeView.tsx): `src/components/home/HomeView.tsx`
- [Watchlist Tracking](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/components/watchlist/WatchlistView.tsx): `src/components/watchlist/WatchlistView.tsx`
- [Custom Lists](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/components/lists/ListsView.tsx): `src/components/lists/ListsView.tsx`
- [Title Preview](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/components/preview/MoviePreviewModal.tsx): `src/components/preview/MoviePreviewModal.tsx`
- [Media Model](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/types/movie.ts): `src/types/movie.ts`

### Discovery Metadata

- [Title Search](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/components/search/SearchModal.tsx): `src/components/search/SearchModal.tsx`
- [Metadata Fallback](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/services/metadataFallback.ts): `src/services/metadataFallback.ts`
- [IMDb Import](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/components/imdb/ImdbPreviewModal.tsx): `src/components/imdb/ImdbPreviewModal.tsx`
- [IMDb Parser](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/services/imdbParser.ts): `src/services/imdbParser.ts`
- [OMDb Metadata](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/services/omdb.ts): `src/services/omdb.ts`

### Local Data Artwork

- [Library Storage](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/services/storage.ts): `src/services/storage.ts`
- [Artwork Cache](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/services/imageStorage.ts): `src/services/imageStorage.ts`
- [PWA Shell](https://github.com/ehsaanullah0/ehsaanplay/blob/main/public/sw.js): `public/sw.js`

### Device Sync

- [Transfer Logic](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/services/deviceTransfer.ts): `src/services/deviceTransfer.ts`
- [Peer Sync](https://github.com/ehsaanullah0/ehsaanplay/blob/main/src/services/webrtcManager.ts): `src/services/webrtcManager.ts`
- [Signaling Server](https://github.com/ehsaanullah0/ehsaanplay/blob/main/server.ts): `server.ts`

### Other components

- **Viewer**

## Connections

- Viewer → EHSAAN PLAY: uses (evidence: `README.md`)
- Title Search → Metadata Fallback: searches via (evidence: `src/components/search/SearchModal.tsx`)
- IMDb Import → IMDb Parser: parses input (evidence: `src/components/imdb/ImdbPreviewModal.tsx`)
- IMDb Import → OMDb Metadata: fetches metadata (evidence: `src/components/imdb/ImdbPreviewModal.tsx`)
- Title Preview → Library Storage: saves library (evidence: `src/components/preview/MoviePreviewModal.tsx`)
- Library Storage → Media Model: stores media (evidence: `src/services/storage.ts`)
- Artwork Cache → Media Model: uses artwork fields (evidence: `src/services/imageStorage.ts`)
- PWA Shell → Artwork Cache: falls back to artwork cache
- Peer Sync → Transfer Logic: uses device identity (evidence: `src/services/webrtcManager.ts`)
- Peer Sync → Signaling Server: signals peers
