An implementation of a sample E-Commerce app in k8s. This online retail marketplace app uses Spring Boot, React, and YugabyteDB.

Overview

Yugastore in Kubernetes

Homepage This is an implementation of a sample ecommerce app. This microservices-based retail marketplace or eCommerce app is composed of microservices written in Java (Spring), a GUI based on React and YugabyteDB as the distributed SQL database.

If you're using this demo app, please this repository! We appreciate your support.

Trying it out

This repo contains all the instructions you need to run the app on your laptop.

You can also try the app out online, it is hosted on Pivotal Web Services.

Versions

  • Java 17
  • Spring Boot 2.6.3
  • Spring Cloud 2021.0.0
  • Yugabyte Java Driver 4.6.0-yb-10
  • Python 3 (for data Loading)

Features

  • Written fully in Spring Framework
  • Desgined for multi-region and Kubernetes-native deployments
  • Features Spring Boot microservices
  • Uses a discovery service for the microservices
  • Sample data has over 6K products in the store

Architecture

The architecture diagram of Yugastore is shown below.

Architecture of microservices based retail marketplace app

Microservice YugabyteDB API Default host:port Description
service discovery - localhost:8761 Uses Eureka for localhost. All microservices register with the Eureka service. This registration information is used to discover dynamic properties of any microservice. Examples of discovery include finding the hostnames or ip addresses, the load balancer and the port on which the microservice is currently running.
react-ui - localhost:8080 A react-based UI for the eCommerce online marketplace app.
api-gateway - localhost:8081 This microservice handles all the external API requests. The UI only communicates with this microservice.
products YCQL localhost:8082 This microservice contains the entire product catalog. It can list products by categories, return the most popular products as measured by sales rank, etc.
cart YSQL localhost:8083 This microservice deals with users adding items to the shopping cart. It has to be necessarily highly available, low latency and often multi-region.
checkout YCQL localhost:8086 This deals with the checkout process and the placed order. It also manages the inventory of all the products because it needs to ensure the product the user is about to order is still in stock.
search - localhost:8888 Uses the Redisearch module of Redis to provide full text search of the product catalog.
login YSQL localhost:8085 Handles login and authentication of the users. Note that this is still a work in progress.

Minikube Setup

This mode puts Docker images directly into minikube's container repository using skaffold for automation.

  1. Start minikube.

    minikube start --cpus 4 --memory 5120 --vm-driver virtualbox
    
  2. Tell skaffold to use minikube's docker container registry. It's magic.

    eval $(minikube -p minikube docker-env)
    

    If you previously used minikube and now want to switch to GKE, unset any minikube Docker environment variables, if present:

    eval $(minikube -p minikube docker-env -u)
    

GKE and Minikube

Start here for GKE. Continue here if you are using minikube.

  1. Ensure your helm charts are up to date so you can run YugabyteDB in k8s.

    helm repo update
    
  2. Create OSS YugabyteDB, and give it a minute or two to start up. Note: if you use Platform instead, you will need to edit env.yaml in the k8s-manifests directory.

    for namespace in yb-demo
    do
    helm install $namespace yugabytedb/yugabyte \
    --set resource.master.requests.cpu=0.5,resource.master.requests.memory=0.5Gi,\
    resource.tserver.requests.cpu=0.5,resource.tserver.requests.memory=0.5Gi,\
    replicas.master=1,replicas.tserver=1,enableLoadBalancer=False,\
    istioCompatibility.enabled=true \
    --create-namespace --namespace $namespace
    done
    
  3. Enable port forwarding to the database so you can populate data.

    kubectl port-forward -n yb-demo svc/yb-tservers 5444:5433 &
    
  4. Create the schemas and load product catalog data into YugabyteDB.

    cd resources
    ./dataload.sh 5444
    
  5. Build the Docker containers and deploy them.

    Minikube:

    skaffold run --skip-tests=true
    

    GKE:

    skaffold run --skip-tests=true --default-repo gcr.io/dataengineeringdemos/yugabyte
    
    • You will need to tell skaffold the name of your GCP project's image registry in the step above. The registry name can be determined by navigating to your project's Container Registry and clicking on the copy icon next to the repository to get the full name.
  6. Populate the Redis cache.

    kubectl port-forward redis 6380:6379 &
    ./json2redis.py products.json
    
  7. Enable port forwarding for your browser, and browse to http://localhost:8080/

    kubectl port-forward svc/yugastore-ui 8080:8080
    
