This project provides a RESTful API for e-commerce operations such as product and category listing, cart management, and order processing.
- Category Listing
- Product Listing by Category
- Product Details
- Cart Management (Add, Update, Remove Items)
- Order Placement
- Order History
- Order Details
- User Registration and Login
- Token-based Authentication
- Error Handling and Status Codes
- API Rate Limiting
- Node.js
- Express.js
- MongoDB
- Mongoose
- JSON Web Tokens (JWT) for Authentication
- Bcrypt for Password Hashing
- Express Rate Limiting
- Swagger for API Documentation
You may use the following server link to test the endpoints:
https://e-commerce-api-5fdd.onrender.com
- Node.js and npm: Ensure Node.js and npm are installed on your system.
- MongoDB: Set up a MongoDB database, either locally or on a cloud-based service.
- API Testing Tool: Use Postman or any other API testing tool for testing.
-
Clone the repository:
-
Install dependencies:
npm install
-
Create a '.env file' in the root directory and add the following environment variables:
mongoURL=mongodb+srv://kinjal:Kinjal099@cluster0.pooiylr.mongodb.net/ecommerce-api?retryWrites=true&w=majority PORT=8080 JWT_SECRET=secretkey
-
Start the server:
npm run server
The server will start running at http://localhost:8080.
Refer to the Swagger documentation for detailed information about each endpoint, including request parameters and responses. Swagger documentation for the API can be accessed at:
https://e-commerce-api-5fdd.onrender.com/docs/
or incase of running server on localhost:
Use Postman or any API testing tool to test the various API endpoints.
Please find short video explaining the features, endpoints and usage of swagger documentation at the link mentioned below:-
https://drive.google.com/file/d/1oNGS-d8EkFmiTM8jZwEpzwK1wAxllndw/view?usp=drivesdk