Crio Portfolio

Back

QKart Backend

A scalable Node.js backend for an E-commerce application

QKart is an E-commerce application offering a variety of products for customers to choose from.

During the course of this Micro-Experience, the developer:

  • Built the complete set of REST APIs for an E-commerce application following the best practices

  • Followed a layered approach for easy maintenance

  • Used MongoDB NoSQL database for data storage

  • Implemented multiple authentication schemes

  • Wrote unit and integration tests to test the implementation

image alt text

QKart Layered Architecture

QKart Backend Modules

1

Set up application and implement the first API

Scope of work:

  1. Implemented GET /v1/users API endpoint to send user data to clients

  2. Followed a layered approach to implement the request-response cycle for ease of maintenance

  3. Used Mongoose (Node.js-MongoDB ODM) to fetch user data from MongoDB

  4. Defined JOI schema to easily validate client requests

  5. Utilized middlewares to reduce code duplication

Skills used:

Node.js, Express.js, MongoDB, Mongoose ODM, JOI validation

Image(s):

image alt text

Request-response cycle in QKart (Endpoint: /v1/users)
2

Secure API endpoints and implement register/login APIs

Scope of work:

  1. Implemented logic to generate short-lived JWT tokens

  2. Set token authentication strategy by using the Passport library

  3. Secured GET /v1/users endpoint using token authentication

  4. Created POST APIs for user registration and login

  5. Implemented password authentication to facilitate register / login flow

Skills used:

REST APIs, Token authentication, JWT Token, Password authentication, Hashing

Image(s):

image alt text

JWT Token authentication flow for QKart APIs
3

Implement APIs related to shopping cart

Scope of work:

  1. Implemented the GET/POST/PUT API endpoints for a user’s shopping cart

  2. Improved the GET /v1/users endpoint by supporting filtering for user address via query parameters

Skills used:

REST APIs, Filtered API Queries

4

Complete the checkout logic using TDD

Scope of work:

  1. Added Jest-based assertions to unit tests for checkout requirements provided

  2. Implemented the checkout logic in a Test-driven development style

  3. Utilized integration tests to find and resolve bugs on integrating checkout logic to the application

Skills used:

Test-driven development, Unit testing, Integration testing, Jest framework

5

Deploy the QKart backend server

Scope of work:

  1. Created a MongoDB instance on MongoDB Atlas cloud and uploaded products data to the cloud DB.

  2. Deployed the QKart Node.js app to Heroku

  3. Deployed the QKart React frontend to Netlify after configuring it to use the deployed Node.js backend.

Skills used:

MongoDB Atlas, Deployment, Heroku, Netlify