

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# CLAUDE.md23This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.45## Project overview67JHenTai is a Flutter app for browsing E-Hentai / EXHentai, targeting Android, iOS, Windows, macOS, and Linux. Version `8.0.14+328` (from pubspec.yaml).89## Build & dev commands1011```bash12# Get dependencies13flutter pub get1415# Run code generation (Drift DB, etc.) — required after editing any @DriftDatabase tables/queries16dart run build_runner build1718# Run code generation in watch mode during active DB work19dart run build_runner watch --delete-conflicting-outputs2021# Run app on a connected device22flutter run2324# Lint25flutter analyze2627# Run tests28flutter test29```3031No test directory files are present, so `flutter test` is purely for when new tests are added.3233## Architecture3435### Dependency framework: GetX36State management, routing, dependency injection, and i18n all use GetX. Widgets use `GetBuilder<T>` (manual `update()`), not reactive `.obs` streams. Pages use `.obs` for settings that must broadcast changes across views.3738### Lifecycle: `JHLifeCircleBean` pattern3940Every singleton service and setting implements `JHLifeCircleBean` from `lib/src/service/jh_service.dart`:4142- `initBean()` — async init (called before `runApp`)43- `afterBeanReady()` — post-runApp setup44- `initDependencies` — list of other beans this one needs initialized first4546All beans are registered in a topological-sorted list in `lib/src/main.dart` and initialized in order. **Adding a new service/setting requires inserting it into this list with the correct `initDependencies` ordering** — out-of-order registration will cause init failures. Three mixins simplify common patterns:47- `JHLifeCircleBeanErrorCatch` — wraps init/ready in try/catch with logging; subclasses override `doInitBean()` / `doAfterBeanReady()` instead48- `JHLifeCircleBeanWithConfigStorage` — adds JSON serialize/deserialize to the `local_config` DB table via `applyBeanConfig()` / `getBeanConfig()`49- Service beans live in `lib/src/service/`; settings singletons live in `lib/src/setting/`5051### Logging5253Uses the `logger` package via the global `log` singleton (`lib/src/service/log.dart`). Four tiered outputs:54- Console logger (dev: colored + method info; prod: plain with timestamp)55- Verbose file logger (trace-level, `verbose/`)56- Warning file logger (warn+, `warning/`)57- Download-specific file logger (`download/`)5859Call `log.trace/debug/info/warn/error(msg, e, stack)`. Errors in `JHLifeCircleBeanErrorCatch` mixin are automatically logged.6061### Supporting directories6263- `lib/src/config/` — app-level configuration (theme, UI constants, Sentry, API secrets)64- `lib/src/enum/` — enums shared across the app (`EHNamespace`, `ConfigEnum`, `ConfigTypeEnum`)65- `lib/src/extension/` — extension methods on framework types (DioException, String, List, Directory, Widget, GetLogic)66- `lib/src/mixin/` — reusable page mixins: scroll-to-top, double-tap-refresh, login-required guard, animation, window-widget67- `lib/src/model/` — data classes: `Gallery`, `GalleryTag`, `GalleryImage`, `GalleryComment`, `SearchConfig`, `SearchHistory`, and per-endpoint response models in `model/jh_response/` and `model/archive_bot_response/`68- `lib/src/utils/` — 30+ utility files for parsing (eh_spider_parser, jh_spider_parser), IO, date, crypto, proxy, version, etc.69- `lib/src/exception/` — custom exception classes (`EHSiteException`, `NotUploadException`)7071### Routing7273All routes are defined in `lib/src/routes/routes.dart` as static const strings on `class Routes`. The `EHPage` class extends `GetPage` and adds:74- `side` — `left`/`right`/`fullScreen` (tablet layout uses left/right split)75- `offAllBefore` — whether previous right-side routes are popped7677Nested settings routes use a `settingPrefix` convention (`/setting_*`).7879### Page pattern8081Pages follow a consistent GetX structure in `lib/src/pages/`:8283- `*_page.dart` — Widget84- `*_logic.dart` — `GetxController` subclass (business logic)85- `*_state.dart` — Mutable state object8687The base class is `BasePageLogic` (`pages/base/base_page_logic.dart`) which handles gallery-list pages: pull-to-refresh, pagination (prev/next gid), search config persistence, and tag blocking/filtering. Subclasses override `getGalleryPage()` to provide page-specific API calls.8889### Network layer (`lib/src/network/`)9091Uses a custom Dio fork (`dio` from `jiangtian616/dio` at `append-mode` ref). Main request classes:92- `EHRequest` — all E-Hentai API calls, with cookie management, caching, domain fronting for EX93- `JHRequest` — backend API calls (tag translations, app update checks, built-in block lists)94- `ArchiveBotRequest` — archive.org resolution9596Parsers for HTML responses live in `lib/src/utils/eh_spider_parser.dart`.9798### Database (`lib/src/database/`)99100Drift (SQLite) at schema version 24 with heavy migration chain. Tables in `database/table/`, DAOs in `database/dao/`. The global `appDb` singleton is declared at the bottom of `database.dart`. Generated code is in `database.g.dart` — re-run `dart run build_runner build` after any schema change and add a migration step in `MigrationStrategy.onUpgrade`.101102### Services (`lib/src/service/`)103104Independent singletons that manage core features:105- `gallery_download_service.dart` / `archive_download_service.dart` — download engine with parallel queue, resume, priority106- `tag_translation_service.dart` — fetches and caches tag translations from EhTagTranslation107- `local_block_rule_service.dart` — user-configured gallery blocking rules108- `cloud_service.dart` — config sync109- `storage_service.dart` — JSON/GetStorage NoSQL persistence110- `super_resolution_service.dart` — image upscaling metadata tracking111- `path_service.dart` — platform-aware directory resolution112113### Settings (`lib/src/setting/`)114115Each setting module is a standalone singleton (e.g., `ehSetting`, `styleSetting`, `preferenceSetting`) using `JHLifeCircleBeanWithConfigStorage`. Settings are serialized as JSON and stored in the `local_config` DB table. Reactive `.obs` values are used when settings need to trigger UI rebuilds across the app.116117### Layout system (`lib/src/pages/layout/`)118119Three layout modes:120- `mobile_v2` — bottom navigation bar with tab-style pages121- `tablet_v2` — master-detail split (left/right route sides)122- `desktop` — sidebar navigation with persistent detail panel123124The home page (`home_page.dart`) selects the layout based on screen width.125126### i18n (`lib/src/l18n/`)127128Custom translation system via `LocaleText` (GetX `Translations`). One `.dart` file per language with key-value pairs. Adding a new language requires: the locale file, an entry in `locale_text.dart`, and an entry in `locale_consts.dart`.129130### Widget library (`lib/src/widget/`)131132Reusable widgets prefixed `eh_` — dialogs, cards, image components, tag displays, etc. The `app_manager.dart` widget wraps the entire app for global concerns. The `loading_state_indicator.dart` provides a standard loading/error/empty/idle state widget.133134### Key dependencies (beyond Flutter standard)135136- `get` 4.6.6 — state management, routing, i18n, NoSQL storage137- `dio` (custom fork) — HTTP client138- `drift` 2.21.0 — SQLite ORM139- `extended_image` — image loading with cache140- `photo_view` / `zoom_view` (custom forks) — reading page image viewer141- `desktop_webview_window` — desktop webview for cookie login142
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| csells/dotprompt_dartCLAUDE.md · 5 | CLAUDE.md | testlint-formatarchtypes+4 | 100/100 | 14 days ago | |
| microsoft/playwrightCLAUDE.md · 95k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 7 days ago | |
| nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.5k | CLAUDE.md | setupbuildstylearch+2 | 100/100 | 14 days ago | |
| lollipopkit/flutter_server_boxCLAUDE.md · 8.5k | CLAUDE.md | buildteststylearch+2 | 98/100 | 14 days ago | |
| supabase/supabase.claude/CLAUDE.md · 108k | CLAUDE.md | testlint-formatstylearch+1 | 97/100 | 14 days ago | |
| imaNNeo/fl_chartCLAUDE.md · 7.6k | CLAUDE.md | teststylearchtesting-strategy+2 | 94/100 | 14 days ago | |
| we-promise/sureCLAUDE.md · 9.5k | CLAUDE.md | setuptestlint-formatstyle+11 | 93/100 | 13 days ago | |
| manaflow-ai/cmuxCLAUDE.md · 26k | CLAUDE.md | setupbuildteststyle+4 | 93/100 | today |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/jiangtian616-jhentai-claude)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.