# screw **Repository Path**: LLucifer/screw ## Basic Information - **Project Name**: screw - **Description**: 项目采用Spring Boot、Spring Cloud、Spring Cloud Alibaba、Spring Security OAuth2、Nacos、Sentinel等技术架构倾力打造,致力于推广并普及微服务架构思想,采用全新服务网格系统打造云原生产品。推出2024 年全新微服务架构,紧跟时代步伐,助力产品快速成型。 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2024-06-07 - **Last Updated**: 2024-06-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # screw ## 先看这里 - [**公网演示地址**](http://120.26.85.41/) - [**公网部署视频**](https://www.bilibili.com/video/BV1py411h7cr) - [**系统演示以及本地部署视频**](https://www.bilibili.com/video/BV1EZ421p7rF?t=5615.7) - **视频里已经介绍和演示Docker Compose部署服务,后期会抽时间提供项目Jenkins自动化构建教程(采用方案为Harbor + Gitlab + Jenkins)、服务器安装配置文档、中间件服务组件安装文档、Kubernetes部署服务文档** - **有更好想法的小伙伴也可以加我微信、力求使项目更加饱满,更加健壮** - **当然我们也可以为用户提供定制化开发的服务,如有需要,请加作者微信私聊** ![](chat/Lusifer.jpg) ## 概述 **screw** 项目致力于推广并普及 **微服务架构** 思想,采用全新 **服务网格** 系统打造云原生产品。 本项目参考《微服务架构编程思想》满足《微服务架构十二要素》并严格遵循《阿里巴巴Java开发手册(黄山版)》开发规范,推出2024 年全新微服务架构,紧跟时代步伐,助力产品快速成型。 ## 开发工具 | 工具 | 地址 | | ------------- | --------------------------------------- | | Intellij IDEA | https://www.jetbrains.com/idea/download | | SwitchHosts | https://oldj.github.io/SwitchHosts/ | | FinalShell | http://www.hostbuf.com/ | | Postman | https://www.getpostman.com/downloads/ | | SQLyog | https://sqlyog.en.softonic.com/ | | PicPick | https://picpick.app/zh/download | | 亿图图示 | https://www.edrawsoft.cn/edrawmax/ | | 亿图导图 | https://www.edrawsoft.cn/mindmaster/ | ## 开源分布式文件系统 | 服务 | 说明 | 地址 | | -------------- | ------------------ | ------------------------------------------------------------ | | FastDFS | 分布式文件系统 | [官网](https://gitee.com/fastdfs100/fastdfs) | | Minio | 分布式文件系统 | [官网](https://www.minio.org.cn/) | ## 商业组件 | 服务 | 说明 | 地址 | | -------------- | ------------------ | ------------------------------------------------------------ | | Aliyun SDK OSS | 阿里云对象存储服务 | [官网](https://help.aliyun.com/zh/oss/) | ## 后端技术 | 技术 | 说明 | 地址 | | ----------------------------- | -------------------------------------------------------- | ------------------------------------------------------------ | | Spring Boot | 新一代 JavaEE 开发标准 | [GitHub](https://github.com/spring-projects/spring-boot) | | Spring Cloud | 基于 Spring Boot 构建的微服务编程模型 | [GitHub](https://github.com/spring-cloud) | | Spring Cloud Alibaba | 阿里巴巴基于 Spring Cloud 编程模型的微服务生态 | [GitHub](https://github.com/alibaba/spring-cloud-alibaba) | | Spring Cloud Alibaba Dubbo | 与 Spring Cloud Alibaba 生态相结合的高性能 Java RPC 框架 | [GitHub](https://github.com/apache/dubbo) | | Spring Cloud Alibaba RocketMQ | 分布式消息系统 | [GitHub](https://github.com/alibaba/spring-cloud-alibaba/blob/master/spring-cloud-alibaba-examples/rocketmq-example/readme.md) | | Spring Security OAuth2 | 安全认证和授权框架 | [GitHub](https://github.com/spring-projects/spring-security-oauth) | | Apache Skywalking | 服务链路追踪 | [官网](https://skywalking.apache.org/) | | Docker | 容器化引擎 | [官网](https://www.docker.com/) | | Docker Compose | 容器编排工具 | [官网](https://docs.docker.com/compose/) | | Kubernetes | 容器编排系统 | [官网](https://kubernetes.io/) | | TiDB | 分布式数据库 | [官网](https://pingcap.com/) | | Mybatis Plus | 基于 MyBatis 二次开发的轻量级框架,用于简化 MyBatis 操作 | [GitHub](https://github.com/baomidou/mybatis-plus) | | knife4j Swagger | API 文档生成工具 | [GitHub](https://github.com/swagger-api/swagger-ui) | | Druid | 数据库连接池 | [GitHub](https://github.com/alibaba/druid) | | OKHttp3 | 轻量级网络框架 | [GitHub](https://github.com/square/okhttp) | | fastjson2 | 性能极致并且简单易用的Java JSON库 | [GitHub](https://github.com/alibaba/fastjson2) | | OpenFeign | 声明式 HTTP 客户端 | [GitHub](https://github.com/OpenFeign/feign) | | UserAgentUtils | 用户代理检查工具 | [GitHub](https://github.com/HaraldWalker/user-agent-utils) | ## 前端技术 | 技术 | 说明 | 地址 | | --------------------- | ---------------------------------- | ----------------------------------------------------------- | | Vue | 前端框架,MVVM 模式的实现者 | [GitHub](https://github.com/vuejs/vue) | | Vue CLI | Vue 脚手架,基于 NodeJS | [GitHub](https://github.com/vuejs/vue-cli) | | Vue Router | Vue 路由框架 | [GitHub](https://github.com/vuejs/vue-router) | | Vuex | Vue 全局状态管理框架 | [GitHub](https://github.com/vuejs/vuex) | | Axios | 前端 HTTP 框架 | [GitHub](https://github.com/axios/axios) | | Element UI | 饿了么 UI 框架 | [官网](https://element.eleme.cn) | | Vue Element Admin | 基于 Element UI 的前端后台解决方案 | [GitHub](https://github.com/PanJiaChen/vue-element-admin) | | Vue Image Crop Upload | Vue 图片剪裁上传组件 | [GitHub](https://github.com/dai-siki/vue-image-crop-upload) | ## 框架集成 | 集成 | 完成 | | ----------------------------- | ---- | | Spring Boot | ✔ | | Spring Cloud Alibaba | ✔ | | Spring Cloud Alibaba Dubbo | 后续与dubbo集成 | | Spring Cloud Alibaba Sentinel | ✔ | | Spring Security oAuth2 | ✔ | | Spring Cloud Gateway Redis 动态路由 | ✔ | | Spring Cloud Gateway 灰度路由 | ✔ | | 第三方手机号登录 | ✔ | | 授权码模式登录 | ✔ | | 基于Jsoup的xss安全过滤插件 | ✔ | | Mybatis Plus | ✔ | | Dynamic Datasource 动态数据源 | ✔ | | Druid | ✔ | | OKHttp3 | ✔ | | Feign 传递 Token | ✔ | | knife4j API 文档 | ✔ | | 项目代码生成 | ✔ | ## 后台功能清单请看演示视频 ## 后台服务规划 ### 数据访问 | 服务名 | 端口 | 说明 | | ------------------------ | ---- | ------------------ | | screw-register | 8848 | 服务注册中心 | | screw-admin | 4000 | 服务通用管理后台 | | screw-auth | 4001 | 认证授权服务 | | screw-codegen | 4002 | 代码生成服务 | | screw-gateway | 8888 | 系统网关服务 | | screw-monitor | 4003 | 服务状态监控 | | screw-sentinel | 4004 | 流量监控服务 | ### 业务逻辑 | 服务名 | 端口 | 说明 | | ---------------- | ---- | ---------------- | | screw-admin | 4000 | 服务通用管理后台 | | screw-auth | 4001 | 认证授权服务 | | screw-codegen | 4002 | 代码生成服务 | ### 云服务 | 服务名 | 端口 | 说明 | | ------------- | ----- | ------------ | | screw-upload | 4005 | 文件上传服务(规划中) | ## 基础设施规划 ### Docker | 服务 | 主机名 | IP/端口 | CPU/MEM | 说明 | | ------ | ------------- | ------------------ | ------- | -------- | | GitLab | docker-gitlab | 192.168.2.196:80 | 2 核 2G | 代码管理 | | Nexus | docker-nexus | 192.168.2.197:80 | 2 核 2G | 依赖管理 | | Harbor | docker-harbor | 192.168.2.198:80 | 2 核 2G | 镜像管理 | | jenkins| docker-jenkins | 192.168.2.199:80 | 2 核 2G | 项目管理 | | deploy| docker-deploy | 192.168.2.200 | 2 核 8G | 应用部署 | ### Kubernetes | 主机名 | IP | 角色 | CPU/MEM | 磁盘 | | -------------------- | ------------------ | ------ | ------- | --------- | | kubernetes\-master | 192\.168\.2\.110 | Master | 2 核 2G | 20G | | kubernetes\-node\-01 | 192\.168\.2\.120 | Node | 2 核 4G | 20G + 40G | | kubernetes\-node\-02 | 192\.168\.2\.121 | Node | 2 核 4G | 20G + 40G | | kubernetes\-node\-03 | 192\.168\.2\.122 | Node | 2 核 4G | 20G + 40G | | kubernetes\-node\-04 | 192\.168\.2\.123 | Node | 2 核 8G | 20G + 40G | | kubernetes-volumes | 192.168.2.130 | NFS | 2 核 2G | 按需扩容 | ## 容器部署配置 ### GItLab ```yaml version: '3' services: web: image: 'twang2218/gitlab-ce-zh' restart: always hostname: '192.168.2.196' environment: TZ: 'Asia/Shanghai' GITLAB_OMNIBUS_CONFIG: | external_url 'http://192.168.2.196' gitlab_rails['gitlab_shell_ssh_port'] = 2222 unicorn['port'] = 8888 nginx['listen_port'] = 80 ports: - '80:80' - '443:443' - '2222:22' volumes: - ./config:/etc/gitlab - ./data:/var/opt/gitlab - ./logs:/var/log/gitlab ``` ### Nexus - **账号:** admin - **密码:** `cat /var/lib/docker/volumes/nexus_data/_data/admin.password` ```yaml version: '3.6' services: nexus: restart: always image: sonatype/nexus3 container_name: nexus ports: - 80:8081 volumes: - data:/nexus-data volumes: data: ``` ### Harbor [官方 GitHub](https://github.com/goharbor/harbor) 上下载最新离线安装版(我已经下载并放置在群分享的 **Linux** 目录下)并上传至服务器 - **账号:** admin - **密码:** Harbor12345 ```bash # 解压 tar -zxvf harbor-offline-installer-v1.10.18.tgz # 修改 cd harbor vi harbor.yml hostname: 192.168.2.198 注释掉 https 的配置 # 安装 ./install.sh ``` ### 禅道 - 禅道开源版:http://dl.cnezsoft.com/zentao/docker/docker_zentao.zip - 下载并解压后将目录名修改为 `build`,再通过 Compose 构建 ```yaml version: '3.6' services: zendao: build: build restart: always container_name: zendao environment: MYSQL_ROOT_PASSWORD: 123456 ports: - 80:80 volumes: - ./app:/app/zentaopms - ./data:/var/lib/mysql ```