GithubHelp home page GithubHelp logo

orange-sky's Introduction

Retail App Store

The retail app exposes a set of api to fetch products details, which includes title and price and update price details

Software Stack

  • Dropwizard - 2.0.0

    • The Dropwizard framework provides the basic skeleton for building the backend application.
  • MongoDB - 4.0.0

    • MongoDB was chosen because it fulfills the NoSQL data store requirement.It has been used to store price details of the products and serves as source for price details.
  • Junit- 4.13

  • Apache Maven - 3.6.1

  • Java Version - 8

Build Steps

Go the source code directory and run following commands

mvn clean install

java -jar target/orange-sky-1.0-SNAPSHOT.jar server app-config.yml

These commands will start your application at 8080 port. Start MongoDB in your local setup

API

Fetch Price Details:

This service tries to call target endpoint (redsky) for product title and retrieves price information from the MongoDB. The response for product id 12345679 for title has been hardcoded.It assumes that price information is present in the DB.

Request :

GET /products/{id}

Response

status : 200

{ "id": 12345679, "title": "Dummy Product Title", "current_price": { "value": 400.0, "currency": "USD" } }

Update Price Details:

This service updates the prices of an existing product in the MongoDB.It is only responsible for updating the price of an exsiting product. Request:

POST /products

{ "productId":12345679, "price":500, "currency":"USD" }

Response:

status: 200

{ "productId":12345679, "price":500, "currency":"USD" }

HealthCheck Api

This service can be used to check the health of the backend application

Request:

GET localhost:8081/healtcheck

Response:

{ "data": { "healthy": true, "message": "The Orange Sky Application is healthy ", "duration": 0, "timestamp": "2020-09-18T14:07:19.581+05:30" } }

Error Message Structure

status: http status error code

{ "code": 500/404, "message": "Something went wrong/Resource Not Found" }

Test Cases

To run the test cases execute the following command mvn test

Test Coverage till date.

Postman Collection

The collection can be accessed here

orange-sky's People

Contributors

sudoraman avatar rameen 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.