README
This commit is contained in:
parent
f2d27d14fe
commit
28ccd1fe64
1 changed files with 68 additions and 0 deletions
68
README.md
68
README.md
|
@ -6,6 +6,18 @@ This repository contains the backend implementation for the Ecomm e-commerce app
|
||||||
|
|
||||||
This is a simple e-commerce backend application built with Node.js, TypeScript, Express.js, MongoDB, and Docker. It provides API endpoints to manage users, products and cart of user.
|
This is a simple e-commerce backend application built with Node.js, TypeScript, Express.js, MongoDB, and Docker. It provides API endpoints to manage users, products and cart of user.
|
||||||
|
|
||||||
|
## My Approach
|
||||||
|
|
||||||
|
Creating a simple Express.js application with TypeScript.
|
||||||
|
added the required dependencies and dev dependencies.
|
||||||
|
added best ORM to connect with MongoDB and Node.js.
|
||||||
|
created the required models and controllers for the application.
|
||||||
|
added the required routes for the application.
|
||||||
|
added the required environment variables for the application.
|
||||||
|
added the required middleware for the application.
|
||||||
|
added the required error handling for the application.
|
||||||
|
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
- [Technologies Used]
|
- [Technologies Used]
|
||||||
|
@ -131,6 +143,7 @@ status code 404
|
||||||
````
|
````
|
||||||
|
|
||||||
# Cart
|
# Cart
|
||||||
|
|
||||||
Add Product to Cart - POST /cart
|
Add Product to Cart - POST /cart
|
||||||
Adds a product to cart.
|
Adds a product to cart.
|
||||||
(authentication required)
|
(authentication required)
|
||||||
|
@ -150,4 +163,59 @@ status code 200
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
status code 500
|
||||||
|
```
|
||||||
|
{
|
||||||
|
message:
|
||||||
|
"An error occurred while adding the product to the cart."
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
List Cart Items - GET /cart
|
||||||
|
Lists all cart items.
|
||||||
|
(authentication required)
|
||||||
|
|
||||||
|
Response Body
|
||||||
|
status code 200
|
||||||
|
```
|
||||||
|
{
|
||||||
|
Cart :{
|
||||||
|
"{ProductId}": Quantity
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
status 404
|
||||||
|
```
|
||||||
|
{
|
||||||
|
message:
|
||||||
|
"Cart not found."
|
||||||
|
}
|
||||||
|
```
|
||||||
|
status code 500
|
||||||
|
```
|
||||||
|
{
|
||||||
|
message:
|
||||||
|
"An error occurred while listing the cart."
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
checkout - POST /cart/checkout
|
||||||
|
checkout the cart.
|
||||||
|
(authentication required)
|
||||||
|
|
||||||
|
status 200
|
||||||
|
```
|
||||||
|
{
|
||||||
|
order: {
|
||||||
|
{productId}: quantity
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
status 404
|
||||||
|
```
|
||||||
|
{
|
||||||
|
message:
|
||||||
|
"Cart not found."
|
||||||
|
}
|
||||||
|
```
|
Loading…
Reference in a new issue