Git Product home page Git Product logo

martajopp / myretail Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.28 MB

myRetail is a rapidly growing company with HQ in Richmond, VA and over 200 stores across the east coast. myRetail wants to make its internal data available to any number of client devices, from myRetail.com to native mobile apps. This is an end-to- end Proof-of- Concept for a products API, which will aggregate product data from multiple sources and return it as JSON to the caller.

Home Page: https://morning-oasis-48913.herokuapp.com/#/

HTML 27.42% JavaScript 63.07% CSS 9.51%

myretail's Introduction

myRetail RESTful Service

myRetail is a rapidly growing company with HQ in Richmond, VA and over 200 stores across the east coast. myRetail wants to make its internal data available to any number of client devices, from myRetail.com to native mobile apps.

The goal for this exercise is to create an end-to- end Proof-of- Concept for a products API, which will aggregate product data from multiple sources and return it as JSON to the caller.

Your goal is to create a RESTful service that can retrieve product and price details by ID. The URL structure is up to you to define, but try to follow some sort of logical convention.

Click here for a live demonstration of this application

Built With

  • MongoDB
  • Express
  • AngularJS
  • Node.js
  • axios
  • Chai and Chai-HTTP for testing
  • AngularJS Material for styling
  • APIDOC for API Documentation

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Node.js
  • Mongo
  • Start Mongo and make sure it is up and running.

Installing

Steps to get the development environment running.

  1. Download this project.
  2. npm install
  3. npm start
  4. Insert following test cases into MongoDB:
    {
    "_id" : ObjectId("5a866b825079c35e229105b1"),
    "product_id" : 16696652,
    "current_price" : {
        "currency_code" : "USD",
        "value" : 113.99
    }
}
{
    "_id" : ObjectId("5a8674d25079c35e22910836"),
    "product_id" : 13860428,
    "current_price" : {
        "currency_code" : "USD",
        "value" : 13.99
    }
}

Documentation and Testing

Tests are located in server/tests/server.test.js.

Test can be run by executing npm test.

API documentation is located at localhost:5000/apidoc or on the live demo /apidoc - click here.

Screen Shot

Product Found, Update: Product Found, Update 404 - Product Does Not Exist: Product Not Found API Documentation Example - (API docs can be found at /apidoc): API Documentation Example - API docs can be found at localhost or on the live demo /apidoc

Completed Features

High level list of items completed.

  • Responds to an HTTP GET request at /products/{id} and delivers product data as JSON (where {id} will be a number.
  • Performs an HTTP GET to retrieve the product name from an external API. (For this exercise the data will come from redsky.target.com, but let’s just pretend this is an internal resource hosted by myRetail)
  • Reads pricing information from a NoSQL data store and combines it with the product id and name from the HTTP request into a single response.
  • Accepts an HTTP PUT request at the same path (/products/{id}), containing a JSON request body similar to the GET response, and updates the product’s price in the data store.

Author

  • Marta Jopp

myretail's People

Contributors

martajopp avatar

Watchers

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