Giter VIP home page Giter VIP logo

widgetstore-api's Introduction

widgetstore-app

A Widget is an object on a plane in a Cartesian coordinate system that has coordinates (X, Y), Z-index, width, height, last modification date, and a unique identifier.

X, Y, and Z-index are integers (may be negative). Width and height are integers > 0. Widget attributes should be not null.

A Z-index is a unique sequence common to all widgets that determines the order of widgets (regardless of their coordinates). Gaps are allowed. The higher the value, the higher the widget lies on the plane.

A web service to work with widgets via HTTP REST API. The service stores only widgets if all clients work with the same board.

Software Requirements

Application Architecture

How to run the application

Running the application using docker

Installation

Use the maven command line interface Maven to install the dependencies

mvn install -DSkipTests

Test

Use the maven command line interface Maven to perform unit test

mvn test

package build

mvn package

Docker build

docker build --rm -f "Dockerfile" -t widgetstore:latest "."

How the docker image is build

  • Base image for the docker container is adoptopenjdk:11-jre-openj9

  • lib files from the location /target/dependency/lib are copied to /app/lib in the image

  • Resources files from the location /target/dependency/resources are copied to /app in the image

  • Compiled class files from the location /target/classes are copied to /app in the image

How to run docker container

docker container run  -p 8080:8080 -d --rm --name coffee-shop  widgetstore:latest

How to run the application in Kubernetics

  • push the created image to Docker container registry using push command docker tag 092f82fa7ed7 noblesebastiank/widgetstore:latest docker push noblesebastiank/widgetstore:latest
  • connect to cloud kubernetes cluster
  • Deploy the image to kubernetics pod using apply command kubectl apply -f deployment.yaml
  • Check the status of the pod Kubectl get pods
  • Test the application

How to run the application in Azure Cloud

  • Create build pipe line using mvn template or default template
  • Define stages for using mvn template, add stages like test,pakage,build image,push image to docker container registry
  • Create release piple line in cloud and deploy the deployment.yaml kubectl apply -f deployment.yaml
  • Check the status of the pod Kubectl get pods
  • Test the application

Running the application with IDE

There are several ways to run a Spring Boot application on your local machine. One way is to execute the main method in the com.miro.widgetstore.Application class from your IDE.

  • Download the zip or clone the Git repository.
  • Unzip the zip file (if you downloaded one)
  • Open Command Prompt and Change directory (cd) to folder containing pom.xml
  • Open Eclipse
    • File -> Import -> Existing Maven Project -> Navigate to the folder where you unzipped the zip
    • Select the project
  • Open Intleji
    • File->Open -> Navigate to the folder where you unzipped the zip
    • Select the project
  • Choose the Spring Boot Application file (search for @SpringBootApplication)
  • Right Click on the file and Run as Java Application

Health Check

    • path : /application/health
    • port : 8080

Data Contract

    • path : openapi.yaml
    • open swaggerEditor then paste the contents in openapi.yaml

Swagger URL

API collection

SAMPLE API collection

Test Coverage

  • 72 % Test coverage, it can be viewed using Jacoco

widgetstore-api's People

Contributors

noblesebastianofficial avatar

Watchers

 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.