Coder Social home page Coder Social logo

aravindsh / e-commerce-poc Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 4.0 371 KB

E commerce microservices backend POC using spring cloud

Java 100.00%
mongodb postgresql-database maven java ecommerce backend spring-tool-suite hibernate spring-boot eureka-server

e-commerce-poc's Introduction

E-Commerce-POC

E-Commerce Microservices Backend POC using Spring Cloud

High Level Block Diagram

  • Eureka Discovery Server : Holds the information about all the client microservices i.e Admin and User microservice. All clients register themselves with eureka server and use it to communicate with each other.

  • Config Server : Centralized configuration server which facilitates external configuration. Client Microservices connect to this server to obtain necessary configuration information(eg: database host and port). The configuration file can be backed by a version control system like git.

  • Admin Microservice : Serves all the endpoints related to product catalog. Enables administrator of the website to add/update/delete products. MongoDB is used to store product related details.

  • User Microservice : Serves all endpoints related to user such as login by email, new user enrolment, editing existing user profile, fetching user profile details. PostgreSQL is used to store user details. Hibernate ORM is used to interact with PostgreSQL.

Build & Run from Source

  • Initial Setup : Java 1.8.0_191, Apache Maven 3.6.0, PostgreSQL 10.5, MongoDB 4.0.3
  • PostgreSQL Setup :
  • MongoDB Setup :
    • Host: localhost
    • Port: 27017
    • Database Name: e_commerce_db
    • Collection Name: product_catalog
    • Create Sample Data: Open a new terminal/cmd and enter the following commands
      cd ./etc/mongodbDataInit/
      mvn clean package -Dmaven.test.skip=true
      java -jar ./target/mongodbDataInit-0.0.1-SNAPSHOT.jar
  • Run Config Server : Open a new terminal/cmd and enter the following commands
    cd configServer/
    mvn clean package -Dmaven.test.skip=true
    java -jar ./target/configServer-0.0.1-SNAPSHOT.jar
  • Run Eureka Server :
    • Primary Profile - Open a new terminal/cmd and enter the following commands
      cd eurekaServer/
      mvn clean package -Dmaven.test.skip=true
      java -jar -Dspring.profiles.active=primary ./target/eurekaServer-0.0.1-SNAPSHOT.jar
    • Secondary Profile - Open a new terminal/cmd and enter the following commands
      cd eurekaServer/
      java -jar -Dspring.profiles.active=secondary ./target/eurekaServer-0.0.1-SNAPSHOT.jar
  • Run Admin Microservice :
    • Default Profile - Open a new terminal/cmd and enter the following commands
      cd admin/
      mvn clean package -Dmaven.test.skip=true
      java -jar ./target/admin-0.0.1-SNAPSHOT.jar
    • Replica Profile - Open a new terminal/cmd and enter the following commands
      cd admin/
      java -jar -Dspring.profiles.active=replica ./target/admin-0.0.1-SNAPSHOT.jar
  • Run User Microservice : Open a new terminal/cmd and enter the following commands
    cd user/
    mvn clean package -Dmaven.test.skip=true
    java -jar ./target/user-0.0.1-SNAPSHOT.jar
  • Testing Endpoints : Download Postman Rest Client and import postman collection OR use your favourite Rest Client and refer this folder for all endpoint details

e-commerce-poc's People

Contributors

aravindsh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.