dành cho phòng chăm sóc khách hàng bệnh viện hiếm muộn, trải nghiệm mới
- TypeScript 99%
- CSS 0.7%
- HTML 0.1%
|
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m29s
- Remove fake testimonial about 50+ hospitals - Remove urgency bait message - Update contact to Tú (+84 799 364 466) - Change primary CTA to click-to-call button - Add secondary option for contact form Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .claude | ||
| .forgejo/workflows | ||
| _bmad | ||
| _bmad-output | ||
| docs | ||
| public | ||
| src | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| .prettierignore | ||
| .prettierrc | ||
| components.json | ||
| docker-compose.dokploy.yml | ||
| Dockerfile | ||
| eslint.config.mjs | ||
| next.config.ts | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.mjs | ||
| project-context.md | ||
| README.md | ||
| tsconfig.json | ||
| vitest.config.ts | ||
| vitest.setup.ts | ||
CRM Bệnh Viện
Hệ thống quản lý quan hệ khách hàng cho bệnh viện - MVP giai đoạn 1.
Tech Stack
- Framework: Next.js 16 (App Router, RSC, Turbopack)
- Language: TypeScript 5.x (strict mode)
- Styling: Tailwind CSS 4 + shadcn/ui (new-york style)
- State Management: Zustand (client UI state)
- Forms: react-hook-form + Zod validation
- Date: date-fns với Vietnamese locale
- Icons: Lucide React
Cài đặt
# Clone repo
git clone <repo-url>
cd crm-benhvien
# Cài dependencies
npm install
# Chạy dev server
npm run dev
Mở http://localhost:3000 để xem app.
Demo Accounts
| Tên | Password | Role | |
|---|---|---|---|
| Hương | huong@hospital.vn | demo123 | Staff |
| Quản lý Minh | manager@hospital.vn | demo123 | Manager |
Hoặc sử dụng Quick Login buttons trên trang /login.
Cấu trúc Project
src/
├── app/
│ ├── (auth)/ # Public auth routes (/login)
│ ├── (dashboard)/ # Protected routes (/tasks, /templates, etc.)
│ └── globals.css # Tailwind CSS config
├── components/
│ ├── ui/ # shadcn/ui components
│ ├── features/ # Feature-specific components
│ │ ├── tasks/ # Task board components
│ │ └── ...
│ └── shared/ # Shared components (Sidebar, Header)
├── stores/ # Zustand stores
│ ├── auth.ts # Authentication state
│ ├── tasks.ts # Task data & actions
│ └── task-filters.ts # Filter state
├── types/ # TypeScript types
├── lib/ # Utilities
└── hooks/ # Custom hooks
Features (Epic 2 - Completed)
Task Board
- Kanban board với 4 columns: Chờ xử lý, Đang làm, Hoàn thành, Không liên lạc được
- Task cards với patient info, priority, status
- Drag & drop status changes (via dropdown)
- Task detail side panel
Task Actions
- Claim task (nhận việc)
- Status updates với toast feedback
- Task notes system
- Follow-up scheduling với date/time picker
Filters & Search
- Search by patient name/phone
- Filter by task type, status, assignee
- "Của tôi" quick filter
Scripts
npm run dev # Start dev server
npm run build # Production build
npm run lint # ESLint check
npm run typecheck # TypeScript check
npm test # Run tests in watch mode
npm run test:run # Run tests once
npm run ci # ⭐ Chạy full CI pipeline (lint + typecheck + test + build)
Thêm shadcn/ui Components
npx shadcn@latest add <component-name>
Ví dụ:
npx shadcn@latest add table
npx shadcn@latest add textarea
Environment Variables
Tạo file .env.local:
# Không cần config gì cho MVP (mock data)
Development Notes
- Không có database - Sử dụng mock data trong Zustand stores
- Không có API - Tất cả operations là client-side
- Auth là mock - Không có real authentication
CI/CD với Forgejo
Quy trình tự động
Khi push code lên branch main, Forgejo Actions sẽ tự động:
- Checkout source code
- Build Docker image với multi-stage build (deps → builder → runner)
- Tag image:
crm-benhvien:latestvàcrm-benhvien:<commit-sha> - Dọn dẹp các image cũ
⭐ Chạy CI tại Local (Bắt buộc trước khi push)
Để đảm bảo code pass CI trên Forgejo, BẮT BUỘC chạy lệnh sau trước khi push:
npm run ci
Lệnh này sẽ chạy tuần tự:
npm run lint- Kiểm tra code style với ESLintnpm run typecheck- Kiểm tra lỗi TypeScriptnpm run test:run- Chạy tất cả testsnpm run build- Build production
Tất cả các bước phải PASS thì mới push code.
Chạy từng bước riêng lẻ (khi debug)
# Chỉ lint
npm run lint
# Chỉ typecheck
npm run typecheck
# Chỉ test (watch mode để debug)
npm test
# Chỉ build
npm run build
Quy tắc commit
- KHÔNG push code nếu
npm run cithất bại - Viết commit message theo format:
<type>(<scope>): <description>- Ví dụ:
feat(tasks): add drag-and-drop support - Types:
feat,fix,docs,style,refactor,test,chore
- Ví dụ:
Khi CI trên Forgejo thất bại
- Kiểm tra logs trên Forgejo Actions để xem lỗi cụ thể
- Chạy
npm run citại local để reproduce lỗi - Fix lỗi và chạy lại
npm run cicho đến khi pass - Push commit fix
Cấu trúc Docker
Dockerfile
├── deps stage # Cài đặt dependencies
├── builder stage # Build Next.js app (chạy lint + typecheck + build)
└── runner stage # Production image (~150MB)
Image production sử dụng Next.js standalone output, chạy trên port 3000.