3 KiB
Story 1.3: Giao diện Đăng nhập & Tích hợp Token vào Zero-Client (Frontend Auth UI)
Status: done
Epic: Epic 1
Story Key: 1-3-frontend-auth-ui
📖 Story Requirements (Context & PRD)
This section maps directly to the original Product Requirements Document and Epics definition.
As a Người dùng,
I want sử dụng giao diện trơn tru để đăng ký/đăng nhập,
So that tôi nhận được Token và ngay lập tức kết nối tới hệ thống dữ liệu Local-first an toàn qua Zero Client.
Acceptance Criteria:
Given tôi đang ở trạng thái khách (Guest) trên UI
When tôi điền form đăng nhập thành công
Then giao diện lưu token vào cục bộ và tự động khởi tạo instance ZeroClient để bắt đầu mở cầu nối WebSockets.
And khi tôi nhấn nút "Đăng xuất" (Log Out), hàm onLogout() tự động thực thi dọn dẹp sạch (purge) toàn bộ IndexedDB, chặn bảo mật.
And Giao diện (Form đăng nhập, nút bấm) ứng dụng quy chuẩn UX-DR1 (Màu Base Zinc/Accent Indigo, font Inter).
Người dùng dễ dàng kéo thả các tệp PDF/TXT lên hệ thống; hệ thống tự động bóc tách dữ liệu mượt mà trong nền mà không làm gián đoạn công việc. Họ nắm rõ tiến độ nạp file và làm chủ khối lượng tài liệu của mình.
FRs covered: FR1, FR2, FR3, FR4, FR12, FR13
🏗️ Architecture & Technical Guardrails
Critical instructions for the development agent based on the project's established architecture.
Technical Requirements
- Language/Framework: React, Next.js (TypeScript) for Web; FastAPI (Python) for Backend.
- Database: Prisma/Supabase.
- Strict Type checking must be enforced. No
anytypes.
Code Organization
This story is currently marked as done. Implementation should target the following components/files:
surfsense_backend/app/connectors/dropbox/client.pysurfsense_backend/app/schemas/incentive_tasks.pysurfsense_backend/app/utils/proxy_config.pysurfsense_web/components/chat-comments/comment-panel-container/comment-panel-container.tsxsurfsense_web/components/tool-ui/write-todos.tsxsurfsense_web/components/shared/image-config-dialog.tsxsurfsense_backend/app/users.pysurfsense_web/components/ui/dropdown-menu.tsx
Developer Agent Constraints
- No Destructive Refactors: Extend existing modules when possible.
- Context Check: Always refer back to
task.mdand use Context7 to verify latest SDK usages. - BMad Standard: Update the sprint status using standard metrics.
🧪 Testing & Validation Requirements
- All new endpoints must be tested.
- Frontend components should gracefully degrade.
- Do not introduce regressions into existing user workflows.
📈 Completion Status
(To be updated by the agent when completing this story)
- Start Date: _____________
- Completion Date: _____________
-
Key Files Changed: