All Projects → devdcores → Bookstoreapp Distributed Application

devdcores / Bookstoreapp Distributed Application

Ecommerce project is being developed using Spring Boot Microservices and Spring Cloud (Backend) and React (Frontend). Splitting the Ecommerce functionality into various individual microservices so that they can be distributed, scale really well and make use of resources efficiently.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Bookstoreapp Distributed Application

Sample Spring Microservices
Many samples in different branches that shows how to create microservices with Spring Boot, Spring Cloud, Zipkin, Zuul, Eureka, Hystrix, Kubernetes, Elastic Stack and many more tools
Stars: ✭ 368 (+484.13%)
Mutual labels:  microservices, eureka, spring-boot, spring-cloud, zuul, zipkin
Spring Petclinic Microservices
Distributed version of Spring Petclinic built with Spring Cloud
Stars: ✭ 814 (+1192.06%)
Mutual labels:  microservices, eureka, spring-cloud, zuul, prometheus, zipkin
Springcloudlearning
《史上最简单的Spring Cloud教程源码》
Stars: ✭ 16,218 (+25642.86%)
Mutual labels:  eureka, spring-boot, spring-cloud, zuul, feign, consul
Spring Boot Cloud
基于 Spring Boot、Spring Cloud、Spring Oauth2 和 Spring Cloud Netflix 等框架构建的微服务项目
Stars: ✭ 2,044 (+3144.44%)
Mutual labels:  eureka, spring-cloud, zuul, feign, consul, zipkin
Springcloud Learning
Spring Cloud基础教程,持续连载更新中
Stars: ✭ 6,839 (+10755.56%)
Mutual labels:  eureka, spring-boot, spring-cloud, zuul, consul, zipkin
Spring Cloud Learning
☁️适合刚接触微服务架构的初学者了解和学习微服务,主要集成了注册中心、服务网关、配置中心、熔断机制、应用监控。
Stars: ✭ 37 (-41.27%)
Mutual labels:  eureka, spring-boot, spring-cloud, zuul, feign, consul
Microservices Sample
Sample project to create an application using microservices architecture
Stars: ✭ 167 (+165.08%)
Mutual labels:  mysql, spring-boot, zuul, consul, docker-compose
Mini Platform
Mini-Platform致力于更简洁易用的轻量级微服务治理平台。
Stars: ✭ 45 (-28.57%)
Mutual labels:  microservices, eureka, spring-boot, spring-cloud, zuul
Spring Boot Microservice Eureka Zuul Docker
Spring-Boot rest microservices using Eureka, Zuul, Docker. Monitoring with logstash, logback, elasticsearch, kibana
Stars: ✭ 45 (-28.57%)
Mutual labels:  eureka, spring-boot, zuul, feign, docker-compose
Java Spring Cloud
Distributed tracing for Spring Boot, Cloud and other Spring projects
Stars: ✭ 326 (+417.46%)
Mutual labels:  microservices, spring-boot, spring-cloud, zuul, feign
Eureka Consul Adapter
This project contains a Spring Boot Starter that registers HTTP endpoints on a Spring Cloud Eureka server to support Prometheus's service discovery mechanism for Consul (<consul_sd_config>)
Stars: ✭ 93 (+47.62%)
Mutual labels:  eureka, spring-boot, spring-cloud, consul, prometheus
Spring Cloud
SpringCloud微服务架构,提供快速上手脚手架,快速构建高可用注册中心,高可用配置中心,加入Hystrix断路器,gateway服务官网,权限认证、服务降级、限流,加入应用监控
Stars: ✭ 130 (+106.35%)
Mutual labels:  eureka, spring-boot, spring-cloud, zuul, feign
Springcloudexamples
Spring Cloud 学习教程
Stars: ✭ 208 (+230.16%)
Mutual labels:  eureka, spring-boot, spring-cloud, feign, consul
Spring Cloud Security
Security concerns for distributed applications implemented in Spring
Stars: ✭ 488 (+674.6%)
Mutual labels:  microservices, spring-boot, spring-cloud, zuul, feign
Microservices Example
Example of a microservices architecture on the modern stack of Java technologies
Stars: ✭ 66 (+4.76%)
Mutual labels:  microservices, eureka, spring-boot, spring-cloud, feign
Sample Spring Microservices New
Demo for Spring Boot 2 and Spring Cloud microservices with distributed configuration (Spring Cloud Config), service discovery (Eureka), API gateway (Spring Cloud Gateway, Zuul), Swagger2 API documentation, logs correlation using Spring Cloud Sleuth and many more
Stars: ✭ 559 (+787.3%)
Mutual labels:  microservices, eureka, spring-cloud, zuul, feign
Spring Cloud Examples
Spring Cloud 学习案例,服务发现、服务治理、链路追踪、服务监控等
Stars: ✭ 5,829 (+9152.38%)
Mutual labels:  eureka, spring-boot, spring-cloud, zuul
Simplemall
基于SpringCloud的微服务架构实战案例项目,以一个简单的购物流程为示例,融合spring cloud 相关组件,如spring-cloud-netflix、swagger等
Stars: ✭ 687 (+990.48%)
Mutual labels:  eureka, spring-boot, spring-cloud, zuul
Spring Cloud Consul
Spring Cloud Consul
Stars: ✭ 703 (+1015.87%)
Mutual labels:  microservices, spring-boot, spring-cloud, consul
Fw Spring Cloud
SpringCloud构建实战、从入门到高级,包含eureka、zuul、gateway、feign、ribbon、hystrix、mq、turbine、nacos、elk、consul、zookeeper、rocketmq、kafka、分布式事务(RocketMq、LCN、Seata)、分库分表(Sharding-JDBC)、分布式锁(Redis、Guava)、jwt、SkyWalking、Zipkin、bootadmin等使用案例
Stars: ✭ 276 (+338.1%)
Mutual labels:  zuul, feign, consul, zipkin

