zephyr-microservice-edge

About The Project

Welcome to the Readme of the project of Ward Beyens, Thibaut Bollen and Cindy Knapen. For the Advanced Programming Topics Class, we have made a project around a clothing webshop. This project covers 4 micro services, the edge microservice, user microservice, clothes microservice and order microservice. The user microservice uses Postgres as database while the clothes microservice and order microservice make use of a MongoDB database.

Our micro services

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

Assuming you have a working docker environment.

  • [required] create the databases and the necessary microservices
      docker run -d -p 27017-27019:27017-27019 --name mongodb-adv-clothes mongo
    
      docker run -d -p 17017-17019:27017-27019 --name mongodb-adv-orders mongo
      
      docker run -d -p 5432:5432 --name postgres-adv-users -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=userTest postgres
    
      docker run -d --name user-service -p 8051:8051 -e POSTGRESQL_DB_HOST=host.docker.internal cindy5656/userservice:latest
    
      docker run -d --name order-service -p 8052:8052 -e MONGODB_HOST=host.docker.internal -e MONGODB_PORT=17017 wardbeyens/orderservice:latest
    
      docker run -d --name clothes-service -p 8053:8053 -e MONGODB_HOST=host.docker.internal 990604/clothesservice:latest

Installation

  • if you only need the edge microservice api you can also use docker
    docker run -d --name edge-service -p 8050:8050 -e USER_SERVICE_HOST=host.docker.internal -e CLOTHES_SERVICE_HOST=host.docker.internal -e ORDER_SERVICE_HOST=host.docker.internal wardbeyens/zephyr-edge-service:latest
  1. Clone the repo
    git clone https://github.com/wardbeyens/zephyr-microservice-edge.git
  2. Install maven packages
    mvn install

Diagram

Here you can see the diagram that describes how our services communicate with each other.

Diagram

PostMan

https://documenter.getpostman.com/view/13803101/TVzREHHq

Run in Postman

Swagger UI

Our swagger UI describes the Get, Post, Put and Delete requests that can be used on the edge service.

https://zephyr.wabyte.com/swagger-ui.html

Swagger UI

Swagger UI

Deployment op K8s

(Gebruik van K8s secrets voor environment variables bij deployment )

kubectl create secret generic dev-db-secret --from-literal=POSTGRES_DB=userTest --from-literal=POSTGRES_PASSWORD=postgres --from-literal=POSTGRES_USER=postgres

kubectl apply -f https://raw.githubusercontent.com/wardbeyens/zephyr-microservice-edge/main/k8.yaml

Imgur

Basic front-end

(Basic front-end dat communiceert met de edge-service )

front-end repository

https://zephyr-apt.web.app/

Contact

Ward Beyens - @wardbeyens

Cindy Knapen

Thibaut Bollen