Đây là dự án môn học NT548 - Công nghệ DevOps và Ứng dụng. Dự án xây dựng một ứng dụng Cookmate/KitchenWhiz theo kiến trúc microservices, triển khai trên AWS EKS với CI/CD pipeline hoàn chỉnh.
┌─────────────────────────────────────────────────────────────────┐
│ AWS Cloud │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ CI Platform (Terraform) │ │
│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │
│ │ │ Jenkins │ │ SonarQube │ │ Harbor │ │ │
│ │ │ Server │ │ Server │ │ Server │ │ │
│ │ └─────────────┘ └─────────────┘ └─────────────┘ │ │
│ └───────────────────────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ EKS Cluster │ │
│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │
│ │ │ Frontend │ │ User │ │ Recipe │ │ │
│ │ │ (React) │ │ Service │ │ Service │ │ │
│ │ └─────────────┘ └─────────────┘ └─────────────┘ │ │
│ └───────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
NT548-Project/
├── 1-terraform-ci-platform/ # Terraform cho CI/CD platform
│ ├── modules/
│ │ ├── ec2-jenkins-server/ # Jenkins server
│ │ ├── ec2-sonarqube-server/# SonarQube server
│ │ ├── ec2-harbor-server/ # Harbor registry
│ │ ├── vpc/ # VPC configuration
│ │ ├── route-tables/ # Route tables
│ │ └── security-group/ # Security groups
│ └── main.tf
│
├── 2-terraform-eks-deployment/ # Terraform cho EKS cluster
│ ├── modules/
│ │ ├── eks/ # EKS cluster module
│ │ └── vpc/ # VPC cho EKS
│ └── main.tf
│
├── microservices-app/ # Ứng dụng microservices
│ ├── fe-app/ # Frontend (React + Vite)
│ ├── user-service/ # User Service (Node.js + Express)
│ └── recipe-service/ # Recipe Service (Node.js + Express)
│
├── deployment/ # Kubernetes manifests
│ ├── namespace.yaml
│ ├── user-service-all.yaml
│ ├── recipe-service-all.yaml
│ └── deploy.sh
│
├── script-for-install-tools/ # Scripts cài đặt tools
│ ├── docker_install.sh
│ ├── jenkins_install.sh
│ └── sonarqube_install.sh
│
└── Jenkinsfile # CI/CD Pipeline
| Công nghệ | Mô tả |
|---|---|
| Terraform | Infrastructure as Code (IaC) |
| AWS | Cloud Provider |
| EKS | Kubernetes cluster |
| VPC | Virtual Private Cloud |
| Công nghệ | Mô tả |
|---|---|
| Jenkins | CI/CD automation server |
| SonarQube | Code quality & security analysis |
| Harbor | Private container registry |
| Trivy | Container vulnerability scanner |
| Công nghệ | Mô tả |
|---|---|
| React 19 | Frontend framework |
| Vite | Build tool |
| TailwindCSS | CSS framework |
| Node.js + Express 5 | Backend framework |
| MongoDB (Mongoose) | Database |
| JWT | Authentication |
| Swagger | API Documentation |
| Cloudinary | Image storage |
- Port: 80 (nginx)
- Tech: React 19, Vite, TailwindCSS, React Router
- Features: UI/UX cho ứng dụng quản lý công thức nấu ăn
- Port: 5001
- API Docs:
/user-api-docs - Features:
- Đăng ký/Đăng nhập người dùng
- Quản lý profile
- Authentication với JWT
- Upload ảnh avatar (Cloudinary)
- Email notifications (Nodemailer)
- Port: 5002
- API Docs:
/recipe-api-docs - Features:
- CRUD công thức nấu ăn
- Quản lý nguyên liệu
- Upload ảnh công thức
- Tìm kiếm và lọc công thức
Pipeline được cấu hình trong Jenkinsfile với các stage:
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Verify │───▶│ SonarQube │───▶│ Build │
│ Tag │ │ Scan │ │ Image │
└──────────────┘ └──────────────┘ └──────────────┘
│
▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Deploy │◀───│ Push │◀───│ Trivy │
│ to EKS │ │ to Harbor │ │ Scan │
└──────────────┘ └──────────────┘ └──────────────┘
- Verify Tag - Xác nhận tag version
- SonarQube Scan - Kiểm tra chất lượng code
- Build Image - Build Docker image
- Trivy Scan - Quét lỗ hổng bảo mật container
- Push to Harbor - Push image lên private registry
- Deploy to EKS - Triển khai lên Kubernetes cluster
cd 1-terraform-ci-platform
terraform init
terraform plan
terraform applycd 2-terraform-eks-deployment
terraform init
terraform plan
terraform applycd deployment
chmod +x deploy.sh
./deploy.sh# Frontend
cd microservices-app/fe-app
npm install
npm run dev
# User Service
cd microservices-app/user-service
npm install
npm start
# Recipe Service
cd microservices-app/recipe-service
npm install
npm startPORT=5001
MONGODB_URI=<mongodb_connection_string>
JWT_SECRET=<jwt_secret_key>
CLOUDINARY_CLOUD_NAME=<cloudinary_name>
CLOUDINARY_API_KEY=<cloudinary_api_key>
CLOUDINARY_API_SECRET=<cloudinary_api_secret>
EMAIL_USER=<email_for_notifications>
EMAIL_PASS=<email_password>PORT=5002
MONGODB_URI=<mongodb_connection_string>
JWT_SECRET=<jwt_secret_key>
CLOUDINARY_CLOUD_NAME=<cloudinary_name>
CLOUDINARY_API_KEY=<cloudinary_api_key>
CLOUDINARY_API_SECRET=<cloudinary_api_secret>NT548 - Group 09
| Tên thành viên | Mã số sinh viên |
|---|---|
| Trần Thị Thùy Tiên | 23521588 |
| Trần Lê Uyên Thy | 23521564 |
| Lê Trung Kiên | 23520797 |
| Trần Thuận Thến | 23521471 |
- Trước khi bắt đầu làm, đọc kĩ quy trình làm việc với Git & GitHub tại đây.
- Ghi rõ nội dung commit
- Chỉ commit khi hoàn thành 1 feature/ bug nào đó, không commit khi đang làm dở, không commit dồn.
- Khi muốn task/feature merge vào main, tạo pull request (đã cài Protection rules), sau đó nhờ một bạn trong nhóm review code và approve pull request.
- Xóa nhánh khi merge thành công.
This project is for educational purposes - NT548 Course Project.