# mal-xa/sora-s-stream architecture

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

- Interactive diagram: https://gitdiagram.com/mal-xa/sora-s-stream
- Repository: https://github.com/mal-xa/sora-s-stream

## Overview

Sora’s Stream is a React/Capacitor video-streaming app backed by Supabase. Users enter through the routed app, authenticate, browse video categories and collections, and play or rent content; administrators manage videos, rentals, and users. The graph also shows the internal data-access layer. Some feature modules are documented or indexed but were not excerpted, so their connections are included only where the README documents the capability; edges from source excerpts cite the file showing the relationship.

Main entry points: [`src/App.tsx`](https://github.com/mal-xa/sora-s-stream/blob/main/src/App.tsx) (Routed app), [`src/hooks/useVideos.ts`](https://github.com/mal-xa/sora-s-stream/blob/main/src/hooks/useVideos.ts) (Video data hooks), [`src/components/VideoPlayer.tsx`](https://github.com/mal-xa/sora-s-stream/blob/main/src/components/VideoPlayer.tsx) (Video player), [`src/context/AuthContext.tsx`](https://github.com/mal-xa/sora-s-stream/blob/main/src/context/AuthContext.tsx) (Authentication state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and navigation"]
  node_app["Routed app<br/>[App.tsx]"]
end

subgraph group_identity["Identity and platform"]
  node_auth_page["Authentication page<br/>[Auth.tsx]"]
  node_auth_context["Authentication state<br/>[AuthContext.tsx]"]
  node_native_auth["Native Google auth"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
end

subgraph group_streaming["Streaming and library"]
  node_home["Home and browse<br/>[Index.tsx]"]
  node_categories["Video categories"]
  node_collections["Favorites and wishlist"]
  node_player["Video player<br/>[VideoPlayer.tsx]"]
  node_rental["Video rental<br/>[RentalModal.tsx]"]
  node_video_hooks["Video data hooks<br/>[useVideos.ts]"]
  node_video_types["Video domain types<br/>[video.ts]"]
end

subgraph group_operations["Administration"]
  node_admin_pages["Admin management"]
  node_admin_components["Admin UI"]
  node_db_utils["Database helpers<br/>[db-utils.ts]"]
end

node_viewer(("Viewer"))
node_supabase[("Supabase service")]

node_viewer -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_auth_page
node_app -->|"routes to"| node_categories
node_app -->|"routes to"| node_collections
node_auth_page -->|"uses auth"| node_auth_context
node_app -->|"provides auth"| node_auth_context
node_auth_context -->|"initializes"| node_supabase_client
node_supabase_client -->|"connects"| node_supabase
node_auth_context -->|"loads native auth"| node_native_auth
node_home -->|"loads videos"| node_video_hooks
node_categories -->|"loads videos"| node_video_hooks
node_video_hooks -->|"queries through"| node_supabase_client
node_video_hooks -->|"uses insert helper"| node_db_utils
node_video_hooks -->|"reads and writes"| node_supabase
node_home -->|"renders player"| node_player
node_player -->|"checks access"| node_supabase_client
node_player -->|"opens rental"| node_rental
node_player -->|"reads rental access"| node_supabase
node_admin_pages -.->|"uses admin UI"| node_admin_components
node_admin_pages -.->|"manages content and users"| node_supabase
node_viewer -->|"saves videos"| node_collections
node_viewer -->|"rents videos"| node_rental
node_video_hooks -->|"uses types"| node_video_types

click node_app "https://github.com/mal-xa/sora-s-stream/blob/main/src/App.tsx"
click node_home "https://github.com/mal-xa/sora-s-stream/blob/main/src/pages/Index.tsx"
click node_categories "https://github.com/mal-xa/sora-s-stream/tree/main/src/pages/Category"
click node_collections "https://github.com/mal-xa/sora-s-stream/tree/main/src/pages/Profile"
click node_player "https://github.com/mal-xa/sora-s-stream/blob/main/src/components/VideoPlayer.tsx"
click node_rental "https://github.com/mal-xa/sora-s-stream/blob/main/src/components/RentalModal.tsx"
click node_video_hooks "https://github.com/mal-xa/sora-s-stream/blob/main/src/hooks/useVideos.ts"
click node_video_types "https://github.com/mal-xa/sora-s-stream/blob/main/src/types/video.ts"
click node_auth_page "https://github.com/mal-xa/sora-s-stream/blob/main/src/pages/Auth.tsx"
click node_auth_context "https://github.com/mal-xa/sora-s-stream/blob/main/src/context/AuthContext.tsx"
click node_native_auth "https://github.com/mal-xa/sora-s-stream/blob/main/src/plugins/native-google-auth.ts"
click node_supabase_client "https://github.com/mal-xa/sora-s-stream/blob/main/src/lib/supabase.ts"
click node_admin_pages "https://github.com/mal-xa/sora-s-stream/tree/main/src/pages/Admin"
click node_admin_components "https://github.com/mal-xa/sora-s-stream/tree/main/src/components/Admin"
click node_db_utils "https://github.com/mal-xa/sora-s-stream/blob/main/src/lib/db-utils.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_viewer toneBlue
class node_auth_page,node_auth_context,node_native_auth,node_supabase_client,node_supabase toneAmber
class node_home,node_categories,node_collections,node_player,node_rental,node_video_hooks,node_video_types toneMint
class node_admin_pages,node_admin_components,node_db_utils toneRose
```

## Components

### App and navigation

- [Routed app](https://github.com/mal-xa/sora-s-stream/blob/main/src/App.tsx): `src/App.tsx`

### Identity and platform

- [Authentication page](https://github.com/mal-xa/sora-s-stream/blob/main/src/pages/Auth.tsx): `src/pages/Auth.tsx`
- [Authentication state](https://github.com/mal-xa/sora-s-stream/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Native Google auth](https://github.com/mal-xa/sora-s-stream/blob/main/src/plugins/native-google-auth.ts): `src/plugins/native-google-auth.ts`
- [Supabase client](https://github.com/mal-xa/sora-s-stream/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`

### Streaming and library

- [Home and browse](https://github.com/mal-xa/sora-s-stream/blob/main/src/pages/Index.tsx): `src/pages/Index.tsx`
- [Video categories](https://github.com/mal-xa/sora-s-stream/tree/main/src/pages/Category): `src/pages/Category`
- [Favorites and wishlist](https://github.com/mal-xa/sora-s-stream/tree/main/src/pages/Profile): `src/pages/Profile`
- [Video player](https://github.com/mal-xa/sora-s-stream/blob/main/src/components/VideoPlayer.tsx): `src/components/VideoPlayer.tsx`
- [Video rental](https://github.com/mal-xa/sora-s-stream/blob/main/src/components/RentalModal.tsx): `src/components/RentalModal.tsx`
- [Video data hooks](https://github.com/mal-xa/sora-s-stream/blob/main/src/hooks/useVideos.ts): `src/hooks/useVideos.ts`
- [Video domain types](https://github.com/mal-xa/sora-s-stream/blob/main/src/types/video.ts): `src/types/video.ts`

### Administration

- [Admin management](https://github.com/mal-xa/sora-s-stream/tree/main/src/pages/Admin): `src/pages/Admin`
- [Admin UI](https://github.com/mal-xa/sora-s-stream/tree/main/src/components/Admin): `src/components/Admin`
- [Database helpers](https://github.com/mal-xa/sora-s-stream/blob/main/src/lib/db-utils.ts): `src/lib/db-utils.ts`

### Other components

- **Viewer**
- **Supabase service**

## Connections

- Viewer → Routed app: opens (evidence: `README.md`)
- Routed app → Home and browse: routes to (evidence: `src/App.tsx`)
- Routed app → Authentication page: routes to (evidence: `src/App.tsx`)
- Routed app → Video categories: routes to (evidence: `src/App.tsx`)
- Routed app → Favorites and wishlist: routes to (evidence: `src/App.tsx`)
- Authentication page → Authentication state: uses auth (evidence: `src/pages/Auth.tsx`)
- Routed app → Authentication state: provides auth (evidence: `src/App.tsx`)
- Authentication state → Supabase client: initializes (evidence: `src/context/AuthContext.tsx`)
- Supabase client → Supabase service: connects (evidence: `src/lib/supabase.ts`)
- Authentication state → Native Google auth: loads native auth (evidence: `src/context/AuthContext.tsx`)
- Home and browse → Video data hooks: loads videos (evidence: `src/pages/Index.tsx`)
- Video categories → Video data hooks: loads videos (evidence: `src/pages/Category/Movies.tsx`)
- Video data hooks → Supabase client: queries through (evidence: `src/hooks/useVideos.ts`)
- Video data hooks → Database helpers: uses insert helper (evidence: `src/hooks/useVideos.ts`)
- Video data hooks → Supabase service: reads and writes (evidence: `src/hooks/useVideos.ts`)
- Home and browse → Video player: renders player (evidence: `src/pages/Index.tsx`)
- Video player → Supabase client: checks access (evidence: `src/components/VideoPlayer.tsx`)
- Video player → Video rental: opens rental (evidence: `src/components/VideoPlayer.tsx`)
- Video player → Supabase service: reads rental access (evidence: `src/components/VideoPlayer.tsx`)
- Admin management → Admin UI: uses admin UI
- Admin management → Supabase service: manages content and users (evidence: `README.md`)
- Viewer → Favorites and wishlist: saves videos (evidence: `README.md`)
- Viewer → Video rental: rents videos (evidence: `README.md`)
- Video data hooks → Video domain types: uses types (evidence: `src/hooks/useVideos.ts`)
