docs: Revise architecture and contract documentation, clarify mobile API behavior, and update import flow details
This commit is contained in:
+2
-2
@@ -26,8 +26,8 @@ Tai lieu nay mo ta vai tro `reader-app` trong he sinh thai doc truyen gom web +
|
|||||||
|
|
||||||
## Environment va ket noi
|
## Environment va ket noi
|
||||||
|
|
||||||
- Local API mac dinh: `http://10.0.2.2:8000` (Android emulator).
|
- Khong co `--dart-define`: Android native mac dinh toi `https://reader-api.fevirtus.dev`; cac platform khac `http://localhost:8000` (`lib/core/config/app_config.dart`).
|
||||||
- Script `scripts/flutter_run_with_env.sh` la cach chuan de chay local.
|
- Dev local Android emulator: dat `BASE_URL=http://10.0.2.2:8000` trong `.env.mobile` va chay qua `scripts/flutter_run_with_env.sh`.
|
||||||
- `BASE_URL`, `GOOGLE_SERVER_CLIENT_ID`, `GOOGLE_CLIENT_ID` duoc truyen qua `--dart-define`.
|
- `BASE_URL`, `GOOGLE_SERVER_CLIENT_ID`, `GOOGLE_CLIENT_ID` duoc truyen qua `--dart-define`.
|
||||||
|
|
||||||
## Definition of Done (Mobile)
|
## Definition of Done (Mobile)
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ Tai lieu contract chung cho `reader`, `reader-app`, `reader-api`.
|
|||||||
- `409`: xung dot du lieu.
|
- `409`: xung dot du lieu.
|
||||||
- `422`: payload format dung JSON nhung khong dat rule nghiep vu.
|
- `422`: payload format dung JSON nhung khong dat rule nghiep vu.
|
||||||
- `500`: loi he thong.
|
- `500`: loi he thong.
|
||||||
|
- `410`: (du tru) tai nguyen da go bo hoac khong con ho tro.
|
||||||
|
|
||||||
## Pagination Convention
|
## Pagination Convention
|
||||||
|
|
||||||
|
|||||||
@@ -26,17 +26,12 @@ Legend:
|
|||||||
| Comment | `GET/POST /api/truyen/{id}/comments` | Y | Y | Y | |
|
| Comment | `GET/POST /api/truyen/{id}/comments` | Y | Y | Y | |
|
||||||
| Rating | `POST /api/truyen/{id}/rate` | Y | Y | N | Mobile chua thay rating flow |
|
| Rating | `POST /api/truyen/{id}/rate` | Y | Y | N | Mobile chua thay rating flow |
|
||||||
| Search | `GET /api/truyen/suggest` | Y | Y | N | Mobile search suggest can bo sung |
|
| Search | `GET /api/truyen/suggest` | Y | Y | N | Mobile search suggest can bo sung |
|
||||||
| Import | `GET /api/import/assets/search` | Y | Y | N | Web MOD-only flow |
|
| Import | `POST /api/import/uploads/preview` | Y | Y | N | Upload EPUB multipart (preview) |
|
||||||
| Import | `GET /api/import/assets/{id}/preview-metadata` | Y | Y | N | Web MOD-only flow |
|
| Import | `POST /api/mod/epub`, `POST /api/mod/epub/ai-suggest` | Y | Y | N | Luong `/mod/import` |
|
||||||
| Import | `POST /api/import/assets/{id}/ai-suggest` | Y | Y | N | Web MOD-only flow |
|
| Import | `GET/POST/PUT/DELETE /api/mod/the-loai` | Y | Y | N | MOD quan ly the loai trong wizard |
|
||||||
| Import | `POST /api/import/assets/{id}/review` | Y | Y | N | Web MOD-only flow |
|
|
||||||
| Import | `POST /api/import/assets/{id}/parse-preview` | Y | Y | N | Web MOD-only flow |
|
|
||||||
| Import | `POST /api/import/assets/{id}/start-import` | Y | Y | N | Web MOD-only flow |
|
|
||||||
| Import | `GET /api/import/sessions/{sessionId}` | Y | Y | N | Web MOD-only flow |
|
|
||||||
|
|
||||||
## Priority gaps de dong bo tiep
|
## Priority gaps de dong bo tiep
|
||||||
|
|
||||||
1. Mobile: `user/settings`, `recommendations`, `rate`, `suggest`.
|
1. Mobile: `user/settings`, `recommendations`, `rate`, `suggest`.
|
||||||
2. Web/Mobile chapter-read strategy can unify (`chapters/{id}` vs `by-number`).
|
2. Web/Mobile chapter-read strategy can unify (`chapters/{id}` vs `by-number`).
|
||||||
3. Chuan hoa error contract implementation theo `CONTRACT.md`.
|
3. Chuan hoa error contract implementation theo `CONTRACT.md`.
|
||||||
4. Import EPUB is intentionally out of mobile scope.
|
|
||||||
|
|||||||
@@ -49,4 +49,4 @@ Muc tieu: mobile follow cung business behavior voi web.
|
|||||||
|
|
||||||
## Out of Scope (Current)
|
## Out of Scope (Current)
|
||||||
|
|
||||||
- EPUB import flow (`/api/import/*`) is MOD-only on web and not planned for mobile client.
|
- MOD EPUB import chi tren web (`/mod/import`: `/api/mod/epub`, `POST /api/import/uploads/preview`, …). Mobile khong co wizard import.
|
||||||
|
|||||||
@@ -7,16 +7,11 @@ Flutter mobile app for reading novels, synced with the existing web platform.
|
|||||||
- Full end-user feature parity with the current web app.
|
- Full end-user feature parity with the current web app.
|
||||||
- Excludes all moderator/admin workflows.
|
- Excludes all moderator/admin workflows.
|
||||||
|
|
||||||
## Planned Feature Set
|
## Implemented vs planned
|
||||||
|
|
||||||
- Google login and authenticated user session.
|
Đã có trong code (theo `lib/features`): đăng nhập Google, home/browse, genres, tìm kiếm, chi tiết truyện + danh sách chương, reader (kèm TTS), bookshelf, bookmark/progress, bình luận, splash/settings.
|
||||||
- Home feed, hot boards, and recommendations.
|
|
||||||
- Search with suggestions, genre, status, and sort filters.
|
Còn thiếu hoặc mới dạng placeholder so với web: gợi ý tìm kiếm (`/api/truyen/suggest`), đánh giá truyện (`/api/truyen/{id}/rate`), đồng bộ settings và đề cử người dùng (`/api/user/settings`, `/api/user/recommendations`). Chi tiết parity xem `FEATURES.md` và `CROSS_REPO_ENDPOINT_MATRIX.md`.
|
||||||
- Novel detail with chapter list and series metadata.
|
|
||||||
- Reader with TOC, reading preferences, and progress sync.
|
|
||||||
- Bookshelf tabs: Dang doc, Danh dau, Da doc, De cu.
|
|
||||||
- Comments, ratings, and user recommendations.
|
|
||||||
- Native TTS and offline reading support.
|
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
@@ -51,12 +46,14 @@ This script reads `.env.mobile` and automatically passes:
|
|||||||
- `GOOGLE_SERVER_CLIENT_ID`
|
- `GOOGLE_SERVER_CLIENT_ID`
|
||||||
- optional `GOOGLE_CLIENT_ID`
|
- optional `GOOGLE_CLIENT_ID`
|
||||||
|
|
||||||
Default `BASE_URL` behavior:
|
Default `BASE_URL` khi **không** truyền `--dart-define` (xem `lib/core/config/app_config.dart`):
|
||||||
|
|
||||||
- Android emulator: `http://10.0.2.2:8000`
|
- Android (native, không phải web build): `https://reader-api.fevirtus.dev`
|
||||||
- Others (iOS simulator, desktop, web): `http://localhost:8000`
|
- Các nền tảng khác (iOS, desktop, web build, v.v.): `http://localhost:8000`
|
||||||
|
|
||||||
If needed, you can still override explicitly:
|
Để dev local trên Android emulator, luôn set rõ qua `--dart-define` hoặc file `.env.mobile` + `scripts/flutter_run_with_env.sh`, ví dụ `http://10.0.2.2:8000`.
|
||||||
|
|
||||||
|
Override trực tiếp:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
flutter run --dart-define=BASE_URL=http://localhost:8000
|
flutter run --dart-define=BASE_URL=http://localhost:8000
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ final chapterListProvider =
|
|||||||
try {
|
try {
|
||||||
return await fetchAllChapters(novelId);
|
return await fetchAllChapters(novelId);
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
// Backend stores chapters by novel id in MongoDB; if route opened by slug,
|
// If route opened by slug/id mismatch, resolve canonical novel id and retry once.
|
||||||
// first request can return empty list. Resolve canonical id and retry once.
|
// first request can return empty list. Resolve canonical id and retry once.
|
||||||
try {
|
try {
|
||||||
final novelRes = await client.dio.get('/api/novels/$novelId');
|
final novelRes = await client.dio.get('/api/novels/$novelId');
|
||||||
|
|||||||
Reference in New Issue
Block a user