Tuesday, March 22, 2016

Shopping Cart Microservice app with Node.js - Part 1


I have been reading around about Node.js and playing with some test programs here and there. I finally decided to build a proper service that uses Node.js to fully showcase the capabilities of the platform. After thinking for sometime about what to build, I landed on the idea of a Shopping Cart microservice.

Following are the planned features as of now:
  • Add Item
  • Remove Item
  • Update Item
  • Save Cart (for retrieval later)
  • Update Cart
  • Empty Cart (remove everything for the cart)
My setup:
  • Node.js
  • WebStorm IDE 
  • Express JS
  • Bootstrap
  • LokiJS (for in-memory db/persistence) 
  • Mocha (for testing)
This renders a nice screen with the words Express JS; setup is done so I guess 90% of the battle is fought :) I was delighted at how straight word the setup was.

Reason I chose a microservice implementation is so that it can be plugged into other programs and depending on deployment can scale up and down based on usage without impacting the overall application deployment or maintenance. To achieve this I plan to incorporate RESTful webservices into the app. Persistence will be handled by LokiJS which supports in-memory as well as persistence. I might change the db, but for now I am keeping this.

All the code will be available on Github as I continue with my implementation. More posts will be forth coming as I continue with the app.

1 comment:

  1. Your style is so unique compared to other people I have read stuff from. Many thanks forposting when you have the opportunity, Guess I will just bookmark this site WebStorm

    ReplyDelete