Skip to content

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

ScriptThư mụcMô tả
npm run devclient/Khởi động Vite dev server với HMR (cổng 5173)
npm run buildclient/Build production bundle (output: dist/)
npm run previewclient/Preview bản build production locally
npm run start:devserver/Khởi động NestJS ở chế độ watch (tự restart khi thay đổi code)
npm run buildserver/Biên dịch TypeScript sang JavaScript (output: dist/)
npm run start:prodserver/Chạy bản build production
npx prisma studioserver/Mở GUI để duyệt database PostgreSQL hệ thống
npx prisma migrate deployserver/Á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 support
fix:Sửa lỗi — fix(adapter): handle null values in PostgreSQL arrays
refactor:Tái cấu trúc — refactor(auth): extract JWT logic to separate guard
docs:Tài liệu — docs(readme): update installation instructions
style:Style CSS — style(sidebar): adjust padding on mobile view
chore:Maintenance — chore(deps): upgrade tailwindcss to 3.4

Tiê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