You might also like...

In this course, we will learn how to build a complete full-stack web application using Spring boot as backend and React (React Hooks) as frontend

In this course, we will learn how to build a complete full-stack web application using Spring boot as backend and React (React Hooks) as frontend. We will use MySQL database to store and retrieve the data.

Dec 22, 2022

Sample Spring-Cloud-Api-Gateway Project of Spring Boot

Sample-Spring-Cloud-Api-Gateway Sample Spring-Cloud-Api-Gateway Project of Spring Boot Proejct Stack Spring Webflux Spring Cloud Gateway Spring Data R

Jan 17, 2022

Projeto criado na semana Spring React organizado pela escola Dev Superior com foco na prática/aprendizado das tecnologias Spring e React.

DSVendas Projeto criado na semana Spring React organizado pela escola Dev Superior com foco na prática/aprendizado das tecnologias Spring e React. htt

May 18, 2021

Spring Boot Login and Registration example with MySQL, JWT, Rest Api - Spring Boot Spring Security Login example

Spring Boot Login and Registration example with MySQL, JWT, Rest Api - Spring Boot Spring Security Login example

Spring Boot Login example with Spring Security, MySQL and JWT Appropriate Flow for User Login and Registration with JWT Spring Boot Rest Api Architect

Jan 5, 2023

This Web Application Allows A user to upload a two minutes Video. It uses Server Side Capabilities of Nodejs and Spring Boot .

This Web Application Allows A user to upload a two minutes Video. It uses Server Side Capabilities of Nodejs and Spring Boot .

VideoStreamingApplication Purpose Of This Application These days trend of short videos are on rise youtube recently realsed "Shorts" . So , taking ins

Nov 13, 2022

How to configure Replica Set with Embedded Mongo using Spring Boot and Flapdoodle for unit testing code that uses mongodb transactions

Spring Boot Embedded Mongo with Replica Set This project defines a basic rest service that allows users to update records of a Person (name and email)

Nov 1, 2022

A sample microservice built with Spring Boot and Gradle.

Project Overview A sample microservice built with Spring Boot and Gradle. There are APIs built using REST and the resource is bicycle. All CRUD operat

Feb 2, 2022

lilishop是采用JAVA开发的B2B2C多用户商城系统/电商系统/电子商务。基于当前流行技术组合的前后端分离商城系统:后端使用 SpringBoot、MybatisPlus、SpringSecurity、redis、ES、mysql、mongodb等主流技术,前端使用vue框架iview、uniapp。支持分布式部署,分布式事务,支持docker、k8s。商城支持 PC、WAP、H5、小程序、APP等各个客户端

lilishop是采用JAVA开发的B2B2C多用户商城系统/电商系统/电子商务。基于当前流行技术组合的前后端分离商城系统:后端使用 SpringBoot、MybatisPlus、SpringSecurity、redis、ES、mysql、mongodb等主流技术,前端使用vue框架iview、uniapp。支持分布式部署,分布式事务,支持docker、k8s。商城支持 PC、WAP、H5、小程序、APP等各个客户端

Lilishop B2B2C商城系统 官方公众号 & 开源不易,如有帮助请点Star 介绍 官网:https://pickmall.cn Lilishop 是一款Java开发,基于SpringBoot研发的B2B2C多用户商城,前端使用 Vue、uniapp开发 系统全端全部代码开源 产品前后端分离

