# gulimall **Repository Path**: gitzhoukun/gulimall ## Basic Information - **Project Name**: gulimall - **Description**: 项目由业务集群系统+后台管理系统构成,打通了分布式开发及全栈开发技能,包含前后分离全栈开发、Restful接口、数据校验、网关、注册发现、配置中心、熔断、限流、降级、链路追踪、性能监控、压力测试、系统预警、集群部署、持续集成、持续部署等 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: https://gitee.com/gitzhoukun/gulimall - **GVP Project**: No ## Statistics - **Stars**: 4 - **Forks**: 4 - **Created**: 2020-11-05 - **Last Updated**: 2022-03-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # gulimall #### 介绍 谷粒商城是尚硅谷雷丰阳老师教学的一套B2C商城项目,项目由业务集群系统+后台管理系统构成,打通了分布式开发及全栈开发技能,包含前后分离全栈开发、Restful接口、数据校验、网关、注册发现、配置中心、熔断、限流、降级、链路追踪、性能监控、压力测试、系统预警、集群部署、持续集成、持续部署等 ## 软件架构 ![image-20200422211607028](笔记/images/image-20200422211607028.png) ```` 项目结构: gulimall ├── gulimall-common -- 工具类 ├── renren-generator -- 代码生成器(人人开源项目) ├── renren-fast -- 后台管理系统(人人开源项目) ├── admin-vue -- 后台管理前端系统(人人开源项目) ├── gulimall-auth-server -- 认证中心(社交登录、OAuth2.0、单点登录) ├── gulimall-cart -- 购物车服务 ├── gulimall-coupon -- 优惠卷服务 ├── gulimall-member -- 会员服务 ├── gulimall-gateway -- 网关服务 ├── gulimall-order -- 订单服务 ├── gulimall-product -- 商品服务 ├── gulimall-search -- 检索服务 ├── gulimall-seckill -- 秒杀服务 ├── gulimall-third-party -- 第三方服务 └── gulimall-ware -- 仓储服务 ```` ### 技术选型 **后端技术** | 技术 | 说明 | 官网 | | :----------------: | :----------------------: | :---------------------------------------------: | | SpringBoot | 容器+MVC框架 | https://spring.io/projects/spring-boot | | SpringCloud | 微服务架构 | https://spring.io/projects/spring-cloud | | SpringCloudAlibaba | 一系列组件 | https://spring.io/projects/spring-cloud-alibaba | | MyBatis-Plus | ORM框架 | https://mp.baomidou.com | | renren-generator | 人人开源项目的代码生成器 | https://gitee.com/renrenio/renren-generator | | Elasticsearch | 搜索引擎 | https://github.com/elastic/elasticsearch | | RabbitMQ | 消息队列 | https://www.rabbitmq.com | | Springsession | 分布式缓存 | https://projects.spring.io/spring-session | | Redisson | 分布式锁 | https://github.com/redisson/redisson | | Docker | 应用容器引擎 | https://www.docker.com | | OSS | 对象云存储 | https://github.com/aliyun/aliyun-oss-java-sdk | **前端技术** | 技术 | 说明 | 官网 | | :-------: | :--------: | :-----------------------: | | Vue | 前端框架 | https://vuejs.org | | Element | 前端UI框架 | https://element.eleme.io | | thymeleaf | 模板引擎 | https://www.thymeleaf.org | | node.js | 服务端的js | https://nodejs.org/en | ### 环境搭建 #### 开发工具 | 工具 | 说明 | 官网 | | :-----------: | :-----------------: | :---------------------------------------------: | | IDEA | 开发Java程序 | https://www.jetbrains.com/idea/download | | RedisDesktop | redis客户端连接工具 | https://redisdesktop.com/download | | SwitchHosts | 本地host管理 | https://oldj.github.io/SwitchHosts | | X-shell | Linux远程连接工具 | http://www.netsarang.com/download/software.html | | Navicat | 数据库连接工具 | http://www.formysql.com/xiazai.html | | PowerDesigner | 数据库设计工具 | http://powerdesigner.de | | Postman | API接口调试工具 | https://www.postman.com | | Jmeter | 性能压测工具 | https://jmeter.apache.org | | Typora | Markdown编辑器 | https://typora.io | #### 开发环境 | 工具 | 版本号 | 下载 | | :-----------: | :----: | :----------------------------------------------------------: | | JDK | 1.8 | https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html | | Mysql | 5.7 | https://www.mysql.com | | Redis | Redis | https://redis.io/download | | Elasticsearch | 7.6.2 | https://www.elastic.co/downloads | | Kibana | 7.6.2 | https://www.elastic.co/cn/kibana | | RabbitMQ | 3.8.5 | http://www.rabbitmq.com/download.html | | Nginx | 1.1.6 | http://nginx.org/en/download.html | #### 搭建步骤 > Windows环境部署 - 修改本机的host文件,映射域名端口 ``` 192.168.77.130 gulimall.com 192.168.77.130 search.gulimall.com 192.168.77.130 item.gulimall.com 192.168.77.130 auth.gulimall.com 192.168.77.130 cart.gulimall.com 192.168.77.130 order.gulimall.com 192.168.77.130 member.gulimall.com 192.168.77.130 seckill.gulimall.com 以上端口换成自己Linux的ip地址 ``` - 修改Linux中Nginx的配置文件 ``` 1、在nginx.conf中添加负载均衡的配置 upstream gulimall { server 192.168.43.182:88; } 2、在gulimall.conf中添加如下配置 server { listen 80; server_name gulimall.com *.gulimall.com hjl.mynatapp.cc; #charset koi8-r; #access_log /var/log/nginx/log/host.access.log main; #配置静态资源的动态分离 location /static/ { root /usr/share/nginx/html; } #支付异步回调的一个配置 location /payed/ { proxy_set_header Host order.gulimall.com; #不让请求头丢失 proxy_pass http://gulimall; } location / { #root /usr/share/nginx/html; #index index.html index.htm; proxy_set_header Host $host; #不让请求头丢失 proxy_pass http://gulimall; } ``` ### 项目简单演示 ![image-20200422211607028](笔记/images/login.png) ![image-20200422211607028](笔记/images/brand.png) ![image-20200422211607028](笔记/images/attr.png) ![image-20200422211607028](笔记/images/product.png) ![image-20200422211607028](笔记/images/search.png) ![image-20200422211607028](笔记/images/item.png) ![image-20200422211607028](笔记/images/add.png) ![image-20200422211607028](笔记/images/pay.png) ![image-20200422211607028](笔记/images/order.png) ![image-20200422211607028](笔记/images/nacos.png) ![image-20200422211607028](笔记/images/zikpin.png) ![image-20200422211607028](笔记/images/kubesphere1.png) ![image-20200422211607028](笔记/images/kubesphere2.png)