Git Product home page Git Product logo

maventalker / simplemall Goto Github PK

View Code? Open in Web Editor NEW
713.0 60.0 367.0 887 KB

基于SpringCloud的微服务架构实战案例项目,以一个简单的购物流程为示例,融合spring cloud 相关组件,如spring-cloud-netflix、swagger等

Home Page: https://github.com/backkoms/simplemall/blob/develop/getqrcode.jpeg

Java 85.54% JavaScript 9.49% HTML 1.86% TSQL 3.11%
micro-service spring-cloud spring-boot swagger2 netflix jwt-authentication spring-security zuul eureka jwt

simplemall's Introduction

Stargazers over time

Stargazers over time

QuickStart

基于SpringCloud体系实现,简单购物流程实现,满足基本功能:注册、登录、商品列表展示、商品详情展示、订单创建、详情查看、订单支付、库存更新等等。

每个业务服务采用独立的MYSQL数据库,初期考虑用到如下组件:

  1. 服务注册、发现: eureka
  2. 配置管理:spring config , spring security
  3. 集群容错: hystrix
  4. API网关: zuul
  5. 服务负载:feign+ribbon
  6. api文档输出:swagger2
  7. 代码简化:lombok
  8. 消息队列:rabbitmq
  9. 分布式锁: redis (待实现)
  10. 链路跟踪:spring cloud sletuh ->zipkin
  11. 安全认证:oauth2/JWT(通过JWT轻量级的实现)
  12. 服务监控:spring-boot-admin

各模块介绍

模块名称 端口 简介
admin-server 9002 服务监控中心,监控所有服务模块
conf-server 9004 分布式配置中心,结合spring-security/rabbitmq同时使用
eureka-server 9003 服务注册中心,提供服务注册、发现功能
sleuth-server 9001 SpringCloud实现的一种分布式追踪解决方案,兼容Zipkin
zuul-server 9005 API网关模块
account-service 8080 用户服务,提供注册、登录、地址等服务
product-service 8081 商品服务,提供商品列表、详情、库存更新等服务
payment-service 8082 支付服务,支付记录
order-service 8083 订单服务,提供订单创建、详情、状态变更
msg-service 8084 消息处理服务
front-app         8088   前端服务,结合swagger2提供API管理(有小问题,swagger页面无法点击单个接口,可通过展开功能打开,待解决)

快速上手

  • 0、基础软件依赖,rabbitmq\redis
  • 1、先启动admin-server,eureka-server,conf-server三个基础服务
  • 2、再依次启动payment/order/product/account基础业务服务
  • 3、最后启动front-app服务,打开浏览器,输入http://localhost:8088/swagger-ui.html ,根据流程API依次可使用功能[swagger主界面存在bug,不能选择某个api展开收缩,可通过全部展开/收缩的形式使用]
  • 4、后续有时间再提供页面,基于VUE2+BOOTSTRAP,将流程串起来

相关测试

1、启动基础eureka/config两个服务后,直接启动front-app服务,通过swagger测试商品列表或详情功能来测试hystrix的功能
1.1、启动hystrix-dashboard服务,输入监控地址http://localhost:8088/hystrix.stream可以查看监控视图
2、输入http://localhost:9005/account-service/acc/login?phone=123123&password=123123查看返回结果

关注公众号,获取更多内容

image

个人主页:https://backkoms.github.io

基于SpringBoot+Dubbo微服务开发实战基础框架

github:https://github.com/backkoms/web-service-demo

github:https://github.com/backkoms/web-api-demo

我的知识星球,内容:个人心得体会分享(阅读、写作、职业规划、职业困惑、个人成长、技术提升)、问题提问

个人微信,欢迎*扰

微服务开发实战专栏(SpringCloud、SpringCloudAlibaba、Apache Dubbo)

基于商场停车收费场景的微服务开发实战专栏地址:https://xiaozhuanlan.com/msa-practice

simplemall's People

Contributors

koumingming avatar maventalker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simplemall's Issues

按照README.md文档,无法正常进行开发

您好!按照README.md文档,无法正常进行开发,是否需要修改什么?
1、先启动admin-server,eureka-server,conf-server三个基础服务
2、再依次启动payment/order/product/account基础业务服务
3、最后启动front-app服务,打开浏览器,输入http://localhost:8088/swagger-ui.html ,根据流程API依次可使用功能[swagger主界面存在bug,不能选择某个api展开收缩,可通过全部展开/收缩的形式使用]
4、后续有时间再提供页面,基于VUE2+BOOTSTRAP,将流程串起来

启动问题

启动FrontAPPClientApplication时出现org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'registrationListener': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)这个问题,有没有人遇到过,能否指点一下

启动过程遇到的问题记录

adminserver和configserver会报ClassNotFoundException:java.lang.ClassNotFoundException: org.apache.http.util.Args或者ClassNotFoundException: org.apache.http.pool.ConnPoolControl
解决:
在各自的pom中加依赖:

org.apache.httpcomponents
httpcore
4.4

Using predictable/constant cryptographic key when creating and verifing Json Web Token.

Hi, we are a research group to help developers build secure applications. We designed a cryptographic misuse detector on Java language(Our main concern is the secure implementation and use of Json Web Token). We found your great public repository (i.e., simplemall) from Github, and several security issues detected by our detector are shown in the following. The specific security issues we found are as follows:
(1) Location: Package: com.simplemall.micro.serv.page.security; Class: JWTUtils.class
Security issue: Using predictable/constant cryptographic key when creating and verifing Json Web Token.
simplemall

Using a hard-coded secret does not conform to the security implementation specification of JWT, which may bring security risks to your system. It is recommended that you use a more secure way to store the secret used to generate the JWT. (For the hazards of hardcoded keys, you can refer to CWE-321, NIST Special Publication 800-57).

We wish the above security issues cloud truly help you to build a secure application. If you have any concern or suggestion, please feel free to contact us, we are looking forwart to your reply. Thanks.

请教一个问题。

您好!我看你在根目录的pom.xml里引入了:

<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>1.5.2.RELEASE</version>
		<relativePath /> <!-- lookup parent from repository -->
	</parent>

然后在其他子模块就不用每个都引入,全部继承根目录的pom.xml。

为什么我跟你一样的,却始终不行???是不是还有其他地方需要注意的??

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.