Dec 31, 2022

A Velocity proxy plugin for Minecraft server discovery in k8s. All discovered servers are automatically added to the Velocity proxy.

kryo-server-discovery This plugin connects minecraft servers to a velocity proxy within Kubernetes. The service account in the namespace which the pro

Sep 13, 2022
Owner
yugabyte
The high-performance distributed SQL database for global, internet-scale apps.
yugabyte
Spring Boot microservices app with Spring Cloud, Robust and resilient backend managing e-Commerce app

e-Commerce-boot μServices Important Note: This project's new milestone is to move The whole system to work on Kubernetes, so stay tuned. Introduction

Selim Horri 65 Dec 23, 2022
该仓库中主要是 Spring Boot 的入门学习教程以及一些常用的 Spring Boot 实战项目教程,包括 Spring Boot 使用的各种示例代码,同时也包括一些实战项目的项目源码和效果展示,实战项目包括基本的 web 开发以及目前大家普遍使用的线上博客项目/企业大型商城系统/前后端分离实践项目等,摆脱各种 hello world 入门案例的束缚,真正的掌握 Spring Boot 开发。

Spring Boot Projects 该仓库中主要是 Spring Boot 的入门学习教程以及一些常用的 Spring Boot 实战项目教程,包括 Spring Boot 使用的各种示例代码,同时也包括一些实战项目的项目源码和效果展示,实战项目包括基本的 web 开发以及目前大家普遍使用的前

十三 4.5k Dec 30, 2022
Customer app for small scale retail shops

Hello guys, I am Manvitha Roy ⚡ I have developed an app named as Mirchi ?? Mirchi is an online grocery,clothes customer side app for small scale retai

Manvitha roy 2 Jul 15, 2022
e-Shop is an e-commerce website where you can shop for items online.

e-Shop Website e-Shop is an e-commerce website where you can shop for items online. It's a Maven-based project. This e-Shop website is created by Vale

Valentine Fernandes 30 Dec 8, 2022
循序渐进,学习Spring Boot、Spring Boot & Shiro、Spring Batch、Spring Cloud、Spring Cloud Alibaba、Spring Security & Spring Security OAuth2,博客Spring系列源码:https://mrbird.cc

Spring 系列教程 该仓库为个人博客https://mrbird.cc中Spring系列源码,包含Spring Boot、Spring Boot & Shiro、Spring Cloud,Spring Boot & Spring Security & Spring Security OAuth2

mrbird 24.8k Jan 6, 2023
Hcode Online Judge(HOJ):An open source online judge system base on SpringBoot, Springcloud Alibaba and Vue.js !

Hcode Online Judge(HOJ) 前言 基于前后端分离,分布式架构的在线测评平台(hoj),前端使用vue,后端主要使用springboot,redis,mysql,nacos等技术。 在线Demo:https://hdoi.cn 在线文档:https://www.hcode.top/

Himit_ZH 179 Dec 31, 2022
Super simple deploy using spring boot, docker, k8s and kind

Target Target of this repository is show how to build spring boot application Docker image and deploy it with kind and k8s at least in local. Prerequi

Max 4 Aug 22, 2021
👮🏻‍♀️ simple k8s admission controller using spring boot

spring admission controller Spring boot를 이용해 만든 간단한 Kubernetes admission controller 입니다. Admission controller의 Validating webhook을 이용하여 Pod의 생성을 제한합니다

Bobae Kim 2 Dec 22, 2021
With react-native-update-in-app library you can easily implement in-app updates in your React Native app using CDN or any other file server

React Native In-App update With react-native-update-in-app library you can easily implement in-app updates in your React Native app using CDN or any o

Nepein Andrey 7 Dec 21, 2022
E-Commerce Spring Boot Back-end

E-Commerce Technologies used in the construction of the project Spring Boot H2 Databse Hibernate Spring Data Lombok JUnit Some available services On t

Baris Seckin 7 Dec 24, 2022