# tomato
**Repository Path**: wujunsong97/tomato
## Basic Information
- **Project Name**: tomato
- **Description**: Springcloud+SpringcloudAlibaba+nacos+gateway+security+jwt+oauth+xxl-job+kafka+oss+redis+mybatis-plus,商城系统,目前只完成了后台管理部分,项目演示地址:https://manage.wujs.top
- **Primary Language**: Java
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: https://manage.wujs.top
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-09-16
- **Last Updated**: 2022-05-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
## 前言
采用的技术:
Springcloud+SpringcloudAlibaba+nacos+gateway+security+jwt+oauth+xxl-job+kafka+oss+redis+mybatis-plus
已经部署到公网:[https://manage.wujs.top](https://manage.wujs.top)
gitee地址:[https://gitee.com/wujunsong97/tomato.git](https://gitee.com/wujunsong97/tomato.git)
前端采用的开源的mall-admin-web管理系统:[https://gitee.com/macrozheng/mall-admin-web.git](https://gitee.com/macrozheng/mall-admin-web.git),我对它进行了一些改造,比如动态菜单、封装查询组件,实现不再拼接查询条件
ps:想做一个微服务电商项目,主要是用来学习和巩固,框架已经差不多搭建完成,剩下的业务还没想好怎么写.目前后台管理的商品管理、权限验证已经开发完成,
这个管理后台部分(tomato-admin:10086 tomato-auth:10085 tomato-gateway:10088)可以用做所有的管理系统,包括登录、权限验证、接口鉴权
## 各个组件服务的端口号,搭建在linux上
nacos:8848 注册中心
seata:8091 seata分布式事务
zookeeper:2181 zookeeper
kafka:9092 kafka
kafka-manage:9000 kafka管理面板
xxl-job:10081 xxl-job 分布式任务调度
## 系统各个微服务简介
tomato-admin:10086 后台管理微服务
tomato-auth:10085 权限认证微服务
tomato-gateway:10088 gateway网关微服务
tomato-file:10089 文件服务,包括短信验证码、oss文件管理
tomato-bean:10010 bean管理
tomato-common:10011 通用工具类
tomato-goods:10012 暂未实现
tomato-user:10013 暂未实现
tomato-order:10014 暂未实现
tomato-job:10015 执行器端口号:10016 定时任务微服务
tomato-transfer:10017 调用第三方接口微服务
## 注意
1、如果只是使用简单的后台管理部分,只需要启动下面三个服务
tomato-admin:10086 tomato-auth:10085 tomato-gateway:10088
2、如果要使用定时任务,需要启动 tomato-job:10015
3、如果要使用短信、文件上传等功能,需要启动 tomato-file:10089
## 一些docker的启动命令
seata:
docker run -d --restart always --name seata-server -p 8091:8091 -v /mnt/docker/seata/resources/file.conf:/seata-server/resources/file.conf -v /mnt/docker/seata/resources/registry.conf:/seata-server/resources/registry.conf -v /mnt/docker/seata/logs:/root/logs -e SEATA_IP=1.14.17.46 -e SEATA_PORT=8091 镜像id
nacos:
docker run --name nacos -p 8848:8848 --privileged=true --restart=always -e JVM_XMS=256m -e JVM_XMX=256m -e MODE=standalone -e PREFER_HOST_MODE=hostname -v /mnt/docker/nacos/logs:/home/nacos/logs -v /mnt/docker/nacos/conf/application.properties:/home/nacos/conf/application.properties -d 镜像id
xxl-job:这里因为挂载了application.properties,里面配置了端口信息,所以就不用使用 -p 8080:8080
docker run -di -v /mnt/docker/xxl-job/application.properties:/application.properties -v /mnt/docker/xxl-job/logs:/data/applogs --network=host --name xxl-job-admin xuxueli/xxl-job-admin:2.3.0
nginx:
docker run -d --name nginx -p 80:80 -p 443:443 -v /mnt/docker/nginx/nginx.conf:/etc/nginx/nginx.conf -v /mnt/docker/nginx/logs:/var/log/nginx -v /mnt/docker/nginx/html:/usr/share/nginx/html -v /mnt/docker/nginx/conf:/etc/nginx/conf.d -v /mnt/docker/nginx/cert:/etc/nginx/cert --privileged=true docker.io/nginx
jar打包docker镜像:
docker build -t tomato-gateway:1.0 .
docker create --name tomato-gateway -t -p 8080:8080 镜像id tomato-job: docker create --name tomato-job -t -p 10015:10015 -p 10016:10016 镜像id
docker start tomato-gateway && docker logs -f tomato-gateway
kafka
docker run -d --name kafka -p 9092:9092 -e KAFKA_BROKER_ID=0 -e KAFKA_ZOOKEEPER_CONNECT=1.14.17.46:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://1.14.17.46:9092 -e KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092 -e KAFKA_HEAP_OPTS="-Xmx512M -Xms512M" -t wurstmeister/kafka
kafka-manager
docker run -d --name kafka-manager \--link zookeeper:1.14.17.46 \--link kafka:1.14.17.46 -p 9000:9000 \--restart=always \--env ZK_HOSTS=1.14.17.46:2181 镜像id
redis
docker run -p 6379:6379 --name redis -v /mnt/docker/redis/redis.conf:/etc/redis/redis.conf -v /mnt/docker/redis/data:/data -d redis redis-server /etc/redis/redis.conf --appendonly yes --protected-mode no