Ecommerce Rest Api is a rest api made with Express & MongoDB.
This project deployed to the heroku and this is the heroku url.
http://mongo-express-rest-api.herokuapp.com/
This project has this technologies:
- Nodejs
- Expressjs
- MongoDB
- JsonWebToken
- Mongoose
This project need these enviroment variables :
- MONGO_URL : Need to be for mongodb connection
- JWT_SECRET : Need to be for access token creation
These are the endpoints we're using (will be added on new endpoints) :
Users Endpoints :
-/api/users/ : Getting the user information. (Needs authorization, get request)
-/api/users/orders : Getting the user orders.(Needs authorization, get request)
-/api/users/order/:id : Getting the user order detail by id. (Needs authorization, get request)
-/api/users/order/delete/:id : Deleting the user order by id. (Needs authorization, delete request)
-/api/users/favorites : Getting the user favorites products. (Needs authorization, get request)
-/api/users/add/favorite/:id : Adding product by id to the user favorites. (Needs authorization, put request)
-/api/users/delete/favorite/:id : Deleting product by id to the user favorites. (Needs authorization, delete request)
Product Endpoints :
-/api/product/all : Getting all products. (Get request)
-/api/product/:id : Getting product information by id. (Get request)
-/api/product/create : Creating new product. (Needs admin authorization, Get request)
-/api/product/delete/:id : Deleting product by id. (Needs admin authorization, Delete request)
-/api/product/update/:id : Updating product by id. (Needs admin authorization, Put request)
-/api/search : Searching products by name. (Get request)
Category Endpoints :
-/api/category/all : Getting all categories. (Get request)
-/api/category/:id : Getting category by id. (Get request)
-/api/category/create : Creating a new category. (Needs admin authorization, Post request)
-/api/category/update/:id : Updating category by id. (Needs admin authorization, Put request)
-/api/category/delete/:id : Deleting category by id. (Needs admin authorization, Delete request)
Auth(User auth) Endpoints :
-/api/auth/register : Register a new user. (Post request)
-/api/auth/login : Login user. (Post request)
Admin Endpoints :
-/api/admin/register : Register a new admin. (Post request)
-/api/admin/login : Login admin. (Post request)
This project is released under the MIT License