Convert Figma logo to code with AI

zlt2000 logomicroservices-platform

基于SpringBoot2.x、SpringCloud和SpringCloudAlibaba并采用前后端分离的企业级微服务多租户系统架构。并引入组件化的思想实现高内聚低耦合,项目代码简洁注释丰富上手容易,适合学习和企业中使用。真正实现了基于RBAC、jwt和oauth2的无状态统一权限认证的解决方案,面向互联网设计同时适合B端和C端用户,支持CI/CD多环境部署,并提供应用管理方便第三方系统接入;同时还集合各种微服务治理功能和监控功能。模块包括:企业级的认证系统、开发平台、应用监控、慢sql监控、统一日志、单点登录、Redis分布式高速缓存、配置中心、分布式任务调度、接口文档、代码生成等等。

4,543
1,679
4,543
13

Top Related Projects

Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.

12,362

AWS Service registry for resilient mid-tier load balancing and failover.

Integration with Netflix OSS components

29,055

Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.

SOFABoot is a framework that enhances Spring Boot and fully compatible with it, provides readiness check, class isolation, etc.

Quick Overview

Microservices-platform is a comprehensive cloud-native microservices development platform based on Spring Cloud Alibaba. It provides a complete set of tools and components for building, deploying, and managing microservices architectures. The platform aims to simplify the development process and improve efficiency for enterprise-level applications.

Pros

  • Comprehensive solution: Offers a wide range of integrated components and tools for microservices development
  • Scalability: Built on Spring Cloud Alibaba, providing excellent scalability for large-scale applications
  • Security features: Includes built-in security modules for authentication and authorization
  • Monitoring and management: Provides centralized monitoring and management capabilities for microservices

Cons

  • Learning curve: May require significant time and effort to fully understand and utilize all features
  • Complexity: The extensive feature set might be overwhelming for smaller projects or teams
  • Language dependency: Primarily focused on Java-based microservices, which may limit its applicability for polyglot environments
  • Documentation: Some parts of the documentation may be in Chinese, potentially creating language barriers for non-Chinese speakers

Code Examples

  1. Service Registration and Discovery
@SpringBootApplication
@EnableDiscoveryClient
public class UserServiceApplication {
    public static void main(String[] args) {
        SpringApplication.run(UserServiceApplication.class, args);
    }
}

This code demonstrates how to enable service registration and discovery using the @EnableDiscoveryClient annotation.

  1. Distributed Configuration
spring:
  cloud:
    nacos:
      config:
        server-addr: 127.0.0.1:8848
        file-extension: yaml

This YAML configuration shows how to set up Nacos as the distributed configuration center.

  1. API Gateway
@SpringBootApplication
@EnableZuulProxy
public class GatewayApplication {
    public static void main(String[] args) {
        SpringApplication.run(GatewayApplication.class, args);
    }
}

This example illustrates how to create an API gateway using Zuul proxy.

Getting Started

To get started with microservices-platform:

  1. Clone the repository:

    git clone https://github.com/zlt2000/microservices-platform.git
    
  2. Build the project:

    cd microservices-platform
    mvn clean package
    
  3. Start the required services (e.g., Nacos, Redis, MySQL) using Docker:

    docker-compose up -d
    
  4. Run the microservices:

    java -jar user-center/target/user-center.jar
    java -jar auth-server/target/auth-server.jar
    java -jar gateway-server/target/gateway-server.jar
    
  5. Access the admin console at http://localhost:8080 with default credentials (admin/admin).

Competitor Comparisons

Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.

Pros of spring-cloud-alibaba

  • More comprehensive ecosystem with a wider range of components and services
  • Better integration with Alibaba Cloud services
  • Larger community support and more frequent updates

Cons of spring-cloud-alibaba

  • Steeper learning curve due to its extensive feature set
  • Potential vendor lock-in with Alibaba Cloud services
  • Less focus on out-of-the-box UI components

Code Comparison

microservices-platform:

@EnableFeignClients
@EnableDiscoveryClient
@SpringBootApplication
public class UserCenterApp {
    public static void main(String[] args) {
        SpringApplication.run(UserCenterApp.class, args);
    }
}

spring-cloud-alibaba:

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
public class ProviderApplication {
    public static void main(String[] args) {
        SpringApplication.run(ProviderApplication.class, args);
    }
}

Both projects use similar annotations for enabling service discovery and Feign clients. The main difference lies in the specific implementations and additional features provided by each framework.

12,362

AWS Service registry for resilient mid-tier load balancing and failover.

Pros of Eureka

  • Mature and battle-tested service registry used by Netflix at scale
  • Simpler to set up and use for basic service discovery needs
  • Better documentation and community support due to its widespread adoption

Cons of Eureka

  • Limited features compared to microservices-platform's comprehensive suite
  • Lacks built-in support for additional microservices patterns and tools
  • Requires integration with other Netflix OSS components for advanced functionality

Code Comparison

