Code Monkey home page Code Monkey logo

ilexcodingchallenge's Introduction

iLexCodingChallenge

Below are the detailed steps to guide you run the application locally

1. Prerequisites

1.1 Make sure Java, Maven and Git are installed in your local enviroment

1.2 Use your existing github account to fork this project

2. Create an empty folder and git clone this project

$ git clone [email protected]:VincentGeng/iLexCodingChallenge.git

3. Run iLexCodingChallenge project

$ cd iLexCodingChallenge
$ mvn spring-boot:run

4. Test API calls

Open another terminal to run below commands

4.1 Add user

> curl -v -X POST localhost:8080/users -H "Content-type:application/json" -d "{\"userName\":\"User 1\"}"

4.2 Add first product

> curl -v -X POST localhost:8080/products -H "Content-type:application/json" -d "{\"productName\":\"iPhone 12\",\"productDescription\":\"Smart Phone\",\"tagNames\":[\"phone\",\"electronic device\"]}"

4.3 Add second product

> curl -v -X POST localhost:8080/products -H "Content-type:application/json" -d "{\"productName\":\"MacBook Air\",\"productDescription\":\"MacBook Air with M1 chip\",\"tagNames\":[\"computer\",\"electronic device\"]}"

4.4 List products

> curl -v localhost:8080/products

4.5 Add order

> curl -v -X POST localhost:8080/orders -H "Content-type:application/json" -d "{\"products\":[{\"productId\":1,\"price\":\"1250.00\"},{\"productId\":2,\"price\":\"1439.00\"}],\"userId\":1}"

4.6 List orders

> curl -X GET "http://localhost:8080/orders?userId=1&fromDate=01/12/2020&toDate=01/01/2021"

5. Run unit test cases (make sure you are still under /iLexCodingChallenge folder)

$ mvn test

ilexcodingchallenge's People

Contributors

vincentgeng avatar

Watchers

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