Skip to content
/ shop Public

A Example RESTful web service for managing packages consisting of one or more products.

License

Notifications You must be signed in to change notification settings

arpanps/shop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shop Service

A Example RESTful web service for managing packages consisting of one or more products. Microservice makes use of an online product service to get products.

Check shop-ui repo for basic UI which consumes Shop service rest APIs.

Service uses Java - Spring ecosystem

Running Service

Docker

You need to have Docker installed

Following command will pull and run the image on machine. This will run shop service with default configuration

docker run -p 8080:8080 arpanps/microservice-shop:0.0.1-SNAPSHOT

The API documentations will be available at the path /api-docs

http://localhost:8080/shop/api-docs/

Interact with application API specification and exercise the endpoints via Swagger UI. Access Swagger UI using below link

http://localhost:8080/shop/swagger-ui/index.html?url=/shop/api-docs

For Development

  • Prerequisite - git, java, maven

  • Clone Repo

    git clone https://github.com/arpanps/shop.git

  • Go inside project directory

    cd shop

  • Build Project with Maven

    mvn install

  • Run Service using Maven

    mvn spring-boot:run

Publishing Docker Image

  • Package project

    mvn clean package

  • Build the docker image (Use your username instead of arpanps)

    docker build -t arpanps/microservice-shop -f etc/docker/Dockerfile .

  • Login with your Docker Id

    docker login

  • Tag the image

    docker tag arpanps/microservice-shop arpanps/microservice-shop:0.0.1-SNAPSHOT

  • Push the image to docker hub

    docker push arpanps/microservice-shop:0.0.1-SNAPSHOT

Technology

  • OpenAPI - OpenAPI Specification (formerly Swagger Specification) is an API description format for REST APIs. An OpenAPI file allows you to describe your entire API

  • Swagger UI - Swagger UI allows anyone — be it development team or end consumers — to visualize and interact with the API’s resources without having any of the implementation logic in place.

  • Spring Boot - Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications.

  • Apache Derby - Currently service uses derby, embedded database, for package storage. Derby is very helpful during the development phase, because they are lightweight, fast, quick start time, improve testability, ease of configuration, it lets developer focus more on the development.

  • Hibernate - Hibernate is the most popular ORM framework

  • Actuator - Actuator includes a number of additional features to help you monitor and manage your application when it’s pushed to production, including useful metric, dump and health endpoints.

  • Docker - Docker is a tool designed to make it easier to create, deploy, and run applications by using containers

Reference Documentation

For further reference, please consider the following sections:

Guides

The following guides illustrate how to use some features concretely:

About

A Example RESTful web service for managing packages consisting of one or more products.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published