Frontend
React 18 + Vite
TypeScript, TailwindCSS, React Query, React Router v6
Backend
Node.js + Express
TypeScript, Prisma ORM, JWT Auth, Zod validation
Database
PostgreSQL 15
Prisma migrations, Redis (cache & queue)
Infrastructure
Docker Compose
Dev local, CI/CD GitHub Actions, deploy VPS / cloud
salon-system/
├── apps/
│ ├── api/ # Backend Express API
│ │ ├── src/
│ │ │ ├── modules/ # Feature modules
│ │ │ │ ├── auth/ # Xác thực, JWT
│ │ │ │ ├── appointments/ # Lịch hẹn
│ │ │ │ ├── customers/ # Hồ sơ khách hàng
│ │ │ │ ├── services/ # Danh mục dịch vụ
│ │ │ │ ├── staff/ # Nhân viên & ca làm
│ │ │ │ ├── pos/ # Thanh toán / hóa đơn
│ │ │ │ ├── inventory/ # Quản lý hàng hóa
│ │ │ │ └── reports/ # Báo cáo doanh thu
│ │ │ ├── common/ # Shared utilities
│ │ │ │ ├── middleware/ # auth, error, logger
│ │ │ │ ├── decorators/
│ │ │ │ └── utils/
│ │ │ ├── prisma/ # Schema & migrations
│ │ │ │ ├── schema.prisma
│ │ │ │ └── migrations/
│ │ │ └── app.ts # Entry point
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ └── tsconfig.json
│ │
│ └── web/ # Frontend React
│ ├── src/
│ │ ├── pages/ # Route-level pages
│ │ │ ├── dashboard/
│ │ │ ├── appointments/
│ │ │ ├── customers/
│ │ │ ├── staff/
│ │ │ ├── pos/
│ │ │ ├── inventory/
│ │ │ └── reports/
│ │ ├── components/ # Shared UI components
│ │ │ ├── ui/ # Button, Input, Modal…
│ │ │ ├── layout/ # Sidebar, Header…
│ │ │ └── calendar/ # Booking calendar widget
│ │ ├── hooks/ # Custom React hooks
│ │ ├── services/ # API client (axios)
│ │ ├── store/ # Zustand global state
│ │ ├── types/ # TS type definitions
│ │ └── main.tsx
│ ├── Dockerfile
│ ├── vite.config.ts
│ └── package.json
│
├── packages/ # Shared across apps
│ ├── shared-types/ # DTOs, enums dùng chung
│ └── ui-kit/ # (tuỳ chọn) Component lib
│
├── infra/ # Infrastructure as code
│ ├── docker-compose.yml
│ ├── docker-compose.prod.yml
│ └── nginx/
│
├── .github/
│ └── workflows/
│ ├── ci.yml # Lint + test
│ └── deploy.yml
│
├── .xp-docs/ # Tài liệu dự án (nội bộ)
├── .env.example
├── package.json # Monorepo root (pnpm workspaces)
├── pnpm-workspace.yaml
└── turbo.json # Turborepo build pipeline
User (id, name, email, passwordHash, role, createdAt)
Customer (id, name, phone, email, notes, points, createdAt)
Staff (id, userId→User, skills[], hireDate)
Service (id, name, category, price, durationMin, staffIds[])
Appointment (id, customerId→Customer, staffId→Staff, serviceId→Service,
startAt, endAt, status, notes)
Invoice (id, appointmentId→Appointment, total, discount, paymentMethod,
paidAt, items[])
Product (id, name, unit, costPrice, salePrice)
StockMovement(id, productId→Product, type IN|OUT, qty, note, createdAt)
Shift (id, staffId→Staff, date, startTime, endTime)