rohandeb2/Easy-shop-E-commerce

GitHub: rohandeb2/Easy-shop-E-commerce

一个基于 Next.js 的生产级全栈电商平台,集成了完整的 DevSecOps 流水线以演示从开发到 Kubernetes 部署的端到端自动化流程。

Stars: 2 | Forks: 0

# 🛍️ EasyShop — 现代电商平台
[![Next.js](https://img.shields.io/badge/Next.js-14.1.0-black?style=for-the-badge&logo=next.js)](https://nextjs.org/) [![TypeScript](https://img.shields.io/badge/TypeScript-5.0.0-3178C6?style=for-the-badge&logo=typescript&logoColor=white)](https://www.typescriptlang.org/) [![MongoDB](https://img.shields.io/badge/MongoDB-8.1.1-47A248?style=for-the-badge&logo=mongodb&logoColor=white)](https://www.mongodb.com/) [![Redux](https://img.shields.io/badge/Redux-2.2.1-764ABC?style=for-the-badge&logo=redux&logoColor=white)](https://redux.js.org/) [![Docker](https://img.shields.io/badge/Docker-ready-2496ED?style=for-the-badge&logo=docker&logoColor=white)](https://www.docker.com/) [![Kubernetes](https://img.shields.io/badge/Kubernetes-deployed-326CE5?style=for-the-badge&logo=kubernetes&logoColor=white)](https://kubernetes.io/) [![License](https://img.shields.io/badge/License-MIT-yellow?style=for-the-badge)](LICENSE) 一个生产级、全栈电商平台,在 AWS EKS 上具备完整的 CI/CD pipeline。 ![EasyShop 网站截图](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/7c4c1f8271003938.png)
## ✨ 功能 | 功能 | 详情 | |---|---| | 🎨 响应式 UI | 暗/亮模式,基于 Tailwind CSS 的移动优先设计 | | 🔐 认证 | 安全的 JWT + NextAuth 会话管理 | | 🛒 购物车 | 通过 Redux Toolkit 实现实时购物车状态 | | 🔍 搜索 | 高级产品搜索和分类过滤 | | 💳 结账 | 多步骤结账流程 | | 👤 个人资料 | 用户账户及订单历史记录 | | 📦 分类 | 电子产品、杂货、服装、家具、美妆等 | ## 🏗️ 架构 EasyShop 采用经典的三层架构,完全容器化并部署在 Kubernetes 上。 ``` ┌─────────────────────────────────────────────┐ │ Presentation Tier │ │ Next.js Components · Redux · Tailwind CSS │ └───────────────────┬─────────────────────────┘ │ HTTP ┌───────────────────▼─────────────────────────┐ │ Application Tier │ │ Next.js API Routes · Auth · Business Logic │ └───────────────────┬─────────────────────────┘ │ Mongoose ODM ┌───────────────────▼─────────────────────────┐ │ Data Tier │ │ MongoDB · CRUD · Validation │ └─────────────────────────────────────────────┘ ``` ## 🚀 技术栈 ### 应用程序 [![Next.js](https://img.shields.io/badge/Next.js-000000?style=flat-square&logo=next.js)](https://nextjs.org/) [![React](https://img.shields.io/badge/React-61DAFB?style=flat-square&logo=react&logoColor=black)](https://react.dev/) [![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?style=flat-square&logo=typescript&logoColor=white)](https://www.typescriptlang.org/) [![MongoDB](https://img.shields.io/badge/MongoDB-47A248?style=flat-square&logo=mongodb&logoColor=white)](https://www.mongodb.com/) [![Redux](https://img.shields.io/badge/Redux-764ABC?style=flat-square&logo=redux&logoColor=white)](https://redux.js.org/) [![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-06B6D4?style=flat-square&logo=tailwindcss&logoColor=white)](https://tailwindcss.com/) ### 基础设施与 CI/CD [![AWS](https://img.shields.io/badge/AWS-232F3E?style=flat-square&logo=amazon-aws&logoColor=white)](https://aws.amazon.com/) [![Terraform](https://img.shields.io/badge/Terraform-7B42BC?style=flat-square&logo=terraform&logoColor=white)](https://www.terraform.io/) [![Docker](https://img.shields.io/badge/Docker-2496ED?style=flat-square&logo=docker&logoColor=white)](https://www.docker.com/) [![Kubernetes](https://img.shields.io/badge/Kubernetes-326CE5?style=flat-square&logo=kubernetes&logoColor=white)](https://kubernetes.io/) [![Jenkins](https://img.shields.io/badge/Jenkins-D24939?style=flat-square&logo=jenkins&logoColor=white)](https://www.jenkins.io/) [![ArgoCD](https://img.shields.io/badge/Argo_CD-EF7B4D?style=flat-square&logo=argo&logoColor=white)](https://argoproj.github.io/cd/) [![Trivy](https://img.shields.io/badge/Trivy-1904DA?style=flat-square&logo=aquasecurity&logoColor=white)](https://aquasecurity.github.io/trivy/) ## 📦 项目结构 ``` easyshop/ ├── src/ │ ├── app/ # Next.js App Router pages & layouts │ ├── components/ # Reusable React components │ └── lib/ │ ├── auth/ # NextAuth + JWT logic │ ├── db/ # Mongoose connection │ └── features/ # Redux slices ├── kubernetes/ # K8s manifests (namespace → ingress) ├── terraform/ # IaC for VPC, EKS, EC2 (Jenkins) ├── scripts/ # DB migration (ts-node + Docker) ├── Dockerfile # Multi-stage production build ├── docker-compose.yml # Local dev stack └── Jenkinsfile # CI pipeline (Shared Library) ``` ## ⚡ 快速开始(本地 — Docker Compose) ``` # 克隆 git clone https://github.com/rohandeb2/Easy-shop-E-commerce.git cd Easy-shop-E-commerce # 创建 .env.local cp .env .env.local # 编辑 NEXTAUTH_SECRET 和 JWT_SECRET: openssl rand -base64 32 # → NEXTAUTH_SECRET openssl rand -hex 32 # → JWT_SECRET # 运行 docker compose up -d # 打开 open http://localhost:3000 ``` ## 🔧 故障排除 **MongoDB 无法访问** ``` docker ps docker logs easyshop-mongodb docker network inspect easyshop-network ``` **构建错误 / 异常行为** ``` rm -rf .next npm install docker compose down -v && docker compose up -d ``` ## 🤝 贡献 1. Fork 该仓库 2. 创建分支:`git checkout -b feature/my-feature` 3. 提交:`git commit -m 'feat: add my feature'` 4. 推送:`git push origin feature/my-feature` 5. 发起 Pull Request
Ruhon Deb 用 ❤️ 制作  ·  📖 完整部署指南
标签:亚马逊云科技, 子域名突变, 电子商务, 自动化攻击, 请求拦截