# airzz90/study-materials-fork architecture

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

- Interactive diagram: https://gitdiagram.com/airzz90/study-materials-fork
- Repository: https://github.com/airzz90/study-materials-fork

## Overview

HGhub is a cross-platform short-video and social-content client built with React and Tauri. Users browse home feeds, categories, search results, rankings, profiles and posts; selecting content opens an episode-aware player with comments and playback controls. Settings expose playback, security and diagnostics options. The native layer provides upstream API access, media proxying, network policy and local session/logging support. The excerpts establish the application shell, player composition, API invocation and selected native wiring; some page-to-service and backend details are not shown, so those links are omitted.

Main entry points: [`src/App.tsx`](https://github.com/airzz90/study-materials-fork/blob/main/src/App.tsx) (App navigation), [`src/components/Feed.tsx`](https://github.com/airzz90/study-materials-fork/blob/main/src/components/Feed.tsx) (Video feed), [`src-tauri/src/api.rs`](https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/api.rs) (Tauri command API), [`src-tauri/src/lib.rs`](https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/lib.rs) (Tauri runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_shell["App navigation<br/>[App.tsx]"]
  node_state["App state<br/>[store.tsx]"]
  node_chrome["Desktop chrome<br/>[DesktopChrome.tsx]"]
end

subgraph group_content["Content discovery"]
  node_home["Home feed<br/>[Home.tsx]"]
  node_feed["Video feed<br/>[Feed.tsx]"]
  node_search["Search and ranks<br/>[Search.tsx]"]
  node_category["Categories<br/>[Category.tsx]"]
  node_profile["User profiles<br/>[Profile.tsx]"]
  node_posts["Posts and details<br/>[Posts.tsx]"]
  node_cards["Content cards<br/>[cards.tsx]"]
end

subgraph group_play["Playback"]
  node_player["Player surface<br/>[VideoSurface.tsx]"]
  node_controls["Playback controls<br/>[PlayerControls.tsx]"]
  node_playerpage["Player page<br/>[Player.tsx]"]
  node_panels["Episode and comments<br/>[Panels.tsx]"]
  node_playdiag["Playback diagnostics"]
end

subgraph group_native["Native services"]
  node_clientapi["Client API<br/>[api.ts]"]
  node_nativeapi["Tauri command API<br/>[api.rs]"]
  node_net["Upstream networking<br/>[net.rs]"]
  node_policy["Network policy<br/>[network_policy.rs]"]
  node_media["Media proxy<br/>[media.rs]"]
  node_lines["Server lines<br/>[lines.rs]"]
  node_session["User session<br/>[session.rs]"]
  node_logs[("Playback logs<br/>[playback_log.rs]")]
  node_logging["App logging<br/>[logging.rs]"]
  node_entry["Tauri runtime<br/>[lib.rs]"]
end

node_user(("Viewer"))

node_user -->|"uses"| node_shell
node_shell -->|"renders"| node_home
node_shell -->|"renders"| node_search
node_shell -->|"renders"| node_category
node_shell -->|"renders"| node_profile
node_shell -->|"renders"| node_posts
node_shell -->|"renders"| node_chrome
node_shell -->|"reads"| node_state
node_home -->|"renders"| node_feed
node_category -->|"renders"| node_cards
node_search -->|"renders"| node_cards
node_feed -->|"renders"| node_player
node_feed -->|"renders"| node_controls
node_feed -->|"opens"| node_panels
node_playerpage -->|"records"| node_playdiag
node_player -->|"records"| node_playdiag
node_feed -->|"requests data"| node_clientapi
node_clientapi -->|"invokes commands"| node_entry
node_entry -->|"registers handlers"| node_nativeapi
node_nativeapi -->|"uses"| node_net
node_nativeapi -->|"uses"| node_session
node_nativeapi -->|"uses"| node_lines
node_nativeapi -->|"uses"| node_media
node_net -->|"checks targets"| node_policy
node_media -->|"fetches media"| node_net
node_net -->|"records events"| node_logs
node_logs -->|"uses"| node_logging
node_entry -->|"binds storage"| node_logs
node_entry -->|"binds storage"| node_session

click node_shell "https://github.com/airzz90/study-materials-fork/blob/main/src/App.tsx"
click node_state "https://github.com/airzz90/study-materials-fork/blob/main/src/store.tsx"
click node_chrome "https://github.com/airzz90/study-materials-fork/blob/main/src/components/DesktopChrome.tsx"
click node_home "https://github.com/airzz90/study-materials-fork/blob/main/src/pages/Home.tsx"
click node_feed "https://github.com/airzz90/study-materials-fork/blob/main/src/components/Feed.tsx"
click node_search "https://github.com/airzz90/study-materials-fork/blob/main/src/pages/Search.tsx"
click node_category "https://github.com/airzz90/study-materials-fork/blob/main/src/pages/Category.tsx"
click node_profile "https://github.com/airzz90/study-materials-fork/blob/main/src/pages/Profile.tsx"
click node_posts "https://github.com/airzz90/study-materials-fork/blob/main/src/pages/Posts.tsx"
click node_cards "https://github.com/airzz90/study-materials-fork/blob/main/src/components/cards.tsx"
click node_player "https://github.com/airzz90/study-materials-fork/blob/main/src/components/VideoSurface.tsx"
click node_controls "https://github.com/airzz90/study-materials-fork/blob/main/src/components/PlayerControls.tsx"
click node_playerpage "https://github.com/airzz90/study-materials-fork/blob/main/src/components/Player.tsx"
click node_panels "https://github.com/airzz90/study-materials-fork/blob/main/src/components/Panels.tsx"
click node_playdiag "https://github.com/airzz90/study-materials-fork/blob/main/src/playbackDiagnostics.ts"
click node_clientapi "https://github.com/airzz90/study-materials-fork/blob/main/src/api.ts"
click node_nativeapi "https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/api.rs"
click node_net "https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/net.rs"
click node_policy "https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/network_policy.rs"
click node_media "https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/media.rs"
click node_lines "https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/lines.rs"
click node_session "https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/session.rs"
click node_logs "https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/playback_log.rs"
click node_logging "https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/logging.rs"
click node_entry "https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/lib.rs"

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_shell,node_state,node_chrome,node_user toneBlue
class node_home,node_feed,node_search,node_category,node_profile,node_posts,node_cards toneAmber
class node_player,node_controls,node_playerpage,node_panels,node_playdiag toneMint
class node_clientapi,node_nativeapi,node_net,node_policy,node_media,node_lines,node_session,node_logs,node_logging,node_entry toneRose
```

## Components

### App shell

- [App navigation](https://github.com/airzz90/study-materials-fork/blob/main/src/App.tsx): `src/App.tsx`
- [App state](https://github.com/airzz90/study-materials-fork/blob/main/src/store.tsx): `src/store.tsx`
- [Desktop chrome](https://github.com/airzz90/study-materials-fork/blob/main/src/components/DesktopChrome.tsx): `src/components/DesktopChrome.tsx`

### Content discovery

- [Home feed](https://github.com/airzz90/study-materials-fork/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`
- [Video feed](https://github.com/airzz90/study-materials-fork/blob/main/src/components/Feed.tsx): `src/components/Feed.tsx`
- [Search and ranks](https://github.com/airzz90/study-materials-fork/blob/main/src/pages/Search.tsx): `src/pages/Search.tsx`
- [Categories](https://github.com/airzz90/study-materials-fork/blob/main/src/pages/Category.tsx): `src/pages/Category.tsx`
- [User profiles](https://github.com/airzz90/study-materials-fork/blob/main/src/pages/Profile.tsx): `src/pages/Profile.tsx`
- [Posts and details](https://github.com/airzz90/study-materials-fork/blob/main/src/pages/Posts.tsx): `src/pages/Posts.tsx`
- [Content cards](https://github.com/airzz90/study-materials-fork/blob/main/src/components/cards.tsx): `src/components/cards.tsx`

### Playback

- [Player surface](https://github.com/airzz90/study-materials-fork/blob/main/src/components/VideoSurface.tsx): `src/components/VideoSurface.tsx`
- [Playback controls](https://github.com/airzz90/study-materials-fork/blob/main/src/components/PlayerControls.tsx): `src/components/PlayerControls.tsx`
- [Player page](https://github.com/airzz90/study-materials-fork/blob/main/src/components/Player.tsx): `src/components/Player.tsx`
- [Episode and comments](https://github.com/airzz90/study-materials-fork/blob/main/src/components/Panels.tsx): `src/components/Panels.tsx`
- [Playback diagnostics](https://github.com/airzz90/study-materials-fork/blob/main/src/playbackDiagnostics.ts): `src/playbackDiagnostics.ts`

### Native services

- [Client API](https://github.com/airzz90/study-materials-fork/blob/main/src/api.ts): `src/api.ts`
- [Tauri command API](https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/api.rs): `src-tauri/src/api.rs`
- [Upstream networking](https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/net.rs): `src-tauri/src/net.rs`
- [Network policy](https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/network_policy.rs): `src-tauri/src/network_policy.rs`
- [Media proxy](https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/media.rs): `src-tauri/src/media.rs`
- [Server lines](https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/lines.rs): `src-tauri/src/lines.rs`
- [User session](https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/session.rs): `src-tauri/src/session.rs`
- [Playback logs](https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/playback_log.rs): `src-tauri/src/playback_log.rs`
- [App logging](https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/logging.rs): `src-tauri/src/logging.rs`
- [Tauri runtime](https://github.com/airzz90/study-materials-fork/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`

### Other components

- **Viewer**

## Connections

- Viewer → App navigation: uses (evidence: `src/App.tsx`)
- App navigation → Home feed: renders (evidence: `src/App.tsx`)
- App navigation → Search and ranks: renders (evidence: `src/App.tsx`)
- App navigation → Categories: renders (evidence: `src/App.tsx`)
- App navigation → User profiles: renders (evidence: `src/App.tsx`)
- App navigation → Posts and details: renders (evidence: `src/App.tsx`)
- App navigation → Desktop chrome: renders (evidence: `src/App.tsx`)
- App navigation → App state: reads (evidence: `src/App.tsx`)
- Home feed → Video feed: renders (evidence: `src/pages/Home.tsx`)
- Categories → Content cards: renders (evidence: `src/pages/Category.tsx`)
- Search and ranks → Content cards: renders (evidence: `src/pages/Search.tsx`)
- Video feed → Player surface: renders (evidence: `src/components/Feed.tsx`)
- Video feed → Playback controls: renders (evidence: `src/components/Feed.tsx`)
- Video feed → Episode and comments: opens (evidence: `src/components/Feed.tsx`)
- Player page → Playback diagnostics: records (evidence: `src/components/Player.tsx`)
- Player surface → Playback diagnostics: records (evidence: `src/components/VideoSurface.tsx`)
- Video feed → Client API: requests data (evidence: `src/components/Feed.tsx`)
- Client API → Tauri runtime: invokes commands (evidence: `src/api.ts`)
- Tauri runtime → Tauri command API: registers handlers (evidence: `src-tauri/src/lib.rs`)
- Tauri command API → Upstream networking: uses (evidence: `src-tauri/src/api.rs`)
- Tauri command API → User session: uses (evidence: `src-tauri/src/api.rs`)
- Tauri command API → Server lines: uses (evidence: `src-tauri/src/api.rs`)
- Tauri command API → Media proxy: uses (evidence: `src-tauri/src/api.rs`)
- Upstream networking → Network policy: checks targets (evidence: `src-tauri/src/net.rs`)
- Media proxy → Upstream networking: fetches media (evidence: `src-tauri/src/media.rs`)
- Upstream networking → Playback logs: records events (evidence: `src-tauri/src/net.rs`)
- Playback logs → App logging: uses (evidence: `src-tauri/src/playback_log.rs`)
- Tauri runtime → Playback logs: binds storage (evidence: `src-tauri/src/lib.rs`)
- Tauri runtime → User session: binds storage (evidence: `src-tauri/src/lib.rs`)
