A RESTful API used by the Kiwu eCommerce Platform
- Server : NodeJS, ExpressJS
- DataBase : MongoDB Atlas, Mongoose ODM
- Clone the repo
git clone https://github.com/theskinnycoder/kiwu-backend.git
- Go to the project directory
cd kiwu-backend
- Install dependencies
npm i
-
Add the environment variables to
.env
(Take a look at the.env.example
) -
Start the server
npm start
To run this project, you will need to add the following environment variables to your .env
file
PORT
MONGO_URI
COOKIE_NAME
JWT_SECRET
- POST
/api/auth/register
: To register a new user - POST
/api/auth/login
: To login an existing user
- GET
/api/designers
: To get all designers - GET
/api/designers/:id
: To get a designer by ID
- GET
/api/products
: To get all products - GET
/api/products?categories=:categories
: To get all products that matches a list of categories - GET
/api/products?designer=:designer
: To get all products that belongs to a designer - GET
/api/products/:id
: To get a product by ID
- GET
/api/categories
: To get all categories - GET
/api/categories/:id
: To get a category by ID
- POST
/api/auth/logout
: To logout the current logged-in user
- GET
/api/me
: To get the profile of the current logged-in user - PUT
/api/me
: To update the profile of the current logged-in user - DELETE
/api/me
: To delete the profile of the current logged-in user
- GET
/api/orders/me
: To get all the un-delivered orders the current logged-in user - GET
/api/orders/me/:id
: To get an un-delivered order of the current logged-in user by ID - POST
/api/orders/me
: To create a new order by the current logged-in user - PATCH
/api/orders/me/:id
: To mark an UnPaid order as paid after paying
- POST
/api/products
: To post a new product from the current logged-in designer's account - PUT
/api/products
: To update an existing product from the current logged-in designer's account - DELETE
/api/products
: To delete an existing product from the current logged-in designer's account
- GET
/api/products/pending
: To get a list of pending products to either approve or decline - GET
/api/products/pending/:id
: To get a pending products by ID to either approve or decline - POST
/api/products/pending/:id/approve
: To approve a pending product by ID - POST
/api/products/pending/:id/decline
: To decline a pending product by ID
- POST
/api/designers
: To make a designer by email (req.body.email) - PATCH
/api/designers
: To remove a designer by email (req.body.email) - PATCH
/api/designers/:id
: To remove a designer by ID (req.params.id) - PUT
/api/designers/:id
: To update a designer details by ID - DELETE
/api/designers/:id
: To delete a designer's account by ID (as a User too, not just designer access)
- POST
/api/categories
: To create a new category
- GET
/api/orders
: To get all un-delivered pending orders by all customers - GET
/api/orders/:id
: To get an un-delivered order by ID - PATCH
/api/orders/:id/deliver
: To mark an un-delivered order as delivered after delivery
For support, email rahulsriramwriter@gmail.com