The backend is built using Nodejs / Expressjs framework and MongoDB Database
First, make sure Nodejs and npm packages are installed, then inside directory folder:
npm install
npm start
Then, you can send requests on localhost:5000
You do not have to setup MongoDB cluster as it is already running using ATLAS.
We have 3 schemas User, Item, and Basket
Each Item has name, serialNumber, quantity, price, and availability flag. Each Basket has a list of items and related to a specific user.
- Validate basket items availbility
- Validate that total basket price is above 100.
- Check if the user is fraud by ensuring the total price does not exceed 1500 money value.
We used Stripe library to be able to simulate a payment method for the items in the basket.
We used MCV desgin pattern without the view part and the code is asynchronous.