Code Monkey home page Code Monkey logo

commerceiq-assignment's Introduction

CommerceIQ: SDE-1: Home Assignment

How to run -

  npm install
  npm start

Problem Statement:

  • Build a REST based JSON mock server to easily add, update, delete and access data from a JSON file.

    • Every data set should have a parent identifier (entity type), which will be used in the GET APIs.

    • Every data set should have an ID (Primary key)

    • ID should be immutable, error needs to be thrown if ID is tried to be mutated.

    • If you make POST, PUT, PATCH or DELETE requests, changes have to be automatically saved to store.json.

    • The store.json file should support multiple entity types.

      Schema_Look

  • Sample APIs to be supported by the mock server on store.json file:

    • GET /posts
    • GET /posts/0
    • POST /posts
    • PUT /authors/1
    • PATCH /posts/1
    • DELETE /posts/1
  • Enable filtering at entity level :

    • GET /posts?title=title1&author=CIQ
  • Enable sorting at entity level :

    • GET /posts?_sort=views&_order=asc
  • Enable basic search at entity level:

    • GET /posts?q=IQ
  • Support for nested structures will yield a bonus point.

  • Treat store.json as an empty slate where you can add and retrieve any data.


Solution:

  • Language Used - JavaScript (NodeJS)

Implemented all the below features according to problem statement and code hosted on GitHub along with CI-CD pipeline (GitHub Actions) and APIs hosted on AWS EC2 instance for user consumption.

Features:-

  • Every data set should have a parent identifier (entity type), which will be used in the GET APIs.

  • Every data set should have an ID (Primary key)

  • ID should be immutable, error needs to be thrown if ID is tried to be mutated.

  • If you make POST, PUT, PATCH or DELETE requests, changes have to be automatically saved to store.json.

  • The store.json file should support multiple entity types.

  • Sample APIs to be supported by the mock server on store.json file:

    GET /posts
    GET /posts/0
    POST /posts
    PUT /authors/1
    PATCH /posts/1
    DELETE /posts/1
  • Enable filtering at entity level :

    • GET /posts?title=title1&author=CIQ
  • Enable sorting at entity level :

    • GET /posts?_sort=views&_order=asc
  • Enable basic search at entity level:

    • GET /posts?q=IQ
  • Support for nested structures will yield a bonus point.

  • Treat store.json as an empty slate where you can add and retrieve any data.

commerceiq-assignment's People

Contributors

gittysachin avatar

Watchers

 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.