FFW (Fresh Food Website) là hệ thống thương mại điện tử về thực phẩm trái cây, rau củ tươi sống, được xây dựng với công nghệ hiện đại. Dự án bao gồm Frontend (React) và Backend (Node.js/Express).
- 🛍️ Tìm kiếm, lọc và xem chi tiết sản phẩm
- 🛒 Quản lý giỏ hàng thông minh
- 📦 Đặt hàng và theo dõi trạng thái đơn hàng
- 👤 Quản lý tài khoản và địa chỉ giao hàng
- ⭐ Đánh giá sản phẩm
- 📱 Giao diện responsive trên desktop, mobile
- 📊 Dashboard quản lý tổng quan
- 📦 Quản lý sản phẩm (CRUD, upload hình ảnh)
- 📋 Quản lý đơn hàng và cập nhật trạng thái
- 👥 Quản lý người dùng
- 📈 Thống kê sản phẩm bán chạy
- React 19 - Thư viện UI hiện đại
- Vite - Build tool cực nhanh
- Tailwind CSS - CSS framework
- React Router - Routing
- Axios - HTTP client
- Context API - State management
- Node.js & Express - Server framework
- MongoDB & Mongoose - NoSQL database
- JWT - Authentication & authorization
- Bcrypt - Mã hóa mật khẩu
- Cloudinary - Lưu trữ hình ảnh
- Multer - File upload
FFW-server/
├── client/ # Frontend React Application
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ ├── context/ # Context API
│ │ └── utils/ # Utilities
│ ├── package.json
│ └── README.md # Client documentation
│
├── server/ # Backend API
│ ├── src/
│ │ ├── controllers/ # Request handlers
│ │ ├── models/ # Database schemas
│ │ ├── routes/ # API routes
│ │ ├── services/ # Business logic
│ │ ├── middlewares/ # Authentication & validation
│ │ └── utils/ # Helpers
│ ├── package.json
│ └── README.md # Server documentation
│
└── README.md # File này
- Node.js 18.x trở lên
- npm 9.x trở lên
- MongoDB (local hoặc MongoDB Atlas)
git clone https://github.com/vanhuy2005/fresh-fruit-web.git
cd fresh-frui-webcd server
npm installTạo file .env từ .env.sample và cấu hình:
Copy-Item .env.sample .envChạy server:
npm run dev
# Server chạy tại http://localhost:3000Mở terminal mới:
cd client
npm installChạy client:
npm run dev
# Client chạy tại http://localhost:5173Để biết thêm chi tiết về cài đặt và sử dụng:
- Client Documentation - Hướng dẫn chi tiết Frontend
- Server Documentation - Hướng dẫn chi tiết Backend API
- JWT-based authentication
- Role-based access control (User/Admin)
- Bcrypt password hashing
- RESTful API design
- CORS configuration
- File upload với Multer
- Image hosting với Cloudinary
- MongoDB aggregation pipelines
- React Context for state management
- Protected routes
- Hot reload với Vite
- Tailwind CSS utilities
- Toast notifications
POST /api/v1/register- Đăng kýPOST /api/v1/login- Đăng nhậpGET /api/v1/products- Danh sách sản phẩm
GET /api/v1/user/:id- Thông tin userPOST /api/v1/cart/product- Thêm vào giỏPOST /api/v1/order- Tạo đơn hàng
POST /api/v1/admin/product- Tạo sản phẩmGET /api/v1/admin/orders- Quản lý đơn hàngGET /api/v1/admin/users- Quản lý người dùng
📖 Xem chi tiết tại Server Documentation
Hệ thống sử dụng 5 models chính:
- User - Quản lý người dùng (khách hàng & admin)
- Product - Sản phẩm thực phẩm tươi sống
- Cart - Giỏ hàng của người dùng
- Order - Đơn hàng và chi tiết
- Review - Đánh giá sản phẩm
📖 Xem chi tiết schema tại Server Documentation
MONGODB_URI=your_mongodb_connection_string
PORT_BE=3000
USER_ACCESS_TOKEN_SECRET=your_secret
ADMIN_ACCESS_TOKEN_SECRET=your_admin_secret
CLOUDINARY_CLOUD_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secretFrontend mặc định kết nối tới backend tại http://localhost:3000 (hoặc production URL đã config).
Cảm ơn tất cả những người đã đóng góp vào dự án này! 💚
Nếu bạn muốn đóng góp:
- Fork repository
- Tạo branch mới (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add some amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Tạo Pull Request
Dự án được phát hành dưới giấy phép ISC.
Xin chân thành cảm ơn:
- React Team - Thư viện UI tuyệt vời
- Vite Team - Build tool cực nhanh
- MongoDB Team - Database linh hoạt
- Cloudinary - Image hosting service
- Tailwind CSS - CSS framework hiệu quả
- Tất cả contributors - Những người đã đóng góp code, báo lỗi, đề xuất tính năng
Cảm ơn cộng đồng open-source đã tạo ra những công cụ tuyệt vời này! 🎉
- GitHub Issues: Report bugs hoặc request features
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by FFW Team
Happy Shopping! 🛒🌿