# ehpanda-team/ehpanda architecture

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

- Interactive diagram: https://gitdiagram.com/ehpanda-team/ehpanda
- Repository: https://github.com/ehpanda-team/ehpanda

## Overview

EhPanda is an unofficial iOS client for E-Hentai. The main user journey is to browse or search galleries, open gallery details and associated material, then view previews and read pages; deep links can enter that flow directly. Gallery metadata, reading progress, and preview URLs are backed by local persistence, while requests and HTML parsing support the remote catalog. The tree also shows account, favorites, history, rankings, comments, torrents, and settings features. Sampled excerpts establish only some wiring, so uncertain connections between unsampled feature reducers and views are omitted.

Main entry points: [`EhPanda/Network/Request.swift`](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/Network/Request.swift) (Request transport), [`EhPanda/DataFlow/AppRouteReducer.swift`](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/DataFlow/AppRouteReducer.swift) (App routes), [`EhPanda/View/Detail/Previews/PreviewsReducer.swift`](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Detail/Previews/PreviewsReducer.swift) (Gallery previews), [`EhPanda/App/Tools/Clients/DatabaseClient.swift`](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/App/Tools/Clients/DatabaseClient.swift) (Database client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App navigation"]
  node_app_entry["App entry<br/>[EhPandaApp.swift]"]
  node_routes["App routes"]
  node_tabs["Tab navigation"]
  node_share_extension["Share extension"]
end

subgraph group_discovery["Gallery discovery"]
  node_home["Home feeds"]
  node_search["Gallery search"]
  node_filters["Gallery filters"]
  node_favorites["Favorites"]
end

subgraph group_gallery["Gallery experience"]
  node_gallery_detail["Gallery details"]
  node_gallery_extras["Detail sections"]
  node_previews["Gallery previews"]
  node_reading["Page reader"]
  node_live_text["Live text"]
  node_history["Reading history"]
end

subgraph group_platform["Network and storage"]
  node_network["Request transport<br/>[Request.swift]"]
  node_parser["HTML parsing<br/>[Parser.swift]"]
  node_database_client["Database client"]
  node_persistence[("Core Data store<br/>[Persistence.swift]")]
end

subgraph group_account["Account and settings"]
  node_settings["Settings"]
  node_login["Account login<br/>[LoginReducer.swift]"]
end

node_user(("User"))
node_remote_site{{"E-Hentai"}}

node_user -->|"opens"| node_app_entry
node_share_extension -->|"opens deep link"| node_app_entry
node_routes -->|"dispatches detail"| node_gallery_detail
node_routes -->|"checks gallery"| node_database_client
node_routes -->|"fetches gallery"| node_network
node_previews -->|"requests previews"| node_network
node_previews -->|"loads and saves"| node_database_client
node_previews -->|"opens reader"| node_reading
node_database_client -->|"reads and writes"| node_persistence
node_network -->|"sends requests"| node_remote_site
node_network -->|"parses responses"| node_parser
node_live_text -->|"presents recognized text"| node_user

click node_app_entry "https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/App/EhPandaApp.swift"
click node_routes "https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/DataFlow/AppRouteReducer.swift"
click node_tabs "https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/TabBar/TabBarReducer.swift"
click node_home "https://github.com/ehpanda-team/ehpanda/tree/main/EhPanda/View/Home"
click node_search "https://github.com/ehpanda-team/ehpanda/tree/main/EhPanda/View/Search"
click node_filters "https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Support/FiltersReducer.swift"
click node_favorites "https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Favorites/FavoritesReducer.swift"
click node_gallery_detail "https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Detail/DetailReducer.swift"
click node_gallery_extras "https://github.com/ehpanda-team/ehpanda/tree/main/EhPanda/View/Detail"
click node_previews "https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Detail/Previews/PreviewsReducer.swift"
click node_reading "https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Reading/ReadingReducer.swift"
click node_live_text "https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Reading/Support/LiveTextHandler.swift"
click node_history "https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Home/History/HistoryReducer.swift"
click node_network "https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/Network/Request.swift"
click node_parser "https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/App/Tools/Parser.swift"
click node_database_client "https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/App/Tools/Clients/DatabaseClient.swift"
click node_persistence "https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/Database/Persistence.swift"
click node_settings "https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Setting/SettingReducer.swift"
click node_login "https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Setting/Login/LoginReducer.swift"
click node_share_extension "https://github.com/ehpanda-team/ehpanda/blob/main/ShareExtension/ShareViewController.swift"

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_entry,node_routes,node_tabs,node_share_extension,node_user toneBlue
class node_home,node_search,node_filters,node_favorites toneAmber
class node_gallery_detail,node_gallery_extras,node_previews,node_reading,node_live_text,node_history toneMint
class node_network,node_parser,node_database_client,node_persistence toneRose
class node_settings,node_login,node_remote_site toneIndigo
```

## Components

### App navigation

- [App entry](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/App/EhPandaApp.swift): `EhPanda/App/EhPandaApp.swift`
- [App routes](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/DataFlow/AppRouteReducer.swift): `EhPanda/DataFlow/AppRouteReducer.swift`
- [Tab navigation](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/TabBar/TabBarReducer.swift): `EhPanda/View/TabBar/TabBarReducer.swift`
- [Share extension](https://github.com/ehpanda-team/ehpanda/blob/main/ShareExtension/ShareViewController.swift): `ShareExtension/ShareViewController.swift`

### Gallery discovery

- [Home feeds](https://github.com/ehpanda-team/ehpanda/tree/main/EhPanda/View/Home): `EhPanda/View/Home`
- [Gallery search](https://github.com/ehpanda-team/ehpanda/tree/main/EhPanda/View/Search): `EhPanda/View/Search`
- [Gallery filters](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Support/FiltersReducer.swift): `EhPanda/View/Support/FiltersReducer.swift`
- [Favorites](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Favorites/FavoritesReducer.swift): `EhPanda/View/Favorites/FavoritesReducer.swift`

### Gallery experience

- [Gallery details](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Detail/DetailReducer.swift): `EhPanda/View/Detail/DetailReducer.swift`
- [Detail sections](https://github.com/ehpanda-team/ehpanda/tree/main/EhPanda/View/Detail): `EhPanda/View/Detail`
- [Gallery previews](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Detail/Previews/PreviewsReducer.swift): `EhPanda/View/Detail/Previews/PreviewsReducer.swift`
- [Page reader](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Reading/ReadingReducer.swift): `EhPanda/View/Reading/ReadingReducer.swift`
- [Live text](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Reading/Support/LiveTextHandler.swift): `EhPanda/View/Reading/Support/LiveTextHandler.swift`
- [Reading history](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Home/History/HistoryReducer.swift): `EhPanda/View/Home/History/HistoryReducer.swift`

### Network and storage

- [Request transport](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/Network/Request.swift): `EhPanda/Network/Request.swift`
- [HTML parsing](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/App/Tools/Parser.swift): `EhPanda/App/Tools/Parser.swift`
- [Database client](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/App/Tools/Clients/DatabaseClient.swift): `EhPanda/App/Tools/Clients/DatabaseClient.swift`
- [Core Data store](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/Database/Persistence.swift): `EhPanda/Database/Persistence.swift`

### Account and settings

- [Settings](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Setting/SettingReducer.swift): `EhPanda/View/Setting/SettingReducer.swift`
- [Account login](https://github.com/ehpanda-team/ehpanda/blob/main/EhPanda/View/Setting/Login/LoginReducer.swift): `EhPanda/View/Setting/Login/LoginReducer.swift`

### Other components

- **User**
- **E-Hentai**

## Connections

- User → App entry: opens
- Share extension → App entry: opens deep link
- App routes → Gallery details: dispatches detail
- App routes → Database client: checks gallery
- App routes → Request transport: fetches gallery
- Gallery previews → Request transport: requests previews
- Gallery previews → Database client: loads and saves
- Gallery previews → Page reader: opens reader
- Database client → Core Data store: reads and writes
- Request transport → E-Hentai: sends requests
- Request transport → HTML parsing: parses responses
- Live text → User: presents recognized text
