Git Product home page Git Product logo

matrikajoshi / shopbiz-app Goto Github PK

View Code? Open in Web Editor NEW
18.0 1.0 17.0 1.68 MB

Sample E-commerce platform built in Microservices architecture

License: MIT License

JavaScript 0.34% TypeScript 17.21% CSS 36.06% HTML 8.46% Java 36.61% TSQL 0.37% Dockerfile 0.43% Ruby 0.49% Gherkin 0.04%
java angular8 spring-boot spring-security spring-data-jpa swagger jwt-authentication docker spring-actuator mysql

shopbiz-app's Introduction

Spring-Boot and Angular e-commerce app with Microservices architecture using Spring Cloud

Technologies

  • Java 8
  • Angular 8
  • Spring Boot 2
  • Spring Cloud
  • Docker

Features:

  1. User authentication and access control using Spring Security with Json Web Token
  2. Spring actuator to monitor API usage including /health endpoint
  3. OpenAPI/Swagger for API documentation
  4. Spring Boot based Restful API including HATEOAS, Validation, Exception Handling
  5. App uses h2 in memory database for testing and mysql database while app is running
  6. Adding product to shopping cart without logging into application
  7. Interacting with RabbitMQ server to pubish and subscribe messages for update in order details using Spring AMQP's RabbitTemplate.
  8. Admin role can add/update/delete products
  9. Hibernate Level 2 caching with EhCache

Spring Cloud components

  1. Eureka for Microservice Registration and Discovery and Dynamic scaling
  2. Netflix-zuul for API Gateway
  3. Feign for declarative REST client for Microservices
  4. Client side load balancing using Ribbon
  5. Hystrix for fault tolerance
  6. Distributed Tracing using Spring Cloud Sleuth and Zipkin

Build and Deploy

Running apps independently with maven installed:

  • Change directory to Spring Cloud projects and run as Spring Boot application
  • Database setup
    • For coupon-service application
      • Create database 'coupondb' in mongodb
      • Update application-properties at src/main/resources with database properties
    • For shopbiz-api application
      • create database 'shopbiz' in mysql
      • Update mysql credentials in application.properties located at src/main/resources
  • All tables will be created and intial data will be imported automatically from data.sql file by Spring Boot

Navigate to shopbiz directory

-$ cd shopbiz-api

Run as spring-boot application

$ mvn spring-boot:run

Swagger documentation available at - http://localhost:8080/shopbiz/swagger-ui.html#/

In browser navigate to http://localhost:8080/shopbiz/

To run frontend with Angular CLI and NodeJS

  • navigate to shopbiz-ui
$ cd shopbiz-ui
$ npm install
$ ng serve

Frontend will be running at http://localhost:4200

Deploy Using Docker

  • Run docker compose from project root

    -$ docker-compose up --build

  • This will deploy whole application with microservices where nginx will serve UI and redirect to backend using proxy and mysql and mongodb containers will be running with persistent volume to store data across container lifecycle.

  • Navigate to http://localhost to view running app

To login

URLs

Application URL
Shopbiz-api http://localhost:8080/shopbiz-api/swagger-ui/index.html
Eureka http://localhost:8761/
Zipkin http://localhost:9411/zipkin/

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.