🛍️ Source code website bán hàng thời trang Full Stack hoàn chỉnh, sẵn sàng chạy ngay.
⚙️ CÔNG NGHỆ:
• Backend: Java 21 + Spring Boot 3 + Spring Security + JPA
• Frontend: Next.js 16 + React 19 + TypeScript
• Database: MariaDB + Redis Cache
• AI Chatbot: LM Studio (Qwen 3.5 2B) — chạy local, không tốn phí API
• Thanh toán: VNPay tích hợp sẵn
✅ TÍNH NĂNG NỔI BẬT:
• Khách hàng: Mua hàng, thanh toán VNPay/COD, theo dõi đơn, tích điểm thưởng, đánh giá sản phẩm
• Admin: Dashboard thống kê, quản lý sản phẩm/đơn hàng/kho/mã giảm giá, phân quyền RBAC
• Bảo mật: JWT + Refresh Token, BCrypt, Audit Log, Rate Limiting
• Giám sát hệ thống: RAM, CPU, Disk real-time
📦 BAO GỒM: Full source code + File SQL + Tài liệu setup (chạy được trong 5 phút)
👨💻 PHÙ HỢP: Sinh viên làm đồ án | Developer học Spring Boot + Next.js | Tham khảo kiến trúc thực tế
Code web
Sharecode
Code đồ án
Web bán hàng
Source code web
XEM THÊM ==> Hướng dẫn cài đặt chi tiết
Nguồn: Sharecode.vn
# ⚡ Khởi Chạy Nhanh — Fashion E-Commerce
> Chạy toàn bộ hệ thống trong ~10 phút
---
## 🧩 Yêu Cầu Tối Thiểu
| Công cụ | Phiên bản |
|---------|-----------|
| Java JDK | 21+ |
| Maven | 3.8+ |
| Node.js | 20 LTS |
| MariaDB | 10.6+ |
> **Tùy chọn:** Redis (cache), LM Studio (AI chatbot), ngrok (test VNPay)
---
## 🚀 Khởi Chạy
### Bước 1 — Tạo Database
```bash
mysql -u root -p
```
```sql
CREATE DATABASE fashion_shop CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
EXIT;
```
### Bước 2 — Cấu Hình Backend
Mở `src/main/resources/application.properties`, cập nhật:
```properties
# Đổi thành username/password MariaDB của bạn
spring.datasource.username=${DB_USERNAME:root}
spring.datasource.password=${DB_PASSWORD:root}
```
### Bước 3 — Chạy Backend (Spring Boot)
```bash
# Windows (trong thư mục gốc D:\Project\fashion)
mvn spring-boot:run
# Hoặc build JAR rồi chạy
mvn clean package -DskipTests
java -jar target/fashion-0.0.1-SNAPSHOT.jar
```
✅ Chờ thấy: `Started FashionApplication` → Backend đang chạy tại **http://localhost:8080**
### Bước 4 — Chạy Frontend (Next.js)
```bash
# Mở terminal mới
cd frontend
npm install
npm run dev
```
✅ Frontend đang chạy tại **http://localhost:3000**
---
## 🔑 Đăng Nhập Admin
| Trường | Giá trị |
|--------|---------|
| URL | http://localhost:8080/login |
| Password | `Admin@123` |
---
## 🔧 Kích Hoạt Tính Năng Tùy Chọn
<details>
<summary>🤖 AI Chatbot (LM Studio)</summary>
1. Tải & cài [LM Studio](https://lmstudio.ai)
2. Search và download model: `lmstudio-community/qwen3.5-2b`
3. Vào tab **Local Server** → chọn model → **Start Server**
4. Verify: `curl http://127.0.0.1:1234/v1/models`
5. Truy cập chatbot: http://localhost:8080/ai-chatbot
> ⚠️ LM Studio phải khởi động **trước** Spring Boot
</details>
<details>
<summary>⚡ Redis Cache</summary>
```bash
# Docker (khuyến nghị)
docker run -d -p 6380:6379 --name fashion-redis redis:7-alpine
# Kiểm tra
redis-cli -p 6380 ping # → PONG
```
> Nếu không có Redis, hệ thống tự dùng in-memory cache — vẫn chạy bình thường.
</details>
<details>
<summary>💳 VNPay Payment (Sandbox)</summary>
1. Đăng ký tại https://sandbox.vnpayment.vn/
2. Chạy ngrok: `ngrok http 8080`
3. Cập nhật trong `application.properties`:
```properties
vnpay.tmn-code=YOUR_TMN_CODE
vnpay.hash-secret=YOUR_HASH_SECRET
vnpay.return-url=https://<ngrok-url>/api/payment/vnpay/callback
vnpay.ipn-url=https://<ngrok-url>/api/payment/vnpay/ipn
```
</details>