A comprehensive food ordering platform built with the MERN Stack (MongoDB, Express.js, React, Node.js), featuring a modern UI, multiple payment gateways, and comprehensive software testing.
- Tổng quan dự án
- Tính năng chính
- Công nghệ sử dụng
- Kiểm thử phần mềm
- Cài đặt và chạy dự án
- Docker Deployment
- Cấu hình môi trường
- API Documentation
- Đóng góp
FastFoodOnline là nền tảng đặt đồ ăn trực tuyến toàn diện với ba hệ thống:
- Xem menu và tìm kiếm món ăn
- Quản lý giỏ hàng thông minh
- Đặt hàng và theo dõi đơn hàng real-time
- Tích hợp 3 cổng thanh toán: VNPAY, Stripe, MoMo
- Lịch sử đơn hàng và đánh giá
- Quản lý món ăn (CRUD operations)
- Quản lý đơn hàng và trạng thái giao hàng
- Dashboard với thống kê doanh thu
- Quản lý người dùng và quyền truy cập
- Upload hình ảnh với Cloudinary
- RESTful API với Express.js
- JWT Authentication & Authorization
- Password hashing với Bcrypt
- MongoDB với Mongoose ODM
- Swagger API Documentation
- Rate limiting và security middleware
- Đăng ký/Đăng nhập với JWT Token
- Password hashing (Bcrypt with salt)
- Role-based access control (User, Admin, Shipper)
- Session management
- Protected routes và API endpoints
- XSS và SQL injection protection
- Browse menu theo categories
- Search và filter món ăn
- Responsive food cards với images
- Food details và nutritional info
- Real-time availability status
- Add/Remove/Update items
- Quantity management
- Price calculation với taxes
- Persistent cart (localStorage + database)
- Cart validation và stock checking
- VNPAY (Vietnam Payment)
- QR Code và Internet Banking
- Sandbox environment
- Stripe (International)
- Card payments
- 3D Secure support
- MoMo (E-Wallet)
- QR Code payment
- MoMo app deep linking
- Order tracking với real-time updates
- Order history và re-order
- Status workflow: Pending → Processing → Shipping → Delivered
- Email notifications (planned)
- Responsive design (Mobile-first)
- Dark mode support (planned)
- PWA capabilities
- Image optimization với Cloudinary
- Caching strategies
- Error handling và logging
Dự án được kiểm thử toàn diện với 90+ test cases theo chuẩn quốc tế, áp dụng nhiều phương pháp luận kiểm thử.
test_results_final/
├── 01_Documents/ # Tài liệu kế hoạch kiểm thử
│ └── Test_Plan_FastFoodOnline.html
├── 02_Test_Cases/ # Test cases chi tiết (90+ TCs)
│ ├── Sheet 1: Summary Report
│ ├── Sheet 2: Menu & Cart Module (27 TCs)
│ ├── Sheet 3: Authentication Module (18 TCs)
│ ├── Sheet 4: Test Case List
│ └── Sheet 5: Cover Page
├── 03_Test_Reports/ # Báo cáo kết quả kiểm thử
│ ├── Test_Report_FastFoodOnline.csv
│ ├── Defect_List_FastFoodOnline.csv (Bug Reports)
│ └── Test_Summary.md
├── 04_Design_Documents/ # Tài liệu thiết kế
│ ├── Database_Design.md
│ ├── Architecture_Design.md
│ ├── UseCase_Description.md
│ └── Screen_Design.md
└── 05_Review_Checklists/ # Checklist đánh giá
├── Test_Plan_Review_Checklist.csv
└── Test_Case_Review_Checklist.csv
| Module | Test Cases | Black Box | Grey Box | White Box |
|---|---|---|---|---|
| Authentication | 18 TCs | 9 | 4 | 5 |
| Menu Management | 12 TCs | 7 | 3 | 2 |
| Cart Management | 15 TCs | 8 | 4 | 3 |
| Order & Payment | 25 TCs | 12 | 7 | 6 |
| Admin Panel | 20 TCs | 14 | 4 | 2 |
| TOTAL | 90 TCs | 50 (55.6%) | 22 (24.4%) | 18 (20%) |
Kiểm tra chức năng từ góc độ người dùng cuối:
Kỹ thuật áp dụng:
-
Equivalence Partitioning: Chia input thành các nhóm tương đương
VD: Password strength testing - Valid partitions: 8-20 chars, có chữ hoa, số, ký tự đặc biệt - Invalid partitions: < 8 chars, không có số, không có ký tự đặc biệt -
Boundary Value Analysis: Kiểm tra giá trị biên
VD: Cart quantity testing - Minimum: 1 item - Maximum: 99 items - Boundary: 0, 1, 98, 99, 100
Ví dụ Test Cases:
- ✅ TC-BB-AUTH-001: Đăng ký tài khoản với email hợp lệ
- ✅ TC-BB-AUTH-002: Đăng ký với email đã tồn tại (Negative test)
- ✅ TC-BB-CART-005: Thêm món vào giỏ hàng với số lượng = 100 (Boundary)
- ✅ TC-BB-ORDER-012: Thanh toán với VNPAY thành công
Kiểm tra với một phần hiểu biết về cấu trúc nội bộ:
Kỹ thuật áp dụng:
- Database state validation
- API response verification
- Session và token management
- Integration between components
Ví dụ Test Cases:
- ✅ TC-GB-AUTH-001: JWT Token được tạo và lưu đúng format
- ✅ TC-GB-AUTH-002: Password được hash với Bcrypt
- ✅ TC-GB-CART-003: Cart được đồng bộ giữa localStorage và database
- ✅ TC-GB-ORDER-004: Order status workflow hoạt động đúng
Kiểm tra cấu trúc code và logic nội bộ:
Kỹ thuật áp dụng:
- Statement Coverage: ≥ 80% statements được thực thi
- Branch Coverage: ≥ 75% branches được test
- Path Coverage: Các đường đi quan trọng được cover
- Security Testing: Vulnerability scanning
Ví dụ Test Cases:
// TC-WB-AUTH-001: Statement Coverage cho loginUser()
function loginUser(email, password) {
if (!email) return error; // Branch 1 ✓
if (!validateEmail(email)) {...} // Branch 2 ✓
const user = await findUser(); // Statement ✓
if (!user) return notFound; // Branch 3 ✓
if (!bcrypt.compare()) {...} // Branch 4 ✓
return success; // Statement ✓
}Code Coverage Results:
- Statement Coverage: 82.4% ✅
- Branch Coverage: 76.8% ✅
- Function Coverage: 85.3% ✅
- Line Coverage: 81.9% ✅
| Severity | Count | Fixed | Pending | Closed |
|---|---|---|---|---|
| Critical | 2 | 1 | 1 | 0 |
| High | 3 | 2 | 1 | 0 |
| Medium | 1 | 1 | 0 | 0 |
| Low | 0 | 0 | 0 | 0 |
| Total | 6 | 4 | 2 | 0 |
-
DEF-001: Password không được hash khi lưu database
- Severity: Critical | Priority: High
- Status: Fixed
- Root Cause: Missing bcrypt middleware
-
DEF-006: VNPAY signature verification error
- Severity: Critical | Priority: High
- Status: Pending
- Root Cause: Incorrect hash algorithm
Hardware:
- CPU: Intel Core i5 or higher
- RAM: 8GB minimum
- Storage: 20GB available
Software:
- OS: Windows 10/11, macOS 13+, Ubuntu 20.04+
- Node.js: v20 LTS
- MongoDB: v6.0+
- Browsers: Chrome 120+, Firefox 121+, Safari 17+
Tools:
- Test Management: Manual testing với CSV templates
- API Testing: Postman, Thunder Client
- Performance: Lighthouse, WebPageTest
- Security: OWASP ZAP (planned)
Test Execution:
- Total Test Cases: 90
- Executed: 90 (100%)
- Passed: 84 (93.3%)
- Failed: 6 (6.7%)
- Blocked: 0 (0%)
Defect Detection Rate:
- Bugs found per testing hour: 1.2
- Critical bugs: 2
- Average fix time: 2.5 hours
Test Coverage:
- Functional Coverage: 95%
- Requirements Coverage: 100%
- Code Coverage: 82%
- Mở file
test_results_final/01_Documents/Test_Plan_FastFoodOnline.html - Có thể mở bằng:
- Web Browser (Chrome, Firefox)
- Microsoft Word (File → Open → chọn HTML)
- Google Docs (Upload và mở)
- Đọc
test_results_final/README.mdđể hiểu cấu trúc - Mở các file CSV bằng:
- Microsoft Excel (UTF-8 encoding)
- Google Sheets (Import với encoding UTF-8)
- VS Code với extension Rainbow CSV
npm run convert:csv-to-excelXem file TEST_CASES.md để biết danh sách đầy đủ 90+ test cases với:
- Test Case ID và Description
- Pre-conditions và Test Data
- Step-by-step procedure
- Expected và Actual results
- Pass/Fail status
Hoặc xem trực tiếp trong thư mục:
test_results_final/02_Test_Cases/
- React 18 - UI library với Hooks
- Vite - Build tool và dev server
- React Router v6 - Client-side routing
- Context API - State management
- Axios - HTTP client
- CSS3 - Styling với responsive design
- Node.js 20 LTS - Runtime environment
- Express.js - Web framework
- MongoDB - NoSQL database
- Mongoose - ODM cho MongoDB
- JWT - JSON Web Tokens cho authentication
- Bcrypt - Password hashing
- VNPAY - Vietnam payment gateway
- Stripe - International credit/debit cards
- MoMo - Vietnam e-wallet
- Docker & Docker Compose - Containerization
- Nginx - Reverse proxy và static file serving
- Cloudinary - Image hosting và optimization
- Git - Version control
- Postman - API testing
- MongoDB Atlas - Cloud database
- Jest (planned) - Unit testing
- React Testing Library (planned) - Component testing
- Supertest (planned) - API testing
- Manual testing với comprehensive test cases
- Node.js: v20 LTS hoặc cao hơn
- npm: v10+ (đi kèm với Node.js 20)
- MongoDB: v6.0+ (hoặc MongoDB Atlas)
- Git: Latest version
git clone https://github.com/yourusername/FastFoodOnline.git
cd FastFoodOnlineDự án sử dụng automated installation script:
# Cài đặt tất cả dependencies (backend + frontend + admin)
npm installScript tự động chạy:
npm installtrong thư mụcbackend/npm installtrong thư mụcfrontend/npm installtrong thư mụcadmin/
Hoặc cài đặt thủ công từng phần:
# Backend
npm install --prefix backend
# Frontend
npm install --prefix frontend
# Admin
npm install --prefix admin- Tạo tài khoản tại MongoDB Atlas
- Tạo một cluster mới (Free tier: M0)
- Whitelist your IP address
- Tạo database user với username/password
- Lấy connection string
# Cài đặt MongoDB Community Edition
# Windows: Download từ mongodb.com
# macOS: brew install mongodb-community
# Linux: apt-get install mongodb
# Start MongoDB
mongod --dbpath /path/to/data/directoryTạo file .env trong thư mục backend/:
# Database
MONGO_URL=mongodb+srv://username:password@cluster.mongodb.net/fastfood?retryWrites=true&w=majority
# JWT
JWT_SECRET=your_very_long_random_secret_key_here
SALT=10
# VNPAY Payment
VNPAY_TMN_CODE=your_vnpay_terminal_code
VNPAY_HASH_SECRET=your_vnpay_hash_secret
VNPAY_RETURN_URL=http://localhost:5173/verify
VNPAY_PAY_URL=https://sandbox.vnpayment.vn/paymentv2/vpcpay.html
# Stripe Payment
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key
STRIPE_SUCCESS_URL=http://localhost:5173/verify
STRIPE_CANCEL_URL=http://localhost:5173/order
STRIPE_CURRENCY=vnd
# MoMo Payment
MOMO_PARTNER_CODE=your_momo_partner_code
MOMO_ACCESS_KEY=your_momo_access_key
MOMO_SECRET_KEY=your_momo_secret_key
MOMO_ENDPOINT=https://test-payment.momo.vn/v2/gateway/api/create
MOMO_QUERY_ENDPOINT=https://test-payment.momo.vn/v2/gateway/api/query
MOMO_REDIRECT_URL=http://localhost:5173/verify
MOMO_IPN_URL=
MOMO_REQUEST_TYPE=captureWallet
MOMO_LANG=vi
# Server
FRONTEND_BASE_URL=http://localhost:5173
PORT=4000Lưu ý:
- Để test payment, cần đăng ký tài khoản sandbox tại các payment gateway
- VNPAY sandbox: https://sandbox.vnpayment.vn
- MoMo test: https://developers.momo.vn
npm run devLệnh này sẽ start đồng thời:
- Backend API: http://localhost:4000
- Frontend: http://localhost:5173
- Admin Panel: http://localhost:5174
Backend:
npm run server --prefix backend
# hoặc
cd backend && npm run serverFrontend:
cd frontend
npm run devAdmin:
cd admin
npm run dev-
Backend: Mở http://localhost:4000
- Nếu thấy "Cannot GET /", backend đã chạy thành công
- Check console log: "DB Connected: ..." và "Server Started on port: 4000"
-
Frontend: Mở http://localhost:5173
- Trang chủ hiển thị menu món ăn
-
Admin: Mở http://localhost:5174
- Dashboard admin panel
# Check MongoDB Atlas connection
# 1. Verify MONGO_URL in .env
# 2. Whitelist your IP on Atlas
# 3. Check username/password
# 4. Ensure network access
# View backend logs
docker compose logs backend # nếu dùng Docker
# hoặc check terminal console# Kill process on port
# Windows
netstat -ano | findstr :4000
taskkill /PID <PID> /F
# macOS/Linux
lsof -ti:4000 | xargs kill -9# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install
# Or for specific folder
cd backend
rm -rf node_modules package-lock.json
npm installDự án hỗ trợ containerization hoàn chỉnh với Docker Compose.
- Docker Desktop: v24+ (Windows/Mac)
- Docker Engine: v24+ (Linux)
- Docker Compose: v2.20+
- Start toàn bộ stack:
npm run docker:up
# hoặc
docker compose up --buildServices sẽ chạy tại:
- Frontend: http://localhost:5173
- Admin: http://localhost:5174
- Backend API: http://localhost:4000
- Stop services:
npm run docker:down
# hoặc
docker compose down- View logs:
npm run docker:logs
# hoặc
docker compose logs -f backend
docker compose logs -f frontenddocker-compose.yml:
version: '3.8'
services:
backend:
build: ./backend
ports:
- "4000:4000"
environment:
- MONGO_URL=${MONGO_URL}
env_file:
- ./backend/.env
frontend:
build: ./frontend
ports:
- "5173:80"
depends_on:
- backend
admin:
build: ./admin
ports:
- "5174:80"
depends_on:
- backendLưu ý:
- MongoDB phải chạy trên MongoDB Atlas (hoặc external instance)
- Docker Compose không bao gồm MongoDB container
- Environment variables được load từ
backend/.env
# Rebuild specific service
docker compose up --build backend
# Rebuild all
docker compose up --build
# Remove all containers and rebuild
docker compose down
docker compose up --buildFastFoodOnline/
├── backend/ # Node.js Backend
│ ├── config/ # Configuration files
│ │ ├── cloudinary.js # Cloudinary setup
│ │ └── db.js # MongoDB connection
│ ├── controllers/ # Route controllers
│ │ ├── cartController.js
│ │ ├── userController.js
│ │ └── v2/ # API version 2
│ ├── middleware/ # Express middlewares
│ │ └── auth.js # JWT authentication
│ ├── models/ # Mongoose models
│ │ ├── userModel.js
│ │ └── v2/ # Models v2
│ ├── routes/ # API routes
│ │ ├── cartRoute.js
│ │ ├── foodRoute.js
│ │ ├── orderRoute.js
│ │ └── userRoute.js
│ ├── uploads/ # Uploaded images
│ ├── .env # Environment variables
│ ├── app.js # Express app setup
│ ├── server.js # Server entry point
│ └── package.json
│
├── frontend/ # React Frontend (User Panel)
│ ├── public/ # Static assets
│ ├── src/
│ │ ├── assets/ # Images, icons
│ │ ├── components/ # React components
│ │ │ ├── Navbar/
│ │ │ ├── Header/
│ │ │ ├── FoodItem/
│ │ │ └── ...
│ │ ├── context/ # React Context
│ │ │ └── StoreContext.jsx
│ │ ├── pages/ # Page components
│ │ │ ├── Home/
│ │ │ ├── Cart/
│ │ │ ├── PlaceOrder/
│ │ │ └── ...
│ │ ├── App.jsx # Main App component
│ │ └── main.jsx # Entry point
│ ├── .env.local # Frontend env (optional)
│ ├── vite.config.js
│ └── package.json
│
├── admin/ # React Admin Panel
│ ├── public/
│ ├── src/
│ │ ├── components/ # Admin components
│ │ │ ├── Navbar/
│ │ │ ├── Sidebar/
│ │ │ └── ...
│ │ ├── pages/ # Admin pages
│ │ │ ├── Add/
│ │ │ ├── List/
│ │ │ ├── Orders/
│ │ │ └── ...
│ │ ├── App.jsx
│ │ └── main.jsx
│ ├── vite.config.js
│ └── package.json
│
├── docker/ # Docker configs
├── docker-compose.yml # Docker Compose config
├── package.json # Root package.json
├── README.md # This file
├── TEST_CASES.md # Detailed test cases
└── .gitignore
Development: http://localhost:4000
Production: https://your-api-domain.com
POST /api/user/register
Content-Type: application/json
{
"name": "John Doe",
"email": "john@example.com",
"password": "SecurePass123"
}
Response: 200 OK
{
"success": true,
"token": "jwt_token_here"
}POST /api/user/login
Content-Type: application/json
{
"email": "john@example.com",
"password": "SecurePass123"
}
Response: 200 OK
{
"success": true,
"token": "jwt_token_here"
}GET /api/food/list
Response: 200 OK
{
"success": true,
"data": [
{
"_id": "food_id",
"name": "Margherita Pizza",
"description": "Classic pizza with tomato and mozzarella",
"price": 199000,
"image": "https://cloudinary.com/...",
"category": "Pizza"
}
]
}POST /api/food/add
Authorization: Bearer <admin_token>
Content-Type: multipart/form-data
name: Margherita Pizza
description: Classic pizza
price: 199000
category: Pizza
image: <file>
Response: 201 Created
{
"success": true,
"message": "Food added successfully"
}POST /api/cart/add
Authorization: Bearer <user_token>
Content-Type: application/json
{
"itemId": "food_id",
"quantity": 2
}
Response: 200 OK
{
"success": true,
"message": "Added to cart"
}POST /api/order/place
Authorization: Bearer <user_token>
Content-Type: application/json
{
"items": [...],
"amount": 398000,
"address": {...},
"paymentMethod": "vnpay"
}Xem thêm API endpoints trong docs/api-v2.md
# Development
npm run dev # Chạy tất cả (backend + frontend + admin)
npm run server --prefix backend # Chạy backend only
npm run dev --prefix frontend # Chạy frontend only
npm run dev --prefix admin # Chạy admin only
# Installation
npm install # Cài đặt tất cả dependencies
npm run install:backend # Cài đặt backend only
npm run install:frontend # Cài đặt frontend only
npm run install:admin # Cài đặt admin only
# Docker
npm run docker:up # Start all services với Docker
npm run docker:down # Stop all services
npm run docker:logs # View backend logs
# Utilities
npm run convert:csv-to-excel # Convert test cases CSV to ExcelContributions are always welcome! Để đóng góp:
- Fork repository này
- Tạo branch mới (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add some AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Tạo Pull Request
- Follow existing code style
- Write meaningful commit messages
- Update documentation nếu cần
- Add tests for new features
- Ensure all tests pass
This project is licensed under the MIT License - see the LICENSE file for details.
Project Team: FastFoodOnline Development Team
GitHub: Repository Link
Feedback: Nếu có bất kỳ feedback hoặc câu hỏi nào, vui lòng liên hệ qua Issues trên GitHub.
- ✅ Initial release với đầy đủ tính năng
- ✅ MERN Stack implementation
- ✅ 3 Payment gateways: VNPAY, Stripe, MoMo
- ✅ Admin panel hoàn chỉnh
- ✅ Docker support
- ✅ Comprehensive testing với 90+ test cases
- ✅ API documentation
- ✅ Responsive design
- Automated testing với Jest và Cypress
- Real-time order tracking với WebSocket
- Email notifications cho orders
- SMS notifications với Twilio
- Multi-language support (i18n)
- Dark mode
- PWA features (offline support)
- Performance optimization
- SEO optimization
- Analytics dashboard
- Customer reviews và ratings
- Loyalty program
- Promo codes và discounts
- Test Cases Documentation - Chi tiết 90+ test cases
- Test Results Folder - Tất cả tài liệu kiểm thử
- API Documentation v2 - API specs chi tiết
- Database Design
- Architecture Design
- Use Case Descriptions
⭐ Nếu bạn thấy dự án này hữu ích, hãy cho một star nhé! ⭐
Made with ❤️ by FastFoodOnline Team
Frontend/Admin URL
- Mặc định cả hai app gọi
http://localhost:4000. Khi deploy, tạofrontend/.env,admin/.envvà đặtVITE_API_URL=https://your-api-host.
Start the Backend server
nodemon server.jsStart the Frontend server
npm startStart the Backend server
npm start- React 18 - UI library với Hooks
- Vite - Build tool và dev server
- React Router v6 - Client-side routing
- Context API - State management
- Axios - HTTP client
- CSS3 - Styling với responsive design
- Node.js 20 LTS - Runtime environment
- Express.js - Web framework
- MongoDB - NoSQL database
- Mongoose - ODM cho MongoDB
- JWT - JSON Web Tokens cho authentication
- Bcrypt - Password hashing
- VNPAY - Vietnam payment gateway
- Stripe - International credit/debit cards
- MoMo - Vietnam e-wallet
- Docker & Docker Compose - Containerization
- Nginx - Reverse proxy và static file serving
- Cloudinary - Image hosting và optimization
- Git - Version control
- Postman - API testing
- MongoDB Atlas - Cloud database
- Jest (planned) - Unit testing
- React Testing Library (planned) - Component testing
- Supertest (planned) - API testing
- Manual testing với comprehensive test cases
- Node.js: v20 LTS hoặc cao hơn
- npm: v10+ (đi kèm với Node.js 20)
- MongoDB: v6.0+ (hoặc MongoDB Atlas)
- Git: Latest version
git clone https://github.com/yourusername/FastFoodOnline.git
cd FastFoodOnlineDự án sử dụng automated installation script:
# Cài đặt tất cả dependencies (backend + frontend + admin)
npm installScript tự động chạy:
npm installtrong thư mụcbackend/npm installtrong thư mụcfrontend/npm installtrong thư mụcadmin/
Hoặc cài đặt thủ công từng phần:
# Backend
npm install --prefix backend
# Frontend
npm install --prefix frontend
# Admin
npm install --prefix admin- Tạo tài khoản tại MongoDB Atlas
- Tạo một cluster mới (Free tier: M0)
- Whitelist your IP address
- Tạo database user với username/password
- Lấy connection string
# Cài đặt MongoDB Community Edition
# Windows: Download từ mongodb.com
# macOS: brew install mongodb-community
# Linux: apt-get install mongodb
# Start MongoDB
mongod --dbpath /path/to/data/directoryTạo file .env trong thư mục backend/:
# Database
MONGO_URL=mongodb+srv://username:password@cluster.mongodb.net/fastfood?retryWrites=true&w=majority
# JWT
JWT_SECRET=your_very_long_random_secret_key_here
SALT=10
# VNPAY Payment
VNPAY_TMN_CODE=your_vnpay_terminal_code
VNPAY_HASH_SECRET=your_vnpay_hash_secret
VNPAY_RETURN_URL=http://localhost:5173/verify
VNPAY_PAY_URL=https://sandbox.vnpayment.vn/paymentv2/vpcpay.html
# Stripe Payment
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key
STRIPE_SUCCESS_URL=http://localhost:5173/verify
STRIPE_CANCEL_URL=http://localhost:5173/order
STRIPE_CURRENCY=vnd
# MoMo Payment
MOMO_PARTNER_CODE=your_momo_partner_code
MOMO_ACCESS_KEY=your_momo_access_key
MOMO_SECRET_KEY=your_momo_secret_key
MOMO_ENDPOINT=https://test-payment.momo.vn/v2/gateway/api/create
MOMO_QUERY_ENDPOINT=https://test-payment.momo.vn/v2/gateway/api/query
MOMO_REDIRECT_URL=http://localhost:5173/verify
MOMO_IPN_URL=
MOMO_REQUEST_TYPE=captureWallet
MOMO_LANG=vi
# Server
FRONTEND_BASE_URL=http://localhost:5173
PORT=4000Lưu ý:
- Để test payment, cần đăng ký tài khoản sandbox tại các payment gateway
- VNPAY sandbox: https://sandbox.vnpayment.vn
- MoMo test: https://developers.momo.vn
npm run devLệnh này sẽ start đồng thời:
- Backend API: http://localhost:4000
- Frontend: http://localhost:5173
- Admin Panel: http://localhost:5174
Backend:
npm run server --prefix backend
# hoặc
cd backend && npm run serverFrontend:
cd frontend
npm run devAdmin:
cd admin
npm run dev-
Backend: Mở http://localhost:4000
- Nếu thấy "Cannot GET /", backend đã chạy thành công
- Check console log: "DB Connected: ..." và "Server Started on port: 4000"
-
Frontend: Mở http://localhost:5173
- Trang chủ hiển thị menu món ăn
-
Admin: Mở http://localhost:5174
- Dashboard admin panel
# Check MongoDB Atlas connection
# 1. Verify MONGO_URL in .env
# 2. Whitelist your IP on Atlas
# 3. Check username/password
# 4. Ensure network access
# View backend logs
docker compose logs backend # nếu dùng Docker
# hoặc check terminal console# Kill process on port
# Windows
netstat -ano | findstr :4000
taskkill /PID <PID> /F
# macOS/Linux
lsof -ti:4000 | xargs kill -9# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install
# Or for specific folder
cd backend
rm -rf node_modules package-lock.json
npm installDự án hỗ trợ containerization hoàn chỉnh với Docker Compose.
- Docker Desktop: v24+ (Windows/Mac)
- Docker Engine: v24+ (Linux)
- Docker Compose: v2.20+
- Start toàn bộ stack:
npm run docker:up
# hoặc
docker compose up --buildServices sẽ chạy tại:
- Frontend: http://localhost:5173
- Admin: http://localhost:5174
- Backend API: http://localhost:4000
- Stop services:
npm run docker:down
# hoặc
docker compose down- View logs:
npm run docker:logs
# hoặc
docker compose logs -f backend
docker compose logs -f frontenddocker-compose.yml:
version: '3.8'
services:
backend:
build: ./backend
ports:
- "4000:4000"
environment:
- MONGO_URL=${MONGO_URL}
env_file:
- ./backend/.env
frontend:
build: ./frontend
ports:
- "5173:80"
depends_on:
- backend
admin:
build: ./admin
ports:
- "5174:80"
depends_on:
- backendLưu ý:
- MongoDB phải chạy trên MongoDB Atlas (hoặc external instance)
- Docker Compose không bao gồm MongoDB container
- Environment variables được load từ
backend/.env
# Rebuild specific service
docker compose up --build backend
# Rebuild all
docker compose up --build
# Remove all containers and rebuild
docker compose down
docker compose up --buildContributions are always welcome! Để đóng góp:
- Fork repository này
- Tạo branch mới (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add some AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Tạo Pull Request
- Follow existing code style
- Write meaningful commit messages
- Update documentation nếu cần
- Add tests for new features
- Ensure all tests pass
This project is licensed under the MIT License - see the LICENSE file for details.
Project Team: FastFoodOnline Development Team
GitHub: Repository Link
Feedback: Nếu có bất kỳ feedback hoặc câu hỏi nào, vui lòng liên hệ qua Issues trên GitHub.
- ✅ Initial release với đầy đủ tính năng
- ✅ MERN Stack implementation
- ✅ 3 Payment gateways: VNPAY, Stripe, MoMo
- ✅ Admin panel hoàn chỉnh
- ✅ Docker support
- ✅ Comprehensive testing với 90+ test cases
- ✅ API documentation
- ✅ Responsive design
- Automated testing với Jest và Cypress
- Real-time order tracking với WebSocket
- Email notifications cho orders
- SMS notifications với Twilio
- Multi-language support (i18n)
- Dark mode
- PWA features (offline support)
- Performance optimization
- SEO optimization
- Analytics dashboard
- Customer reviews và ratings
- Loyalty program
- Promo codes và discounts
- Test Cases Documentation - Chi tiết 90+ test cases
- Test Results Folder - Tất cả tài liệu kiểm thử
- API Documentation v2 - API specs chi tiết
- Database Design
- Architecture Design
- Use Case Descriptions
⭐ Nếu bạn thấy dự án này hữu ích, hãy cho một star nhé! ⭐
Made with ❤️ by FastFoodOnline Team