Quy trình Phát triển
Hướng dẫn toàn diện về quy trình phát triển, các script hữu ích, và coding conventions cho Data Explorer.
Scripts phát triển
| Script | Thư mục | Mô tả |
|---|---|---|
npm run dev | client/ | Khởi động Vite dev server với HMR (cổng 5173) |
npm run build | client/ | Build production bundle (output: dist/) |
npm run preview | client/ | Preview bản build production locally |
npm run start:dev | server/ | Khởi động NestJS ở chế độ watch (tự restart khi thay đổi code) |
npm run build | server/ | Biên dịch TypeScript sang JavaScript (output: dist/) |
npm run start:prod | server/ | Chạy bản build production |
npx prisma studio | server/ | Mở GUI để duyệt database PostgreSQL hệ thống |
npx prisma migrate deploy | server/ | Áp dụng migration Prisma đang chờ |
Quy trình Git
Chúng tôi khuyến nghị quy trình Git chuẩn sau cho việc phát triển tính năng mới hoặc fix bug:
Quy trình Feature Branch
# Bước 1: Tạo branch mới từ main
git checkout main
git pull origin main
git checkout -b feature/add-postgres-adapter
# Bước 2: Phát triển tính năng
# ... viết code, test ...
# Bước 3: Commit atomic changes
git add -A
git commit -m "feat(adapter): add SQLite adapter with introspection"
# Bước 4: Push và tạo Pull Request
git push origin feature/add-postgres-adapter
Quy ước Commit Message
Tuân theo quy ước Conventional Commits để giữ lịch sử Git sạch và dễ đọc:
feat:Tính năng mới — feat(editor): add multi-cursor supportfix:Sửa lỗi — fix(adapter): handle null values in PostgreSQL arraysrefactor:Tái cấu trúc — refactor(auth): extract JWT logic to separate guarddocs:Tài liệu — docs(readme): update installation instructionsstyle:Style CSS — style(sidebar): adjust padding on mobile viewchore:Maintenance — chore(deps): upgrade tailwindcss to 3.4Tiêu chuẩn Coding
- TypeScript strict mode cho cả client và server — không sử dụng any trừ trường hợp bất khả kháng.
- Component React: Functional components + hooks. Không sử dụng class components.
- File naming: PascalCase cho components (UserProfile.tsx), camelCase cho utilities (formatDate.ts), kebab-case cho routes.
- State management: Zustand stores tách biệt theo feature (useConnectionStore, useEditorStore, useAIStore).
- CSS: Tailwind utility classes. Tránh inline styles. Sử dụng cn() helper cho conditional classes.
- Imports: Sắp xếp theo thứ tự — React → third-party → local modules → types. Sử dụng path aliases (@/).
Sẵn sàng khám phá dữ liệu?
Tham gia cộng đồng trên GitHub để đóng góp cho IDE cơ sở dữ liệu địa phương thông minh nhất.
Mở Ứng dụng