feat: scaffold complete danable frontend architecture with all pages, layouts, stores, and 3 annotator modes
This commit is contained in:
commit
78848dd7d1
173 changed files with 18649 additions and 0 deletions
50
README.md
Normal file
50
README.md
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# danable · Nền tảng dữ liệu gán nhãn cho AI (Frontend)
|
||||
|
||||
Dự án frontend cho nền tảng gán nhãn dữ liệu hình ảnh **danable** (hỗ trợ 3 bài toán: **Classification**, **Object Detection**, và **Segmentation**), được thiết kế theo kiến trúc phân lớp rõ ràng để sẵn sàng tích hợp với Backend / Orchestrator.
|
||||
|
||||
---
|
||||
|
||||
## 1. Khởi chạy dự án
|
||||
|
||||
```bash
|
||||
# Cài đặt dependencies
|
||||
npm install
|
||||
|
||||
# Chạy môi trường phát triển (http://localhost:3000)
|
||||
npm run dev
|
||||
|
||||
# Kiểm tra TypeScript & build production
|
||||
npm run build
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 2. Cấu trúc thư mục
|
||||
|
||||
- `public/` — Tài nguyên tĩnh (`favicon.svg`, ảnh minh họa...)
|
||||
- `src/app/` — Cấu hình cấp ứng dụng (`router.tsx`, `providers.tsx`, `constants.ts`)
|
||||
- `src/layouts/` — 3 Layout chính (`AuthLayout`, `DashboardLayout`, `AnnotatorLayout`) cùng `Sidebar` & `Header`
|
||||
- `src/pages/` — Mỗi trang được tách thành folder riêng kèm `components/` nội bộ:
|
||||
- `auth/` — Đăng nhập (`/login`), Quên mật khẩu (`/forgot-password`)
|
||||
- `projects/` — Danh sách dự án (`/projects`), Modal tạo dự án, Tổng quan dự án (`/projects/:id`)
|
||||
- `users/` — Quản lý người dùng & phân quyền (`/users`)
|
||||
- `annotator/` — Giao diện gán nhãn 3-panel (`/projects/:id/annotate`) tự động chuyển đổi theo bài toán (`Classification`, `Object Detection`, `Segmentation`)
|
||||
- `src/components/` — Thư viện UI dùng chung (`ui/`, `feedback/`, `data-display/`)
|
||||
- `src/services/` — Tầng giao tiếp API duy nhất (`api.ts`, `projectService.ts`, `annotationService.ts`...)
|
||||
- `src/stores/` — Quản lý state với Zustand (`authStore`, `projectStore`, `annotationStore`, `canvasStore`, `uiStore`)
|
||||
- `src/hooks/` — Custom hooks tách biệt business logic khỏi giao diện
|
||||
- `src/types/` — Định nghĩa TypeScript interfaces/types dùng chung
|
||||
- `src/utils/` — Hàm tiện ích (chuyển đổi tọa độ canvas, xuất LabelMe JSON, xuất mask PNG, định dạng số...)
|
||||
|
||||
---
|
||||
|
||||
## 3. Hướng dẫn nối vào Backend / Orchestrator
|
||||
|
||||
1. Mở file `.env` và cập nhật địa chỉ API Gateway / Orchestrator:
|
||||
```env
|
||||
VITE_API_URL=https://orchestrator.your-domain.com/api/v1
|
||||
VITE_USE_MOCK_DATA=false
|
||||
```
|
||||
2. Toàn bộ HTTP client được cấu hình tập trung tại `src/services/api.ts` (đã gắn sẵn Bearer Token interceptor).
|
||||
3. Các hàm trong `src/services/*Service.ts` đã định nghĩa đầy đủ chữ ký hàm và kiểu trả về chuẩn theo `src/types/`.
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue