E-commerce backend API for Triveous, covering user authentication, product management, cart, and order processing.
Triveous is a dynamic and innovative tech company known for its cutting-edge solutions and commitment to excellence in software development. They are dedicated to pushing the boundaries of technology to deliver impactful solutions to their clients.
- User registration and JWT authentication for login.
- Product management, including the ability to add, retrieve, and search products by category.
- Cart management, allowing users to add, remove, and update product quantities in their cart.
- Order processing for placing orders and accessing order history.
- Node.js: A JavaScript runtime for server-side development.
- Express.js: A web application framework for Node.js.
- MongoDB: A NoSQL database for storing data.
- JWT: JSON Web Tokens for authentication.
- Swagger: API documentation tool.
- Other Dependencies: Various Node.js libraries and modules.
-
Clone the repository:
git clone https://github.com/love-porwal/Triveous_Ecommerce_API.git
-
Navigate to the project directory:
cd Triveous_Ecommerce_API npm init -y
-
Install dependencies:
npm install express mongoose bcrypt jsonwebtoken swagger-jsdoc swagger-ui-express nodemon
-
Application Start
node index.js
To use protected routes, you must authenticate by obtaining a JWT token. Use the /users/login route to log in and get the token.
User Registration: POST /users/register
User Login: POST /users/login
Add a Product: POST /products/addproduct
Get Product Categories: GET /products/category
Get Products: GET /products/products
Get Product by ID: GET /products/products/{id}
Add to Cart: POST /cart/addtocart/{productId}
Remove from Cart: DELETE /cart/removetocart/{productId}
Get Cart Contents: GET /cart/allcart
Increase Product Quantity in Cart: POST /cart/increment/{productId}
Decrease Product Quantity in Cart: POST /cart/decrement/{productId}
Place an Order: POST /orders/order-place
Get Order Details: GET /orders/order-details
Get Order by ID: GET /orders/order/{orderId}