Files
reader/FLOWS.md
T
virtus 5f2c6d26f6
Build and Push Reader Image / docker (push) Successful in 1m17s
feat: Refactor Import Client for EPUB management with enhanced UI and functionality
- Implemented a multi-step wizard for importing EPUB files, including search, metadata review, chapter preview, and import progress tracking.
- Added genre management features, allowing users to create, select, and delete genres during the import process.
- Enhanced asset search functionality with improved API integration and user feedback.
- Updated the UI components for better user experience and responsiveness.
- Removed unused AI Tool links from the Novel Client and Mod Dashboard.
- Cleaned up the HomePage API response handling to streamline data fetching for popular and latest novels.
- Adjusted TypeScript definitions for route types in the Next.js environment.
2026-05-03 20:57:50 +07:00

1.7 KiB

Flows - Reader Web

Luon xem reader-api la canonical behavior.

Flow 1: Web Login and Session

  • Trigger: user bam dang nhap Google.
  • Preconditions: env OAuth hop le.
  • Steps:
    1. User xac thuc Google qua NextAuth.
    2. Web co session cookie.
    3. Web goi endpoint user de hydrate profile/state.
  • Success: user vao trang co tinh nang ca nhan hoa.

Flow 2: Browse -> Novel Detail -> Read Chapter

  • Trigger: user click tu home/search/genre.
  • Steps:
    1. Goi /api/novels/browse hoac /api/novels/{idOrSlug}.
    2. Goi /api/truyen/{id}/chapters lay muc luc.
    3. Doc chapter qua luong chapter hien co cua web.
  • Failure handling:
    • 404: thong bao khong tim thay truyen/chuong.
    • 5xx: retry UI + fallback message.

Flow 3: Bookmark and Progress Sync

  • Trigger: user bookmark hoac chuyen chuong.
  • Steps:
    1. Bookmark: GET/POST/DELETE /api/user/bookmarks.
    2. Progress: POST /api/user/reading-progress.
    3. UI cap nhat trang thai optimistic + reconcile API.
  • Expected parity: cung nghia status voi mobile.

Flow 4: Comment / Rating / Recommendation

  • Comment: GET/POST /api/truyen/{id}/comments.
  • Rating: POST /api/truyen/{id}/rate.
  • Recommendation: /api/user/recommendations.
  • Error rules: follow CONTRACT.md.

Flow 5: MOD EPUB Import Wizard

  • Route: /mod/import
  • Steps:
    1. Search source asset by name (GET /api/import/assets/search)
    2. Review metadata + AI suggestion (preview-metadata, ai-suggest, review)
    3. Parse preview with TOC/regex-start (POST /api/import/assets/{id}/parse-preview)
    4. Start import and poll progress (start-import, GET /api/import/sessions/{sessionId})
  • Rule: reviewer confirms metadata before import starts.