Remove deprecated agent and prompt files; add new architecture, contract, and feature documentation for Reader API
Build and Push Reader API Image / docker (push) Successful in 19s

This commit is contained in:
2026-04-29 23:25:15 +07:00
parent f933898c56
commit 82f502acd2
21 changed files with 298 additions and 404 deletions
+38
View File
@@ -0,0 +1,38 @@
# Flows - Reader API
Backend flow theo domain, de web/mobile follow giong nhau.
## Flow A: Auth Identity Unification
- Input:
- Web session cookie (NextAuth)
- Mobile bearer JWT
- Behavior:
1. Resolve current user identity.
2. Validate role/permission.
3. Return consistent auth errors (`401/403`).
## Flow B: Discovery and Reading
- Discovery:
- `/api/genres`
- `/api/novels/browse`
- `/api/novels/{idOrSlug}`
- Reading:
- `/api/truyen/{id}/chapters`
- `/api/chapters/{chapterId}` or chapter-by-number variant
- Rule: response shape on dinh de client render.
## Flow C: User Personalization
- Bookmark: `/api/user/bookmarks`.
- Progress: `/api/user/reading-progress`.
- Settings: `/api/user/settings`.
- Recommendations: `/api/user/recommendations`.
- Rule: idempotent where possible, clear conflict semantics.
## Flow D: Social Interaction
- Comments: `/api/truyen/{id}/comments`.
- Rating: `/api/truyen/{id}/rate`.
- Rule: enforce auth + anti-invalid payload + stable error format.