0% found this document useful (0 votes)
54 views3 pages

Backend Assignment

The document outlines requirements for building an e-commerce API with Node.js. It includes details on expected API endpoints for categories, products, carts, orders, authentication, and documentation. It also specifies using a SQL database like Postgres and implementing JWT authentication, error handling, and documentation.

Uploaded by

Mohammad Ikhlas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views3 pages

Backend Assignment

The document outlines requirements for building an e-commerce API with Node.js. It includes details on expected API endpoints for categories, products, carts, orders, authentication, and documentation. It also specifies using a SQL database like Postgres and implementing JWT authentication, error handling, and documentation.

Uploaded by

Mohammad Ikhlas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

2/20/24, 3:38 PM

Assignment

Assignment
Feel free to push the code to your GitHub and submit the link to
[email protected] even if it is incomplete. We just want to evaluate your
problem-solving approach. Also, you can add your creative touch wherever you wish to

Table of contents

GOAL-

BACKEND ASSIGNMENT: "E-commerce API with Node js”.

Requirements:
Your backend assignment should be callable from any rest client eg. Postman

BACKEND ASSIGNMENT: “Ecommerce API with Node js”

Build an API set to support e-commerce operations, such as product and category
listing, product details, cart management, and order processing. Use any SQL
database to manage product/category data, user cart information, and order details.
The API should also handle token management in the system

Requirements:
API Endpoints:
● Category Listing: Create an API endpoint that retrieves a list of categories.
● Product Listing: Create an API endpoint that retrieves a list of products with
essential details such as title, price, description, and availability, based on
category Id
● Product Details: Implement an endpoint that fetches the detailed information of
a specific product by its ID.
● Cart Management: Develop API endpoints to allow users to add products to
their cart, view the cart, update quantities, and remove items from the cart.
● Order Placement: Create an endpoint to handle order placement, allowing users
to place an order with products from their cart.
● Order History: Implement an endpoint to fetch the order history for
authenticated users.
● Order Details: Create an endpoint that retrieves the detailed information of a
specific order by its ID.
● A set of APIs to register and login the users

NOTE: Ignore any payment-related APIs for simplicity. We will assume that payment
is not needed for orders

Database Integration:
​ Use any SQL database preferably Postgres. The API should interact with DB to
perform CRUD operations on products, cart items, and orders.

User Authentication:
● Implement user authentication using JSON Web Tokens (JWT). Users should be
able to register, log in, and obtain a token to authenticate API requests.
● Implement authentication middleware to secure sensitive API endpoints, such as
cart management and order placement. Only authenticated users should be
allowed to access these endpoints.

Error Handling:
Ensure appropriate error handling is in place, and the API returns meaningful error
messages and status codes when necessary.
Documentation:
Create documentation for the API endpoints, including details about their functionality,
expected input, and output. A swagger doc is preferred
Rate limiting (optional): Add API rate limiting to prevent abuse and maintain server
stability.

Please push the code on your GitHub broken down into commits along with a readMe
file showing a brief on how to set up the project, API doc, and any important design
decisions you made during development.

You might also like