{"id":13754133,"url":"https://github.com/heyuxian/mcloud","last_synced_at":"2025-05-07T17:12:03.794Z","repository":{"id":217659363,"uuid":"102484374","full_name":"heyuxian/mcloud","owner":"heyuxian","description":"基于Spring Cloud，实现微服务中常用的基础模块，包括 OAuth2 认证服务，统一注册中心，系统监控中心， 统一配置中心，API网关以及熔断器","archived":false,"fork":false,"pushed_at":"2019-04-01T13:38:35.000Z","size":1218,"stargazers_count":196,"open_issues_count":2,"forks_count":79,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-11-16T06:31:40.193Z","etag":null,"topics":["keycloak","mcloud","microservice","oauth2","rest-api","spring-boot","spring-cloud","spring-security"],"latest_commit_sha":null,"homepage":"https://www.docs4dev.com/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heyuxian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-05T13:26:39.000Z","updated_at":"2024-03-15T18:28:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff48c9dd-e52a-4cca-aced-c2a7c57e3b90","html_url":"https://github.com/heyuxian/mcloud","commit_stats":null,"previous_names":["heyuxian/mcloud"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heyuxian%2Fmcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heyuxian%2Fmcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heyuxian%2Fmcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heyuxian%2Fmcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heyuxian","download_url":"https://codeload.github.com/heyuxian/mcloud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235534325,"owners_count":19005470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["keycloak","mcloud","microservice","oauth2","rest-api","spring-boot","spring-cloud","spring-security"],"created_at":"2024-08-03T09:01:41.544Z","updated_at":"2025-01-25T04:12:18.725Z","avatar_url":"https://github.com/heyuxian.png","language":"Java","readme":"# MCloud - 微服务基础设施\n[![Build Status](https://www.travis-ci.org/heyuxian/mcloud.svg?branch=master)](https://www.travis-ci.org/heyuxian/mcloud)\n[![Coverage Status](https://coveralls.io/repos/github/heyuxian/mcloud/badge.svg?branch=master)](https://coveralls.io/github/heyuxian/mcloud?branch=master)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n## 项目简介\n\nMCloud 基于 Spring Cloud 进行开发，提供了项目中常用的基础设施：\n\n- **mcloud-registry** 服务注册与发现中心。\n- [keycloak](http://www.keycloak.org/) 用户认证和管理。\n- **mcloud-apigw** 基于Spring cloud gateway 实现的 API 网关 ，同时使用了 `netflix-ribbon` 作为负载均衡器。\n- **mcloud-config** 基于 GitHub 的统一配置中心（此项目使用 [这个 repo](https://github.com/heyuxian/config-repo) 作为配置存储库）。\n- **mcloud-logs** 基于`logstash`  `Kibana` 以及 `ElasticSearch` 实现的日志服务。\n- **mcloud-demo** Demo Project\n- **mcloud-console** 基于 ant-design-pro 搭建的系统控制台（因升级 `Spring Cloud` 版本缘故，此模块暂**不可用**）。\n\n其他：\n- [Code Generator](https://github.com/heyuxian/code-generator) 用于 Intellij-IDEA 的代码生成器插件。\n- 文档参考：[https://www.docs4dev.com](https://www.docs4dev.com/)\n\n\n## Dependencies\n\n- Spring Boot `2.1.3.RELEASE`\n- Spring Cloud `Greenwich.RELEASE`\n- Maven\n- JDK 1.8\n- ......\n\n## 环境依赖\n\n- **JDK** 1.8 以上\n\n- **IDE** 请安装对应IDE的 **lombok** 插件\n\n- [Keycloak](https://www.keycloak.org/)\n\n  \u003e **注：**在安装完 `keycloak` 后，需要将 `mcloud/data` 目录下的 `realm-export.json` 导入 `keycloak` ,并手动重置 `mcloud realm` 下的  `mcloud` 客户端的 `clientSecret`，并将新的 `clientSecret` 填入  `mcloud-demo` 下的 `application.yml` 中。\n\n\n## Quick Start\n\n**克隆项目到本地**\n\n```\ngit clone https://github.com/heyuxian/mcloud.git\n```\n\n### 构建及运行\n\n因为项目使用配置优先的方式，所以需要先启动 `mcloud-config` 模块，然后依次启动 `mcloud-registry` 、`mcloud-apigw`，`mcloud-demo`。\n\n启动配置中心：\n\n```shell\ncd mcloud-config\nmvn clean install spring-boot:run\n```\n\n启动注册中心：\n```shell\ncd mcloud-registry\n#分别在三个终端运行以下命令，用于启动多个注册节点\nmvn clean install spring-boot:run -Dspring.profiles.active=peer1\nmvn clean install spring-boot:run -Dspring.profiles.active=peer2\nmvn clean install spring-boot:run -Dspring.profiles.active=peer3\n```\n\n启动 API 网关：\n\n```shell\ncd mcloud-apigw\nmvn clean install spring-boot:run\n```\n\n启动示例项目：\n\n```shell\ncd mcloud-demo\nmvn clean install\n#分别在两个终端运行以下命令，用于启动两个节点\nmvn spring-boot:run -Dspring.profiles.active=peer1\nmvn spring-boot:run -Dspring.profiles.active=peer2\n```\n\n所有节点都启动完成后，还需要获取 `access_token` ，之后，我们就可以使用这个 token 来访问我们的 API：\n\n```\ncurl --request GET \\\n  --url http://localhost/mcloud-demo/users/me \\\n  --header 'authorization: Bearer ${access_token}' \\\n  --header 'cache-control: no-cache' \\\n  --header 'content-type: application/json' \\\n  --data '{}'\n```\n\n## 问题及建议\n\n若是对于本项目有任何问题或建议,请提 [Issue](https://github.com/heyuxian/mcloud/issues/new) 。\n","funding_links":[],"categories":["spring-security"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheyuxian%2Fmcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheyuxian%2Fmcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheyuxian%2Fmcloud/lists"}