GithubHelp home page GithubHelp logo

esa-assign2's Introduction

Esa-Assign2

The project basically is creating a simple online shopping cart platform int the form of microservices linked via apis made in Node.Js. The major roles are the products available and the user interacting with the microservices.

This project has two microservices. The first microservice interacts with the user (assuming they have logged in and are valid users). The second microservice interacts with the people running the e-commerce site. They can add/update inventory as per the available stock.

Getting Started

Download/fork+clone the folder esa-assign2. It will have 2 folders(product api and user api) and two python scripts.

Basic api structure

DATABASES:

  1. User
  2. Products
  3. Cart

API FOLDERS:

  1. controllers
  2. routes
  3. models

server.js files to set up and run the server

~esa-assign2>tree --filelimit 6
..
├── README.md
├── product api
│   ├── api
│   │   ├── controllers
│   │   │   └── productController.js
│   │   ├── model
│   │   │   └── productModel.js
│   │   └── routes
│   │       └── productRoutes.js
│   ├── node_modules [149 entries exceeds filelimit, not opening dir]
│   ├── package-lock.json
│   ├── package.json
│   └── server.js
├── productMicroservice.py
├── user api
│   ├── api
│   │   ├── controllers
│   │   │   ├── cartController.js
│   │   │   ├── productController.js
│   │   │   └── userController.js
│   │   ├── model
│   │   │   ├── cartModel.js
│   │   │   ├── productModel.js
│   │   │   └── userModel.js
│   │   └── routes
│   │       ├── cartRoutes.js
│   │       ├── productRoutes.js
│   │       └── userRoutes.js
│   ├── node_modules [214 entries exceeds filelimit, not opening dir]
│   ├── package-lock.json
│   ├── package.json
│   └── server.js
└── userMicroservice.py


6 directories, 13 files

Setting up

The node js code is designed to run in integration with a mongodb atlas server. Please head to the server.js file and add a connection string to connect to a mongo database.

Installing

A step by step series of examples that tell you how to get the server and client running

Running the server

~esa-assign2/user api>npm start

Output :

> [email protected] start ~\esa-assign2\user api
> nodemon server.js

[nodemon] 2.0.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node server.js`
shopping cart RESTful API server started on: 4000

new term:

~esa-assign2/product api>npm start

OUPUT:

> [email protected] start ~esa-assign2\product api
> nodemon server.js

[nodemon] 2.0.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node server.js`
Product RESTful API server started on: 3000

Running the userMicroservice code -essentially acts as a client to the api

new term:

~esa-assign2/>python userMicroservice.py

Running the productMicroservice code -essentially acts as a store attendent to the api

new term:

~esa-assign2/>python productMicroservice.py

Note: the microservice.py files have their own instructions within the code.

Running the tests

The userMicroservice python script has a set of functions created and can be called by the user to view/add/ remove data at any instant. Modify the script to create flow of data and test the microservice.

The productMicroservice python script (has no code yet but can me made using the requests module in python OR we can use apps such as postman to make restful requests) is used to add/update inventory.

The python scripts are well documented with each function and their use.

Built With

Authors

  • Rohan Russel Nedungadi - Initial work

See also the list of contributors who participated in this project.

Acknowledgments

  • Proff Raghu Kishore Neeliseti

esa-assign2's People

Contributors

munkeops avatar

Watchers

 avatar

Forkers

makflakes

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.