Code Monkey home page Code Monkey logo

myretail's Introduction

MyRetail

MyRetail is a Spring Boot API for retrieving product and pricing information. It combines product information from the Redsky product service with pricing information from a MongoDB database.

Up and Running

This project uses Java 11. Java 11 or higher will be needed to compile and run the code. In addition, Docker is used to start up a local version of the Mongo database. A Makefile is provided to make starting the service easier.

First, build the Docker image:

make build

Next, start up the server and database:

make up

Optionally, you can start the database separately:

make services

You can also run the server without Docker:

make run

Documentation

This API uses Swagger to document the routes. It can be accessed after starting the server locally at http://localhost:8080/swagger-ui.html

In addition, design documentation is located in the docs folder

Testing

This project uses Junit 4 to run unit tests. Running make test will execute the test scripts

In addition, testing for the endpoints was done manually using Postman. Automated integration testing can be added in the future. Please note that since the database is running locally, you will need to seed the pricing data (Otherwise it will return a 404).

PUT http://localhost:8080/products/54456119

Body: application/json:

{
    "value": 13.57,
    "currency_code": "USD"
}

Returns 204


GET http://localhost:8080/products/54456119

Returns application/json

{
    "id": 54456119,
    "name": "Creamy Peanut Butter 40oz - Good & Gather™",
    "current_price": {
        "value": 13.57,
        "currency_code": "USD"
    }
}

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.