BookStoreApp-Distributed-Application HitCount


About this project

This is an Ecommerce project still development in progress, where users can adds books to the cart and buy those books.

Application is being developed using Java, Spring and React.

Using Spring Cloud Microservices and Spring Boot Framework extensively to make this application distributed.


Frontend Checkout Flow

CheckOutFlow

Architecture

All the Microservices are developed using spring boot. This spring boot applications will be registered with eureka discovery server.

FrontEnd React App makes request's to NGINX server which acts as a reverse proxy. NGINX server redirects the requests to Zuul API Gateway.

Zuul will route the requests to microservice based on the url route. Zuul also registers with eureka and gets the ip/domain from eureka for microservice while routing the request.


Run this project in Local Machine

Frontend App

Navigate to bookstore-frontend-react-app folder Run below commnads to start Frontend React Application

yarn install
yarn start

Backend Services

To Start Backend Services follow below steps.

Using Intellij/Eclipse or Command Line

Import this project into IDE and run all Spring boot projects or build all the jars running mvn clean install command in root parent pom, which builds all jars. All services will be up in the below mentioned ports.

But running this way we wont get monitoring of microservices. So if monitoring needed to see metrics like jvm memory, tomcat error count and other metrics.

Use below method to deploy all the services and monitoring setup in docker.

Using Docker(Recommended)

Start Docker Engine in your machine.

Run mvn clean install at root of project to build all the microservices jars.

Run docker-compose up --build to start all the containers.

Use the Postman Api collection in the Postman directory. To make request to various services.

Services will be exposed in this ports

Api Gateway Service       : 8765
Eureka Discovery Service  : 8761
Consul Discovery          : 8500
Account Service           : 4001
Billing Service           : 5001
Catalog Service           : 6001
Order Service             : 7001
Payment Service           : 8001

Service Discovery

This project uses Eureka or Consul as Discovery service.

While running services in local, then using eureka as service discovery.

While running using docker, then consul is the service discovery.

Reason to use Consul is it has better features and support compared to Eureka. Running services individually in local uses Eureka as service discovery because dont want to run consul agent and set it up as it becomes extra overhead to manage. Since docker-compose manages all consul stuff hence using Consul while running services in docker.


Troubleshooting

If any issue while starting up services or any api failing. It may be because of new columns or new tables, at this point of time i am not worried much about DB migrations.

So any issues, clear/drop bookstore_db, things may start working agai, if not raise a Issue in Github i will help.


Deployment(In Future It will be deployed like this)

AWS is the cloud provider will be using to deploy this project.

Project wil deployed in multiple Regions and multiple Availability Zones.

React App, Zuul and Eureka will be the public facing service, which will be in public subnet

All the microservices will be packed into docker containers and deployes in the AWS ECS in the private subnet.

Private subnets uses NAT Gateway to make requests to external internet.

Bastian host can be used to ssh into private subnet microservices.

Below is the AWS Architecture diagram for better understanding.

Bookstore Final


Monitoring

There are 2 setups for monitoring

  1. Prometheus and Graphana.
  2. TICK stack monitoring.

Both the setups are very powerful, where prometheus works on pull model. we have to provide target hosts where the prometheus can pull the metrics from. If we specify target hosts using individual hostname/ip its not feasible at end because it will be like hard coded hostnames/ip. So we use Consul discovery to provide target hosts dynamically. By this way when more instances added for same service no need to worry about adding to prometheus target hosts because consul will dynamically add this target in prometheus.

TICK(Telegraf, InfluxDB, Chronograf, Kapacitor) This setup is getting more attention due to its push and pull model. InfluxDB is a time series database, bookstore services push the metrics to influxDB(push model), In Telegraf we specify the targets to pull metrics(pull model). Chronograf/Graphana can be used to view the graph/charts. Kapacitor is used to configure rules for alarms.

docker-compose will take care of bringing all this monitoring containers up.

Dashboards are available at below ports

Graphana   : 3030
Zipkin     : 9411
Prometheus : 9090
Telegraf   : 8125
InfluxDb   : 8086
Chronograf : 8888
Kapacitor  : 9092 

First time login to Graphana use below credentials

Username : admin  
Password : admin


Screenshots of Tracing in Zipkin.

Zipkin
Zipkin

Screenshots of Monitoring in Graphana.

Screen Shot 2019-10-16 at 9 16 21 PM Screen Shot 2019-10-16 at 9 16 12 PM

Screenshots of Monitoring in Chronograf(TICK).

Screen Shot 2019-10-16 at 12 44 20 PM

Screen Shot 2019-10-16 at 12 52 08 PM


Account Service

To Get access_token for the user, you need clientId and clientSecret

clientId : '93ed453e-b7ac-4192-a6d4-c45fae0d99ac'
clientSecret : 'client.devd123'

There are 2 users in the system currently. ADMIN, NORMAL USER

Admin 
userName: 'admin.admin'
password: 'admin.devd123'
Normal User 
userName: 'devd.cores'
password: 'cores.devd123'

To get the accessToken (Admin User)

curl 93ed453e-b7ac-4192-a6d4-c45fae0d99ac:[email protected]:4001/oauth/token -d grant_type=password -d username=admin.admin -d password=admin.devd123


Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].