Eureka client registration:

@SpringBootApplication
@EnableEurekaClient
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

microservices-platform client registration:

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

Both projects use similar annotations for service registration, but microservices-platform includes additional features like Feign client support out of the box.

Summary

Eureka is a solid choice for basic service discovery in microservices architectures, offering simplicity and proven reliability. However, microservices-platform provides a more comprehensive solution with additional tools and patterns integrated, making it suitable for more complex microservices ecosystems. The choice between the two depends on the specific requirements and scale of the project.

Integration with Netflix OSS components

Pros of Spring Cloud Netflix

  • More mature and widely adopted in the Spring ecosystem
  • Extensive documentation and community support
  • Seamless integration with other Spring Cloud projects

Cons of Spring Cloud Netflix

  • Heavier footprint and potentially slower startup times
  • Some components (e.g., Hystrix) are in maintenance mode
  • Steeper learning curve for developers new to Spring Cloud

Code Comparison

Spring Cloud Netflix:

@EnableEurekaClient
@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

Microservices Platform:

@EnableDiscoveryClient
@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

Both projects use similar annotations for service discovery, with Spring Cloud Netflix using @EnableEurekaClient and Microservices Platform using @EnableDiscoveryClient. The main difference lies in the specific implementation and configuration of service discovery and other microservices components.

Spring Cloud Netflix provides a more comprehensive set of tools and integrations within the Spring ecosystem, while Microservices Platform offers a lighter-weight alternative with a focus on simplicity and ease of use for developers building microservices architectures.

29,055

Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.

Pros of Apollo

  • More mature and widely adopted project with extensive documentation
  • Supports multiple programming languages and frameworks
  • Offers a user-friendly web interface for configuration management

Cons of Apollo

  • Primarily focused on configuration management, lacking other microservices features
  • May require more setup and configuration compared to microservices-platform
  • Less integrated with other microservices components

Code Comparison

Apollo configuration example:

Config config = ConfigService.getAppConfig();
String someKey = "someKeyFromApollo";
String value = config.getProperty(someKey, "defaultValue");

microservices-platform configuration example:

@Value("${some.key}")
private String someValue;

@RefreshScope
public class SomeClass {
    // Class implementation
}

Summary

Apollo is a robust configuration management system for microservices, while microservices-platform is a more comprehensive solution that includes various components for building microservices architectures. Apollo excels in configuration management across multiple languages, but microservices-platform offers a more integrated approach with additional features like service discovery, API gateway, and monitoring tools. The choice between the two depends on specific project requirements and the desired level of integration within the microservices ecosystem.

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.

Pros of Seata

  • More mature and widely adopted distributed transaction solution
  • Supports multiple transaction modes (AT, TCC, SAGA, XA)
  • Better integration with popular frameworks and cloud-native environments

Cons of Seata

  • Focused solely on distributed transactions, not a complete microservices platform
  • Steeper learning curve for newcomers to distributed systems
  • May require more configuration and setup compared to microservices-platform

Code Comparison

microservices-platform:

@EnableFeignClients
@EnableDiscoveryClient
@SpringBootApplication
public class UserCenterApp {
    public static void main(String[] args) {
        SpringApplication.run(UserCenterApp.class, args);
    }
}

Seata:

@SpringBootApplication
@EnableAutoDataSourceProxy
public class SeataApplication {
    public static void main(String[] args) {
        SpringApplication.run(SeataApplication.class, args);
    }
}

The code snippets show that microservices-platform focuses on service discovery and Feign clients, while Seata emphasizes automatic data source proxying for transaction management. This reflects their different primary purposes: microservices-platform as a comprehensive microservices solution, and Seata as a specialized distributed transaction framework.

SOFABoot is a framework that enhances Spring Boot and fully compatible with it, provides readiness check, class isolation, etc.

Pros of sofa-boot

  • More mature and widely adopted in production environments
  • Stronger focus on middleware integration and enterprise-level features
  • Better documentation and community support

Cons of sofa-boot

  • Steeper learning curve due to its comprehensive feature set
  • Potentially heavier resource consumption for smaller applications
  • Less emphasis on rapid prototyping and quick setup

Code Comparison

sofa-boot:

@SofaService
public class ExampleServiceImpl implements ExampleService {
    // Service implementation
}

microservices-platform:

@Service
public class ExampleServiceImpl implements ExampleService {
    // Service implementation
}

Key Differences

  • sofa-boot uses custom annotations like @SofaService for service registration, while microservices-platform relies on standard Spring annotations
  • sofa-boot provides more extensive middleware integration options out-of-the-box
  • microservices-platform offers a more streamlined setup process for rapid development

Use Cases

  • sofa-boot: Large-scale enterprise applications with complex middleware requirements
  • microservices-platform: Smaller to medium-sized projects prioritizing quick setup and development

Community and Support

  • sofa-boot: Larger community, more frequent updates, and extensive documentation
  • microservices-platform: Smaller but active community, with a focus on simplicity and ease of use

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

