How khangitvns12/crawler works
NovelFlow is a web novel crawler, translator, library, and reader. Users crawl a source novel, optionally translate its chapters, save it to the library, then read or export it; background crawling supports longer jobs. The graph also includes documented API/OPDS access and Supabase synchronization. Relationships are limited to calls or references shown in the supplied excerpts and SOURCE INDEX; some route implementations and export details were not sampled.
Main entry points: page.tsx Workspace · server-storage.ts Storage facade · crawler-engine.ts Crawler engine · NovelDetailModal.tsx Novel details
Components 25
Library experience
- Workspace
app/page.tsx - Novel library
components/LibraryView.tsx - Novel details
components/NovelDetailModal.tsx - Chapter reader
components/ReaderModal.tsx - EPUB export
components/EpubExportModal.tsx
Crawling
- Crawler controls
components/CrawlerView.tsx - Background jobs
components/BackgroundCrawlerView.tsx - Crawler endpoints
app/api/crawler/chapter/route.ts - Crawler engine
lib/crawler-engine.ts - Site presets
lib/preset-extractors.ts - Job runner
lib/background-crawler.ts
Translation
- Translation workspace
components/TranslationView.tsx - Translation endpoint
app/api/translate/route.ts - Gemini translation
lib/gemini.ts
Storage and access
- Novel and chapter model
types/novel.ts - Novel endpoints
app/api/novels/route.ts - Storage facade
lib/server-storage.ts - Local state
lib/server-storage.ts - Supabase store
lib/supabase.ts - Public API and OPDS
app/api/v1/opds/route.ts - OPDS feed generator
lib/opds-generator.ts
Other components
- Reader
- Google Gemini
- Supabase service
- Novel websites
Connections 27
- Reader → Workspace: uses
app/page.tsx - Workspace → Novel library: shows
app/page.tsx - Workspace → Crawler controls: shows
app/page.tsx - Workspace → Background jobs: shows
app/page.tsx - Workspace → Translation workspace: shows
app/page.tsx - Novel library → Novel details: opens
components/LibraryView.tsx - Novel details → Chapter reader: opens
components/NovelDetailModal.tsx - Novel details → EPUB export: exports
- Crawler controls → Crawler endpoints: requests crawl
components/CrawlerView.tsx - Crawler endpoints → Crawler engine: calls
app/api/crawler/chapter/route.ts - Crawler engine → Site presets: selects preset
lib/crawler-engine.ts - Crawler engine → Novel websites: fetches pages
- Background jobs → Job runner: manages jobs
- Job runner → Crawler engine: crawls chapters
lib/background-crawler.ts - Crawler controls → Novel endpoints: saves chapters
components/CrawlerView.tsx - Translation workspace → Translation endpoint: requests translation
- Translation endpoint → Gemini translation: calls
app/api/translate/route.ts - Gemini translation → Google Gemini: translates with
- Translation endpoint → Storage facade: updates novel
app/api/translate/route.ts - Novel endpoints → Storage facade: reads and writes
app/api/novels/route.ts - Storage facade → Local state: persists locally
lib/server-storage.ts - Storage facade → Supabase store: syncs when configured
lib/server-storage.ts - Supabase store → Supabase service: queries
- Novel endpoints → Novel and chapter model: uses model
app/api/novels/route.ts - Public API and OPDS → Storage facade: reads novels
app/api/v1/opds/route.ts - Public API and OPDS → OPDS feed generator: generates feed
app/api/v1/opds/route.ts - Reader → Public API and OPDS: accesses API