# fakecodderck/hentai architecture

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

- Interactive diagram: https://gitdiagram.com/fakecodderck/hentai
- Repository: https://github.com/fakecodderck/hentai

## Overview

This is a web studio for extracting media-post details from websites, editing episode and post content, and publishing to Telegram. The principal workflow runs from the Studio interface through scraping, editing and preview, then Telegram delivery; separate branches support multi-post catalogs, a persistent data library, batch broadcasts, and scheduled/automated crawling. The graph includes the documented crawler and storage capabilities, but source excerpts are partial, so unshown connections are omitted rather than inferred.

Main entry points: [`src/App.tsx`](https://github.com/fakecodderck/hentai/blob/main/src/App.tsx) (Workspace shell), [`src/services/api.ts`](https://github.com/fakecodderck/hentai/blob/main/src/services/api.ts) (Client API), [`src/server/crawlerService.ts`](https://github.com/fakecodderck/hentai/blob/main/src/server/crawlerService.ts) (Crawler service), [`src/server/apiHandler.ts`](https://github.com/fakecodderck/hentai/blob/main/src/server/apiHandler.ts) (API handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Studio interface"]
  node_app["Workspace shell<br/>[App.tsx]"]
  node_scraper["Website scraper"]
  node_catalog["Multi-post catalog"]
  node_editor["Post editor<br/>[PostEditor.tsx]"]
  node_bulk["Episode parser"]
  node_gallery["Gallery display<br/>[GalleryDisplay.tsx]"]
  node_preview["Telegram preview"]
  node_settings["Telegram settings"]
  node_bot["Bot setup<br/>[BotSetupModal.tsx]"]
end

subgraph group_scrape["Extraction and crawling"]
  node_crawlerpanel["Crawler controls"]
  node_crawlerview["Crawler monitor"]
  node_flow["Flow builder<br/>[FlowBuilder.tsx]"]
  node_crawler["Crawler service<br/>[crawlerService.ts]"]
end

subgraph group_publish["Publishing"]
  node_batch["Batch sender<br/>[BatchSender.tsx]"]
  node_history["Send history<br/>[HistoryList.tsx]"]
end

subgraph group_data["Data and state"]
  node_api["Client API<br/>[api.ts]"]
  node_store["App state<br/>[useAppStore.ts]"]
  node_handler["API handlers<br/>[apiHandler.ts]"]
  node_storage[("Post library<br/>[storageManager.ts]")]
end

node_user(("Studio user"))
node_telegram{{"Telegram Bot API"}}
node_websites{{"Source websites"}}
node_library[("Data files")]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_scraper
node_app -->|"renders"| node_catalog
node_app -->|"renders"| node_editor
node_app -->|"renders"| node_preview
node_app -->|"renders"| node_settings
node_app -->|"renders"| node_batch
node_app -->|"renders"| node_history
node_app -.->|"renders"| node_crawlerpanel
node_app -.->|"renders"| node_crawlerview
node_app -.->|"renders"| node_flow
node_scraper -->|"requests scrape"| node_api
node_catalog -->|"scrapes URLs"| node_api
node_batch -->|"scrapes and sends"| node_api
node_preview -->|"sends post"| node_api
node_bot -->|"verifies bot"| node_api
node_editor -->|"renders"| node_gallery
node_bulk -->|"updates episodes"| node_store
node_editor -->|"reads and updates"| node_store
node_preview -->|"reads post settings"| node_store
node_api -->|"calls API routes"| node_handler
node_handler -->|"fetches page content"| node_websites
node_handler -->|"saves and loads posts"| node_storage
node_storage -->|"reads and writes"| node_library
node_api -->|"publishes messages"| node_telegram
node_api -.->|"controls crawler"| node_crawler
node_crawlerpanel -.->|"starts crawler"| node_api
node_crawlerview -->|"checks and stops"| node_api
node_crawler -->|"scrapes pages"| node_websites
node_crawler -->|"checks and saves"| node_storage
node_crawler -->|"extracts catalogs"| node_handler
node_flow -.->|"configures operations"| node_api

click node_app "https://github.com/fakecodderck/hentai/blob/main/src/App.tsx"
click node_scraper "https://github.com/fakecodderck/hentai/blob/main/src/components/studio/WebsiteScraperBar.tsx"
click node_catalog "https://github.com/fakecodderck/hentai/blob/main/src/components/studio/MultiPostManager.tsx"
click node_editor "https://github.com/fakecodderck/hentai/blob/main/src/components/studio/PostEditor.tsx"
click node_bulk "https://github.com/fakecodderck/hentai/blob/main/src/components/BulkEpisodesModal.tsx"
click node_gallery "https://github.com/fakecodderck/hentai/blob/main/src/components/studio/GalleryDisplay.tsx"
click node_preview "https://github.com/fakecodderck/hentai/blob/main/src/components/studio/TelegramPreview.tsx"
click node_settings "https://github.com/fakecodderck/hentai/blob/main/src/components/studio/TelegramSettingsCard.tsx"
click node_bot "https://github.com/fakecodderck/hentai/blob/main/src/components/BotSetupModal.tsx"
click node_batch "https://github.com/fakecodderck/hentai/blob/main/src/components/batch/BatchSender.tsx"
click node_history "https://github.com/fakecodderck/hentai/blob/main/src/components/history/HistoryList.tsx"
click node_crawlerpanel "https://github.com/fakecodderck/hentai/blob/main/src/components/crawler/AutoCrawlerPanel.tsx"
click node_crawlerview "https://github.com/fakecodderck/hentai/blob/main/src/components/crawler/AutoCrawlerView.tsx"
click node_flow "https://github.com/fakecodderck/hentai/blob/main/src/components/pipeline/FlowBuilder.tsx"
click node_api "https://github.com/fakecodderck/hentai/blob/main/src/services/api.ts"
click node_store "https://github.com/fakecodderck/hentai/blob/main/src/store/useAppStore.ts"
click node_handler "https://github.com/fakecodderck/hentai/blob/main/src/server/apiHandler.ts"
click node_crawler "https://github.com/fakecodderck/hentai/blob/main/src/server/crawlerService.ts"
click node_storage "https://github.com/fakecodderck/hentai/blob/main/src/server/storageManager.ts"
click node_library "https://github.com/fakecodderck/hentai/tree/main/data"

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_scraper,node_catalog,node_editor,node_bulk,node_gallery,node_preview,node_settings,node_bot,node_user toneBlue
class node_crawlerpanel,node_crawlerview,node_flow,node_crawler,node_library toneAmber
class node_batch,node_history,node_telegram toneMint
class node_api,node_store,node_handler,node_storage toneRose
class node_websites toneIndigo
```

## Components

### Studio interface

- [Workspace shell](https://github.com/fakecodderck/hentai/blob/main/src/App.tsx): `src/App.tsx`
- [Website scraper](https://github.com/fakecodderck/hentai/blob/main/src/components/studio/WebsiteScraperBar.tsx): `src/components/studio/WebsiteScraperBar.tsx`
- [Multi-post catalog](https://github.com/fakecodderck/hentai/blob/main/src/components/studio/MultiPostManager.tsx): `src/components/studio/MultiPostManager.tsx`
- [Post editor](https://github.com/fakecodderck/hentai/blob/main/src/components/studio/PostEditor.tsx): `src/components/studio/PostEditor.tsx`
- [Episode parser](https://github.com/fakecodderck/hentai/blob/main/src/components/BulkEpisodesModal.tsx): `src/components/BulkEpisodesModal.tsx`
- [Gallery display](https://github.com/fakecodderck/hentai/blob/main/src/components/studio/GalleryDisplay.tsx): `src/components/studio/GalleryDisplay.tsx`
- [Telegram preview](https://github.com/fakecodderck/hentai/blob/main/src/components/studio/TelegramPreview.tsx): `src/components/studio/TelegramPreview.tsx`
- [Telegram settings](https://github.com/fakecodderck/hentai/blob/main/src/components/studio/TelegramSettingsCard.tsx): `src/components/studio/TelegramSettingsCard.tsx`
- [Bot setup](https://github.com/fakecodderck/hentai/blob/main/src/components/BotSetupModal.tsx): `src/components/BotSetupModal.tsx`

### Extraction and crawling

- [Crawler controls](https://github.com/fakecodderck/hentai/blob/main/src/components/crawler/AutoCrawlerPanel.tsx): `src/components/crawler/AutoCrawlerPanel.tsx`
- [Crawler monitor](https://github.com/fakecodderck/hentai/blob/main/src/components/crawler/AutoCrawlerView.tsx): `src/components/crawler/AutoCrawlerView.tsx`
- [Flow builder](https://github.com/fakecodderck/hentai/blob/main/src/components/pipeline/FlowBuilder.tsx): `src/components/pipeline/FlowBuilder.tsx`
- [Crawler service](https://github.com/fakecodderck/hentai/blob/main/src/server/crawlerService.ts): `src/server/crawlerService.ts`

### Publishing

- [Batch sender](https://github.com/fakecodderck/hentai/blob/main/src/components/batch/BatchSender.tsx): `src/components/batch/BatchSender.tsx`
- [Send history](https://github.com/fakecodderck/hentai/blob/main/src/components/history/HistoryList.tsx): `src/components/history/HistoryList.tsx`

### Data and state

- [Client API](https://github.com/fakecodderck/hentai/blob/main/src/services/api.ts): `src/services/api.ts`
- [App state](https://github.com/fakecodderck/hentai/blob/main/src/store/useAppStore.ts): `src/store/useAppStore.ts`
- [API handlers](https://github.com/fakecodderck/hentai/blob/main/src/server/apiHandler.ts): `src/server/apiHandler.ts`
- [Post library](https://github.com/fakecodderck/hentai/blob/main/src/server/storageManager.ts): `src/server/storageManager.ts`

### Other components

- **Studio user**
- **Telegram Bot API**
- **Source websites**
- [Data files](https://github.com/fakecodderck/hentai/tree/main/data): `data`

## Connections

- Studio user → Workspace shell: uses (evidence: `src/App.tsx`)
- Workspace shell → Website scraper: renders (evidence: `src/App.tsx`)
- Workspace shell → Multi-post catalog: renders (evidence: `src/App.tsx`)
- Workspace shell → Post editor: renders (evidence: `src/App.tsx`)
- Workspace shell → Telegram preview: renders (evidence: `src/App.tsx`)
- Workspace shell → Telegram settings: renders (evidence: `src/App.tsx`)
- Workspace shell → Batch sender: renders (evidence: `src/App.tsx`)
- Workspace shell → Send history: renders (evidence: `src/App.tsx`)
- Workspace shell → Crawler controls: renders (evidence: `src/App.tsx`)
- Workspace shell → Crawler monitor: renders (evidence: `src/App.tsx`)
- Workspace shell → Flow builder: renders
- Website scraper → Client API: requests scrape (evidence: `src/components/studio/WebsiteScraperBar.tsx`)
- Multi-post catalog → Client API: scrapes URLs (evidence: `src/components/studio/MultiPostManager.tsx`)
- Batch sender → Client API: scrapes and sends (evidence: `src/components/batch/BatchSender.tsx`)
- Telegram preview → Client API: sends post (evidence: `src/components/studio/TelegramPreview.tsx`)
- Bot setup → Client API: verifies bot (evidence: `src/components/BotSetupModal.tsx`)
- Post editor → Gallery display: renders (evidence: `src/components/studio/PostEditor.tsx`)
- Episode parser → App state: updates episodes (evidence: `src/components/BulkEpisodesModal.tsx`)
- Post editor → App state: reads and updates (evidence: `src/components/studio/PostEditor.tsx`)
- Telegram preview → App state: reads post settings (evidence: `src/components/studio/TelegramPreview.tsx`)
- Client API → API handlers: calls API routes (evidence: `src/services/api.ts`)
- API handlers → Source websites: fetches page content (evidence: `src/server/apiHandler.ts`)
- API handlers → Post library: saves and loads posts (evidence: `src/server/apiHandler.ts`)
- Post library → Data files: reads and writes (evidence: `src/server/storageManager.ts`)
- Client API → Telegram Bot API: publishes messages (evidence: `src/services/api.ts`)
- Client API → Crawler service: controls crawler
- Crawler controls → Client API: starts crawler (evidence: `src/components/crawler/AutoCrawlerPanel.tsx`)
- Crawler monitor → Client API: checks and stops (evidence: `src/components/crawler/AutoCrawlerView.tsx`)
- Crawler service → Source websites: scrapes pages (evidence: `src/server/crawlerService.ts`)
- Crawler service → Post library: checks and saves (evidence: `src/server/crawlerService.ts`)
- Crawler service → API handlers: extracts catalogs (evidence: `src/server/crawlerService.ts`)
- Flow builder → Client API: configures operations (evidence: `src/components/pipeline/FlowBuilder.tsx`)
