# apollo **Repository Path**: eetuuuu/apollo ## Basic Information - **Project Name**: apollo - **Description**: apollo 微服务 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2025-03-19 - **Last Updated**: 2025-03-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

springboot 版本 springcloud alibaba 版本
协议版本 作者

### Apollo #### Description 《阿波罗》服务器端是基于Spring Boot 2.7.4、Spring Cloud 2021 & Alibaba 2021、Vue3、Element-Plus等主流技术栈构建的一整套全栈管理项目。[Apollo管理端](https://gitee.com/mazaiting/apollo-web) #### Software Architecture 采用 MVC 设计模式,使用 SpringBoot 快速开发框架,Mybatis 数据库服务, Redis 内存数据库, Nginx 代理, Spring Security 安全框架, Spring Cloud Alibaba Nacos 服务注册与服务发现、配置中心, Redisson 分布式锁,Rabbit MQ 消息中间件, Spring Cloud Gateway 网关, Spring Cloud OpenFeign 服务降级, Spring Cloud Alibaba Sentinel 限流,国密算法 SM2、SM3、SM4, NIO socket 通信, websocket 通信, 短信框架, 雪花算法. 项目权限管理来源自[有来商城](https://gitee.com/youlaitech/youlai-mall/), 感谢有来团队的无私奉献。 账号: root/root admin/123456 #### 项目特色 - 项目使用皆是当前主流前后端技术栈(持续更新...),无过度自定义封装,易理解学习和二次扩展; - 极速启动,在IDEA和Java环境OK的情况下`1分钟之内`可正常启动微服务,可以快速拥有微服务环境和上手微服务; - SpringBoot 2.7、SpringCloud 2021 & Alibaba 2021 一站式微服务开箱即用的解决方案; - Spring Security OAuth2 、 Spring Cloud Gateway 、 JWT 统一认证鉴权和常用 OAuth2 授权模式扩展; - Jenkins、K8s、Docker实现微服务持续集成与交付(CI/CD)。 #### 源码地址 | | Gitee | |--------------------|----------------------------------------------------------------------| | 微服务后端 | [apollo](https://gitee.com/mazaiting/apollo) | | 管理前端 | [apollo-web](https://gitee.com/mazaiting/apollo-web) | | vue3-element-admin | [vue3-element-admin](https://gitee.com/youlaiorg/vue3-element-admin) | [vue3-element-admin](https://github.com/youlaitech/vue3-element-admin) | #### Document - [Linux 部署 JavaWeb 项目服务(无页面)](https://www.jianshu.com/p/e436b7a34990) 1. [Intellij IDEA](http://www.jetbrains.com/idea/) 2. [JDK17](https://www.oracle.com/) 3. [MySQL](https://dev.mysql.com/downloads/mysql/) - [MySQL 安装教程](https://www.jianshu.com/p/962be11710f5) 4. [Redis](https://redis.io/) - [Redis 安装教程](https://www.jianshu.com/p/044d2e599a42) ```bash # 启动 Redis 服务 redis-server # 获取值 get key # 查看有效时间 ttl key ``` 5. [Nginx](http://nginx.org/) - [Nginx 安装教程](https://www.jianshu.com/p/1269ff8b0997) - [Nginx 代理 MySQL 教程](https://www.jianshu.com/p/059556b4f8d1) 6. [Apifox](http://apifox.cn/) 测试工具 7. [PingCode](https://pingcode.com/) 项目管理工具 8. [Chiner](https://gitee.com/robergroup/chiner) 数据库建模工具 9. [RedisInsight](https://redis.com/redis-enterprise/redis-insight/) #### Tools 1. [图片压缩工具](https://tinypng.com/) 2. [代码生成图片](https://carbon.now.sh/) 3. [表情符号](https://www.emojiall.com/zh-hans) 4. [阿里图库](https://www.iconfont.cn/) 5. [css3 动画](https://www.webhek.com/post/css3-animation-sniplet-collection/) 6. [高清图片](https://unsplash.com/) 7. [画图工具](https://boardmix.cn/) 8. [媒体类型](https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types) #### Framework | Name | Version | Description | |------------------------------------------------------------------------------------------------------|:--------------:|------------------------------------------:| | [smart-doc](https://smart-doc-group.github.io/#/zh-cn) | 2.4.0 | 文档生成工具 | | [Spring Boot](https://spring.io/projects/spring-boot/) | 2.6.4 | Web快速开发框架 | | [mybatis-plus](https://baomidou.com/) | 3.5.1 | 数据库框架 | | [Redis](https://redis.io/) | 5.0.5 | 内存数据库 | | [Spring Security](https://docs.spring.io/spring-security) | 2.6.4 | 安全框架 | | [Spring Amqp](https://spring.io/projects/spring-amqp) | 2.6.4 | [RabbitMQ](https://www.rabbitmq.com/)消息队列 | | [jjwt](https://github.com/jwtk/jjwt) | 0.11.2 | Token 生成工具 | | [FastJson](https://github.com/alibaba/fastjson/) | 1.2.80 | JSON 解析工具 | | [Redisson](https://github.com/redisson/redisson) | 3.17.0 | 分布式锁 | | [Nacos](https://nacos.io/zh-cn/docs/quick-start.html) | 1.4.2 | 服务注册与发现,配置中心 | | [Gateway](https://spring.io/projects/spring-cloud-gateway) | 3.17.0 | 网关服务 | | [OpenFeign](https://spring.io/projects/spring-cloud-openfeign) | 3.1.1 | 服务降级 | | [Sentinel](https://github.com/alibaba/Sentinel/) | 2021.0.1.0 | 限流 | | [Hutool](https://www.hutool.cn/) | 5.8.0.M1 | 糊涂工具包 | | [Loadbalancer](https://github.com/redisson/redisson) | 3.1.1 | 负载均衡 | | [Bouncy Castle](https://www.bouncycastle.org/java.html) | 1.68 | 国密算法 | | [gradle-ssh-plugin](https://gradle-ssh-plugin.github.io/) | 2.10.1 | gradle ssh 上传插件 | | [mybatis-crypto](https://github.com/WhiteDG/mybatis-crypto/) | 1.0 | 字段加解密 | | [jasypt](http://www.jasypt.org/) | 1.9.3 | 加解密工具 | | [mapstruct](https://github.com/mapstruct/mapstruct) | 1.5.2.Final | 对象转换工具 | | [dynamic-tp](https://gitee.com/dromara/dynamic-tp) | 1.0.8 | 动态线程池 | | [WxJava](https://gitee.com/binary/weixin-java-tools) | 4.4.0 | 微信操作工具 | | [io.spring.dependency-management](https://plugins.gradle.org/plugin/io.spring.dependency-management) | 1.0.14.RELEASE | 依赖管理工具 | | [prometheus](https://github.com/prometheus/prometheus) | 1.9.4 | 性能监控工具 | | [grafana](https://github.com/grafana/grafana) | 9.1.7 | 数据可视化 | | [minio](https://min.io/) | 8.4.5 | 高性能对象存储 | | [EasyExcel](https://github.com/alibaba/easyexcel) | 3.1.1 | Excel工具 | #### dependencies service 1. mysql: jdbc:mysql://localhost: 3306/apollo?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true 2. redis: localhost:6379 3. nacos: http://localhost:8848/nacos/index.html nacos/nacos 4. rabbitmq: http://localhost:15672 admin/admin 5. sentinel: http://localhost:8858 ```bash cd sentinel # 需要使用 1.8 的 jdk 启动 ./start.sh ``` 6. prometheus: http://localhost:19090/ 7. grafana: http://localhost:13000/ admin/admin, 模板: data/grafana/grafana.json 导入后记得修改数据源, 并且替换 json 中的 datasource.uid 8. minio: - 控制台: http://localhost:19000/ - 接口: http://localhost:19001/ 9. #### 项目启动 ##### 🗁 后端启动 ###### 1️⃣ 本地启动 - service-auth, manager-boot需要添加启动参数, 详情请查看对应的启动类 1. **中间件安装** > 为了避免数据和线上环境冲突,MySQL 和 Redis 必装,其他不安装可默认使用有来线上环境(🔴必装 ⚪可选) - 🔴 MySQL   [Linux部署](https://www.youlai.tech/pages/vjoqc/) - 🔴 Redis   [Linux部署](https://www.youlai.tech/pages/k2a20/) - ⚪ RabbitMQ   [Linux部署](https://www.youlai.tech/pages/8znee/) - ⚪ Seata   [本地启动](https://www.youlai.tech/pages/0bzvi/)   |  [Linux部署](https://www.youlai.tech/pages/4vjq5/) - ⚪ Sentinel   [本地启动]()   |  [Linux部署]() - ⚪ Canal   [本地启动]()   |  [Linux部署]() 2. **数据库创建和数据初始化** - **系统数据库** 进入 `data/sql` 目录, 执行当前版本前的所有 sql; 先执行 `ddl.sql` 完成数据库的创建, 再执行`dml.sql`插入初始化数据; - **Nacos 数据库** 创建名为 `nacos` 的数据库,执行 `data/nacos/nacos-mysql.sql` 脚本完成 Nacos 数据库初始化。 3. **Nacos 配置持久化至 MySQL** 进入项目的 `nacos/conf/application.properties` 文件修改 Nacos 配置的数据连接,需要修改配置如下: ```properties spring.datasource.platform=mysql db.num=1 db.url.0=jdbc:mysql://localhost:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC db.user.0=root db.password.0=root ``` 4. **导入Nacos配置** IDEA 打开命令行终端 Terminal,输入 `cd nacos/bin` 切换到 Nacos 的 bin 目录,执行 `startup -m standalone` 启动 Nacos 服务。 打开浏览器,地址栏输入 Nacos 控制台的地址 [ http://localhost:8848/nacos]( http://localhost:8848/nacos) ; 输入用户名/密码:nacos/nacos ; 进入控制台,点击左侧菜单 `配置管理` → `配置列表` 进入列表页面,点击 `导入配置` 选择项目中的 `data/nacos/nacos_config_export_*.zip` 文件。 5. **修改Nacos配置** 在 Nacos 控制台配置列表选择共享配置 `service-*.yaml` 进行编辑,修改 MySQL、Redis、RabbitMQ等中间件信息为您自己本地环境。 6. **修改Nacos配置中心地址** 批量替换应用的 bootstrap-dev.yml 文件的配置中心地址 `http://localhost:8848`。 7. **服务启动** - 进入 `service-gateway` 模块的启动类 ApolloGatewayApplication 启动网关; - 进入 `service-auth` 模块的启动类 ApolloAuthApplication 启动认证授权中心; - 进入 `service-manager` → `manager-boot` 模块的启动类 ApolloManagerApplication 启动系统服务; - 至此完成基础服务的启动,其他服务按需启动,启动方式和 `service-manager` 一致; #### Third party service #### Project Progress - 2022 年 11 月 27 日: feat: 完善 generator 模块, 实现自动生成代码 - v0.0.6版本 - 2022 年 11 月 01 日: feat: 新增 generator 模块, 实现自动生成 java 代码 - v0.0.5版本 - 2022 年 10 月 15 日: feat: 新增 sentinel 网关限流及服务限流, 新增 minio 图片压缩功能 - 2022 年 10 月 12 日: feat: 新增 用户 excel 上传下载功能, 方法执行注解 CostTime, 数据转换过滤器新增格式 multipart/form-data; fix: gateway token 过期校验过滤器 - 2022 年 10 月 10 日: feat: 新增 minio 实验室功能(上传/下载), 测试打包, 文档, 优化 gateway 与 common-log 日志 - 2022 年 10 月 06 日: feat: 新增 prometheus + grafana 监控, 新增 dynamic-tp 动态连接池 - 2022 年 10 月 04 日: 重构 rabbitmq 公共模块, 增加短信验证码, 图形验证码, 微信授权码 - 2022 年 09 月 25 日: 根据有来团队项目重构项目权限管理 - 2022 年 09 月 07 日: 完成菜单, 角色, 用户在不同用户下的增删改查 - 2022 年 09 月 06 日: 完成不同角色使用不同菜单功能 - 2022 年 09 月 05 日: 完成 token 自动刷新, 增加路由的重置, 修复菜单部分功能 - 2022 年 09 月 03 日: 完成菜单的增删改查 - 2022 年 08 月 31 日: 完成用户与角色的增删改查 - 2022 年 08 月 28 日: 完成多其他用户的登录与退出及客户信息查询 - 2022 年 08 月 26 日: 完成 网关鉴权向下游服务传递数据, 增加统一数据拦截器 - 2022 年 08 月 23 日: 增加 JSON 格式登录 - 2022 年 08 月 22 日: 增加验证码鉴权与短信验证码鉴权 - 2022 年 08 月 21 日: 完成鉴权统一返回及刷新 token - 2022 年 08 月 20 日: 修改项目结构, 增加网关鉴权, 移除 manager 鉴权 - 2022 年 04 月 20 日: 完成 websocket 实现 - 2022 年 04 月 15 日: 服务器FTP搭建配置 - 2022 年 04 月 09 日: 添加 gradle 自动上传并启动任务 - 2022 年 04 月 06 日: 完成管理端定时任务配置 - 2022 年 04 月 05 日: 完成Spring Cloud 与 Spring Cloud Alibaba 的集成, 添加国密算法, 添加服务降级与限流,添加分布式锁,添加网关服务,添加消息队列 - 2022 年 03 月 30 日: 完成权限功能, 添加RabbitMQ功能 - 2022 年 03 月 22 日: 完成权限基本操作 - 2022 年 03 月 19 日: 初始化项目 #### Plan - [二维码登录](https://www.cnblogs.com/GoodHelper/p/8641905.html) - 工作流Activiti - 批处理框架spring batch - RabbitMQ集群 - Redis集群 - MySQL集群 - [Seata](https://seata.io/zh-cn/docs/overview/what-is-seata.html)分布式数据库 #### Tutorial 1. [MySQL 教程](https://www.runoob.com/mysql/mysql-tutorial.html) / [MySQL 文章](https://www.jianshu.com/nb/17431758) 2. [OpenSSL 教程](https://www.openssl.org/docs/man1.0.2/man1/) 3. [Redis 教程](https://www.runoob.com/redis/redis-tutorial.html) 4. [Nginx 配置详解](https://blog.csdn.net/tjcyjd/article/details/50695922) 5. [Spring Security 配置](https://blog.csdn.net/terry2870/article/details/114699134) 6. [Redisson 配置](https://github.com/redisson/redisson/wiki/2.-%E9%85%8D%E7%BD%AE%E6%96%B9%E6%B3%95) 7. [SpringBatch 使用](https://gitee.com/vahala/springbatchlearn) 8. [mapstruct 使用](https://mapstruct.org/documentation/stable/reference/html/) 9. #### Contribution 1. [简书地址](https://www.jianshu.com/u/5d2cb4bfeb15) 2. [码云地址](https://gitee.com/mazaiting) 3. 邮箱 4. [新浪微博](http://blog.sina.com.cn/mazaiting) #### ✅ Git 贡献提交规范 > IDEA 安装 Git Commit Template 插件 - feat 增加新功能 - fix 修复BUG - docs 文档/注释 - style 代码风格改变但不影响运行结果(代码格式化、空格和空行调整等) - refactor 代码重构 - test 测试 - chore 依赖更新或配置修改 - ci 持续集成 #### Gradle 操作 - 查询某个 jar 的对应模块 - `./gradlew :manager-boot:dependencyInsight --dependency fastjson` - 查询模块依赖 - `/gradlew :manager-boot:dependencies`