# pratikonly/pirateone-lovable architecture

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

- Interactive diagram: https://gitdiagram.com/pratikonly/pirateone-lovable
- Repository: https://github.com/pratikonly/pirateone-lovable

## Overview

Pirate-v2 is a media discovery and streaming web app. Users browse movie, series, and anime catalogs, search for titles, open a watch page, and track viewing progress or saved titles. Live and sports pages are additional product areas. The graph reflects the sampled client routing and service calls; several page implementations and server proxy handlers were not sampled, so their internal relationships are omitted where unverified.

Main entry points: [`src/App.tsx`](https://github.com/pratikonly/pirateone-lovable/blob/main/src/App.tsx) (App routes), [`src/pages/Watch.tsx`](https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Watch.tsx) (Watch page), [`src/pages/Index.tsx`](https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Index.tsx) (Home catalog), [`src/lib/tmdb.ts`](https://github.com/pratikonly/pirateone-lovable/blob/main/src/lib/tmdb.ts) (TMDb client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App routing"]
  node_app["App routes<br/>[App.tsx]"]
  node_help["Help<br/>[Help.tsx]"]
end

subgraph group_discovery["Media discovery"]
  node_home["Home catalog<br/>[Index.tsx]"]
  node_search["Search<br/>[Search.tsx]"]
  node_catalog["Catalog pages<br/>[CatalogPage.tsx]"]
  node_movie_rows["Media rows<br/>[MovieRow.tsx]"]
  node_reviews["Community reviews<br/>[TMDBReviews.tsx]"]
  node_sports["Sports<br/>[Sports.tsx]"]
  node_live["Live media<br/>[Live.tsx]"]
end

subgraph group_watching["Viewing and lists"]
  node_watch["Watch page<br/>[Watch.tsx]"]
  node_video["Video player<br/>[VideoPlayer.tsx]"]
  node_watch_progress["Watch progress<br/>[watchProgress.ts]"]
  node_continue["Continue watching"]
  node_watchlist["Watchlist data<br/>[watchlistDb.ts]"]
  node_watchlist_page["Watchlist page<br/>[Watchlist.tsx]"]
end

subgraph group_identity["Identity and state"]
  node_auth["Authentication<br/>[AuthContext.tsx]"]
  node_identity_context["Pirate identity"]
  node_settings["Settings<br/>[Settings.tsx]"]
end

subgraph group_services["Data services"]
  node_supabase["Supabase client<br/>[client.ts]"]
  node_tmdb["TMDb client<br/>[tmdb.ts]"]
  node_tmdb_proxy["TMDb proxy endpoint<br/>[tmdb-proxy.ts]"]
  node_anilist["AniList client<br/>[anilist.ts]"]
end

node_visitor(("Viewer"))

node_visitor -->|"opens app"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_search
node_app -->|"routes to"| node_watch
node_app -->|"routes to"| node_watchlist_page
node_app -->|"routes to"| node_sports
node_app -->|"routes to"| node_live
node_app -->|"routes to"| node_settings
node_app -->|"routes to"| node_help
node_app -->|"provides context"| node_auth
node_app -->|"provides context"| node_identity_context
node_home -->|"fetches catalog"| node_tmdb
node_home -->|"fetches anime"| node_anilist
node_home -->|"loads progress"| node_watch_progress
node_home -->|"renders rows"| node_movie_rows
node_home -->|"renders progress"| node_continue
node_search -->|"searches titles"| node_tmdb
node_watch -->|"loads title data"| node_tmdb
node_watch -->|"loads anime data"| node_anilist
node_watch -->|"renders player"| node_video
node_watch -->|"updates progress"| node_watch_progress
node_watch -->|"uses saved titles"| node_watchlist
node_watch -->|"renders reviews"| node_reviews
node_continue -->|"loads title details"| node_tmdb
node_continue -->|"reads progress"| node_watch_progress
node_watchlist_page -->|"uses watchlist data"| node_watchlist
node_auth -->|"authenticates with"| node_supabase
node_identity_context -->|"reads user"| node_auth
node_identity_context -->|"reads profiles"| node_supabase
node_identity_context -->|"loads guest identity"| node_visitor
node_tmdb -->|"posts requests"| node_tmdb_proxy
node_catalog -.->|"catalog data"| node_tmdb
node_sports -.->|"related live content"| node_live

click node_app "https://github.com/pratikonly/pirateone-lovable/blob/main/src/App.tsx"
click node_home "https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Index.tsx"
click node_search "https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Search.tsx"
click node_catalog "https://github.com/pratikonly/pirateone-lovable/blob/main/src/components/CatalogPage.tsx"
click node_movie_rows "https://github.com/pratikonly/pirateone-lovable/blob/main/src/components/MovieRow.tsx"
click node_reviews "https://github.com/pratikonly/pirateone-lovable/blob/main/src/components/TMDBReviews.tsx"
click node_watch "https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Watch.tsx"
click node_video "https://github.com/pratikonly/pirateone-lovable/blob/main/src/components/VideoPlayer.tsx"
click node_watch_progress "https://github.com/pratikonly/pirateone-lovable/blob/main/src/lib/watchProgress.ts"
click node_continue "https://github.com/pratikonly/pirateone-lovable/blob/main/src/components/ContinueWatching.tsx"
click node_watchlist "https://github.com/pratikonly/pirateone-lovable/blob/main/src/lib/watchlistDb.ts"
click node_watchlist_page "https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Watchlist.tsx"
click node_sports "https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Sports.tsx"
click node_live "https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Live.tsx"
click node_auth "https://github.com/pratikonly/pirateone-lovable/blob/main/src/contexts/AuthContext.tsx"
click node_identity_context "https://github.com/pratikonly/pirateone-lovable/blob/main/src/contexts/PirateIdentityContext.tsx"
click node_settings "https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Settings.tsx"
click node_supabase "https://github.com/pratikonly/pirateone-lovable/blob/main/src/integrations/supabase/client.ts"
click node_tmdb "https://github.com/pratikonly/pirateone-lovable/blob/main/src/lib/tmdb.ts"
click node_tmdb_proxy "https://github.com/pratikonly/pirateone-lovable/blob/main/api/tmdb-proxy.ts"
click node_anilist "https://github.com/pratikonly/pirateone-lovable/blob/main/src/lib/anilist.ts"
click node_help "https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Help.tsx"

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_help,node_visitor toneBlue
class node_home,node_search,node_catalog,node_movie_rows,node_reviews,node_sports,node_live toneAmber
class node_watch,node_video,node_watch_progress,node_continue,node_watchlist,node_watchlist_page toneMint
class node_auth,node_identity_context,node_settings toneRose
class node_supabase,node_tmdb,node_tmdb_proxy,node_anilist toneIndigo
```

## Components

### App routing

- [App routes](https://github.com/pratikonly/pirateone-lovable/blob/main/src/App.tsx): `src/App.tsx`
- [Help](https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Help.tsx): `src/pages/Help.tsx`

### Media discovery

- [Home catalog](https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Index.tsx): `src/pages/Index.tsx`
- [Search](https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Search.tsx): `src/pages/Search.tsx`
- [Catalog pages](https://github.com/pratikonly/pirateone-lovable/blob/main/src/components/CatalogPage.tsx): `src/components/CatalogPage.tsx`
- [Media rows](https://github.com/pratikonly/pirateone-lovable/blob/main/src/components/MovieRow.tsx): `src/components/MovieRow.tsx`
- [Community reviews](https://github.com/pratikonly/pirateone-lovable/blob/main/src/components/TMDBReviews.tsx): `src/components/TMDBReviews.tsx`
- [Sports](https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Sports.tsx): `src/pages/Sports.tsx`
- [Live media](https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Live.tsx): `src/pages/Live.tsx`

### Viewing and lists

- [Watch page](https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Watch.tsx): `src/pages/Watch.tsx`
- [Video player](https://github.com/pratikonly/pirateone-lovable/blob/main/src/components/VideoPlayer.tsx): `src/components/VideoPlayer.tsx`
- [Watch progress](https://github.com/pratikonly/pirateone-lovable/blob/main/src/lib/watchProgress.ts): `src/lib/watchProgress.ts`
- [Continue watching](https://github.com/pratikonly/pirateone-lovable/blob/main/src/components/ContinueWatching.tsx): `src/components/ContinueWatching.tsx`
- [Watchlist data](https://github.com/pratikonly/pirateone-lovable/blob/main/src/lib/watchlistDb.ts): `src/lib/watchlistDb.ts`
- [Watchlist page](https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Watchlist.tsx): `src/pages/Watchlist.tsx`

### Identity and state

- [Authentication](https://github.com/pratikonly/pirateone-lovable/blob/main/src/contexts/AuthContext.tsx): `src/contexts/AuthContext.tsx`
- [Pirate identity](https://github.com/pratikonly/pirateone-lovable/blob/main/src/contexts/PirateIdentityContext.tsx): `src/contexts/PirateIdentityContext.tsx`
- [Settings](https://github.com/pratikonly/pirateone-lovable/blob/main/src/pages/Settings.tsx): `src/pages/Settings.tsx`

### Data services

- [Supabase client](https://github.com/pratikonly/pirateone-lovable/blob/main/src/integrations/supabase/client.ts): `src/integrations/supabase/client.ts`
- [TMDb client](https://github.com/pratikonly/pirateone-lovable/blob/main/src/lib/tmdb.ts): `src/lib/tmdb.ts`
- [TMDb proxy endpoint](https://github.com/pratikonly/pirateone-lovable/blob/main/api/tmdb-proxy.ts): `api/tmdb-proxy.ts`
- [AniList client](https://github.com/pratikonly/pirateone-lovable/blob/main/src/lib/anilist.ts): `src/lib/anilist.ts`

### Other components

- **Viewer**

## Connections

- Viewer → App routes: opens app (evidence: `src/App.tsx`)
- App routes → Home catalog: routes to (evidence: `src/App.tsx`)
- App routes → Search: routes to (evidence: `src/App.tsx`)
- App routes → Watch page: routes to (evidence: `src/App.tsx`)
- App routes → Watchlist page: routes to (evidence: `src/App.tsx`)
- App routes → Sports: routes to (evidence: `src/App.tsx`)
- App routes → Live media: routes to (evidence: `src/App.tsx`)
- App routes → Settings: routes to (evidence: `src/App.tsx`)
- App routes → Help: routes to (evidence: `src/App.tsx`)
- App routes → Authentication: provides context (evidence: `src/App.tsx`)
- App routes → Pirate identity: provides context (evidence: `src/App.tsx`)
- Home catalog → TMDb client: fetches catalog (evidence: `src/pages/Index.tsx`)
- Home catalog → AniList client: fetches anime (evidence: `src/pages/Index.tsx`)
- Home catalog → Watch progress: loads progress (evidence: `src/pages/Index.tsx`)
- Home catalog → Media rows: renders rows (evidence: `src/pages/Index.tsx`)
- Home catalog → Continue watching: renders progress (evidence: `src/pages/Index.tsx`)
- Search → TMDb client: searches titles (evidence: `src/pages/Search.tsx`)
- Watch page → TMDb client: loads title data (evidence: `src/pages/Watch.tsx`)
- Watch page → AniList client: loads anime data (evidence: `src/pages/Watch.tsx`)
- Watch page → Video player: renders player (evidence: `src/pages/Watch.tsx`)
- Watch page → Watch progress: updates progress (evidence: `src/pages/Watch.tsx`)
- Watch page → Watchlist data: uses saved titles (evidence: `src/pages/Watch.tsx`)
- Watch page → Community reviews: renders reviews (evidence: `src/pages/Watch.tsx`)
- Continue watching → TMDb client: loads title details (evidence: `src/components/ContinueWatching.tsx`)
- Continue watching → Watch progress: reads progress (evidence: `src/components/ContinueWatching.tsx`)
- Watchlist page → Watchlist data: uses watchlist data
- Authentication → Supabase client: authenticates with (evidence: `src/contexts/AuthContext.tsx`)
- Pirate identity → Authentication: reads user (evidence: `src/contexts/PirateIdentityContext.tsx`)
- Pirate identity → Supabase client: reads profiles (evidence: `src/contexts/PirateIdentityContext.tsx`)
- Pirate identity → Viewer: loads guest identity (evidence: `src/contexts/PirateIdentityContext.tsx`)
- TMDb client → TMDb proxy endpoint: posts requests (evidence: `src/lib/tmdb.ts`)
- Catalog pages → TMDb client: catalog data
- Sports → Live media: related live content
