This Project is Developed as a part of course CS5610. It is Developed by Kaushik Boora, Rahul Reddy Baddam, Sai Sriker Reddy Vootukuri and Abhishek Kumar. This Repository contains the code for the Backend of SARK Product review site.
SARK Product review site is a website where users can lookup for products and rate them, developed using NodeJS, ExpressJS, JWT, MongoDB technologies on the Backend. The site essentially uses a Free Open API service that provides product information. This product Information can be stored on Database. This site assumes there are 3 types of users, Customer, Dealer and Admin. For the Frontend Code of this project Please visit SARK Product Review Site - Frontend
This Project Provides the following RESTful APIs,
API Name | Path | HTTP Verb | Description |
---|---|---|---|
Create User | /api/users | POST | Creates a User by taking in info such as first name, last name, email etc. Example body: { |
Login | /api/login | POST | Logs a user in and sends JWT token back to the user. For authenticated routes this token must be sent in header for authorizaion. Example body:{ |
Unique Email | /api/uniqueEmail | POST | This API checks if a given username is already in the DB. |
Update User Info | /api/updateusers | PUT | This API updates the user information. |
Fetch All Users | /api/all-users | POST | This is an authenticated route, Reqires the id of the user sent in the body. All user info is returned if the user requesting data is an admin. |
Remove a particular user | /api/remove-users | DELETE | This is an authenticated route, Reqires the id of the requesting user sent as id and id of user to be deleted as delid in the body. A user is deleted if the user requesting is an admin. |
Add a review | /api/add-review | POST | This is an authenticated route and requires user id sent in the body |
Add a like | /api/add-like | POST | This is an authenticated route and requires user id sent in the body |
etc.. |
Follow the below steps to run the project
- Clone the Directory.
- Make sure the MongoDB instance is running.
- In a terminal move to the cloned directory. Execute the following command
npm start
. This will start the Backend on port 4300.