zlt-microservices-platform

Downloads Downloads Downloads Downloads Downloads Downloads Downloads Downloads

如果您觉得有帮助,请点右上角 "Star" 支持一下谢谢

 

1. 总体架构图

mark

 

2. 功能介绍

mark

 

3. 项目介绍

  • 技术交流群
交流三群
交流三群
  • 详细在线文档 :https://www.kancloud.cn/zlt2000/microservices-platform/919418
  • 演示环境地址: http://zlt2000.cn
    • 账号密码:admin/admin
    • Grafana账号:zlt/zlt123
  • 演示环境有全方位的监控示例:日志系统 + APM系统 + GPE系统
  • Gitee地址:https://gitee.com/zlt2000/microservices-platform
  • Github地址:https://github.com/zlt2000/microservices-platform
  • 前后端分离的企业级微服务架构
  • 主要针对解决微服务和业务开发时常见的非功能性需求
  • 基于 Spring Authorization Server 深度定制Spring Security真正实现了基于RBAC、jwt和oauth2的无状态统一权限认证的解决方案
  • 提供应用管理,方便第三方系统接入,支持多租户(应用隔离)
  • 引入组件化的思想实现高内聚低耦合并且高度可配置化
  • 注重代码规范,严格控制包依赖,每个工程基本都是最小依赖
  • 非常适合学习和企业中使用

重构于开源项目OCP&cp:https://gitee.com/owenwangwen/open-capacity-platform

 

4. 分支说明

分支名JDKSpring BootSpring CloudSpring Security
master173.x2022.xSpring Authorization Server
5.x1.82.5.x2020.xSpring Security OAuth
4.x1.82.3.x2.2.xSpring Security OAuth

 

5. 模块说明

central-platform -- 父项目,公共依赖
│  ├─zlt-business -- 业务模块一级工程
│  │  ├─user-center -- 用户中心[7000]
│  │  ├─file-center -- 文件中心[5000]
│  │  ├─code-generator -- 代码生成器[7300]
│  │  ├─search-center -- 搜索中心
│  │  │  ├─search-client -- 搜索中心客户端
│  │  │  ├─search-server -- 搜索中心服务端[7100]
│  │─zlt-commons -- 通用工具一级工程
│  │  ├─zlt-auth-client-spring-boot-starter -- 封装spring security client端的通用操作逻辑
│  │  ├─zlt-common-core -- 封装通用操作逻辑
│  │  ├─zlt-common-spring-boot-starter -- 封装通用操作逻辑
│  │  ├─zlt-db-spring-boot-starter -- 封装数据库通用操作逻辑
│  │  ├─zlt-log-spring-boot-starter -- 封装log通用操作逻辑
│  │  ├─zlt-redis-spring-boot-starter -- 封装Redis通用操作逻辑
│  │  ├─zlt-loadbalancer-spring-boot-starter -- 封装Loadbalancer和Feign的通用操作逻辑
│  │  ├─zlt-sentinel-spring-boot-starter -- 封装Sentinel的通用操作逻辑
│  │  ├─zlt-elasticsearch-spring-boot-starter -- 封装Elasticsearch通用操作逻辑
│  │  ├─zlt-oss-spring-boot-starter -- 封装对象存储通用操作逻辑
│  │  ├─zlt-zookeeper-spring-boot-starter -- 封装Zookeeper通用操作逻辑
│  ├─zlt-config -- 配置中心
│  ├─zlt-doc -- 项目文档
│  ├─zlt-gateway -- api网关一级工程
│  │  ├─sc-gateway -- spring-cloud-gateway[9900]
│  ├─zlt-monitor -- 监控一级工程
│  │  ├─sc-admin -- 应用监控[6500]
│  │  ├─log-center -- 日志中心[7200]
│  ├─zlt-uaa -- spring-security认证中心[8000]
│  ├─zlt-register -- 注册中心Nacos[8848]
│  ├─zlt-web -- 前端一级工程
│  │  ├─layui-web -- layui前端[8066]
│  │  ├─react-web -- react前端[8066]
│  ├─zlt-demo -- demo一级工程
│  │  ├─dubbo-demo -- dubbo服务demo
│  │  ├─resource-server-demo -- 资源服务器demo
│  │  ├─seata-demo -- seata分布式事务demo
│  │  ├─sharding-jdbc-demo -- sharding-jdbc分库分表demo
│  │  ├─rocketmq-demo -- rocketmq和mq事务demo
│  │  ├─sso-demo -- 单点登录demo
│  │  ├─websocket-demo -- websocket demo
阿里云 腾讯云

6. 交流反馈

 

7. 截图(点击可大图预览)

首页 用户搜索
日志系统 日志链路
server_metrics application_metrics
skywalking首页.png skywalking应用拓扑图
elk 任务中心
日志中心02 慢查询sql
nacos-discovery 应用吞吐量监控