Giter VIP home page Giter VIP logo

shoprest's Introduction

Usage

Running the Service

./gradlew bootRun # use 'gradlew bootRun' on Windows

Distributing the Service ./gradlew build # use 'gradlew build' on Windows

generates the binary ./build/libs/XXXXX.jar

A Dockerfile is available to build an image. The image build process can be launched using

./gradlew buildDocker # use 'gradlew buildDocker' on windows`

Decision made

Geolocation To obtain the geolocation for the shops have been resolve using the GMaps Api.

Persistence To store data from the created shops, I have chosen the Hazelcast approach which eases horizontal scaling. I use an IMap sinchronized in the cluster with name of the shop as key and we insert longitude and latitude when the shop is added.

Positioning The distance between the different shops has been resolved using a formula called Haversine, this formula gives you the distance between two geo-coordinates. We will iterate for each one of the stored shops and compare to the user location, giving the nearest shop.

Deployment Spring Boot allows several options, for development it is easy to use the embedded tomcat/jetty/undertown server, but for production you can remove those dependencies and deploy it as a war file in a web server. A Dockerfile is provided in case you want to build a containerized application.

Testing Integration test are done in a real test environment created by Spring Boot at runtime. Rest-assured (http://rest-assured.io/), have been selected to implement the tests. It offers a Java DSL for easy testing of REST services.

Expanding this approach, the rest-assured tests can be migrated to BDD style using Serenity-BDD framework (http://www.thucydides.info). Furthermore It could be integrated in a continuous delivery pipeline in the functional tests phase.

shoprest's People

Watchers

James Cloos avatar Pere 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.