Nền tảng khám phá địa điểm ăn uống, vui chơi theo mô hình Social + Map: lướt feed video/ảnh kiểu reels, tìm kiếm theo nhu cầu, xem địa điểm trên bản đồ, review và ưu đãi theo vai trò người dùng.
ChillPlace được thiết kế theo định hướng:
- Social discovery: feed review/promotion giàu media.
- Location intelligence: map, nearby, filter theo khu vực/khoảng cách.
- Role-based workflow:
guest,user,creator,business,admin. - Moderation-first: report, duyệt role, duyệt nội dung, quản lý tag.
Hiện repo đã hoàn thành Project Setup & Core Infrastructure cho backend:
- Scaffold backend theo module với Express.
- Prisma schema cho các bảng cốt lõi.
- Migration init + database bootstrap automation.
- Health check có kiểm tra kết nối DB và latency.
- Chuẩn hóa error/response middleware.
ChillPlace/
├─ apps/
│ ├─ web/ # Frontend React (scaffold thư mục)
│ └─ api/ # Backend Node.js + Express + Prisma
├─ prisma/
│ ├─ schema.prisma
│ ├─ migrations/
│ └─ seeds/
├─ packages/
│ ├─ shared/
│ └─ config/
├─ docs/
├─ infra/
└─ scripts/
- Frontend: React + Vite (đang ở mức cấu trúc thư mục)
- Backend: Node.js, Express
- Database: MySQL 8.x (Laragon local)
- ORM: Prisma
- Auth (planned): JWT + bcrypt
- API style: REST JSON
Trong apps/api/src:
config/: env, corsmiddlewares/: not found, error handler, role/auth placeholdersroutes/: router compositionmodules/health:/api/healthcommon/:AppError, helpers, prisma clientscripts/db/bootstrap.js: tự tạo database nếu chưa tồn tại
Prisma schema đã có các nhóm bảng chính:
- User & Role:
users,creator_profiles,business_profiles,role_requests - Place & Content:
categories,places,place_media,posts,post_media,promotions - Social:
comments,likes,favorites,follows,reviews - Governance:
reports,notifications,audit_logs - Tag & recommendation base:
tags,post_tags,user_tag_preferences
- Node.js 20+
- npm 10+
- Laragon (MySQL 8.x đang chạy tại
127.0.0.1:3306)
# 1) vào backend
cd apps/api
# 2) cài dependencies
npm install
# 3) tạo file môi trường
copy .env.example .env
# 4) setup tự động (bootstrap DB + prisma generate + migrate deploy)
npm run setup
# 5) chạy server
npm run devHealth check:
GET http://localhost:5000/api/healthnpm run dev: chạy API mode watchnpm run start: chạy API production modenpm run db:bootstrap: tạo DB từDATABASE_URLnếu chưa cónpm run prisma:generate: generate Prisma clientnpm run prisma:migrate: migrate dev (tạo migration mới)npm run prisma:deploy: apply migration hiện cónpm run prisma:studio: mở Prisma Studionpm run setup: setup 1 lệnh cho local
Success:
{
"success": true,
"message": "OK",
"data": {}
}Error:
{
"success": false,
"message": "Validation error",
"errors": {}
}Phase tiếp theo:
- Authentication & User Profile (register/login/me/update profile)
- Role-based authorization middleware hoàn chỉnh
- Places + Search + Map APIs
- Posts/Feed + Interactions
- Admin moderation workflow
- Không commit
.envthật lên git. - Secret/JWT key chỉ lưu local hoặc secret manager.
- Backend luôn kiểm tra role từ token/DB, không tin dữ liệu role từ frontend.
Dự án phục vụ học tập và phát triển sản phẩm mẫu. Có thể điều chỉnh license theo nhu cầu nhóm.