Welcome to the E-Commerce Project! This repository hosts a comprehensive backend system for an e-commerce application. It leverages modern technologies to create a robust, scalable solution for online shopping.
- User authentication and authorization
- Product management (CRUD operations)
- Shopping cart functionality
- Order processing
- RESTful API for frontend integration
- Secure payment processing
- Admin dashboard for managing products and orders
This project utilizes the following technologies:
- Node.js: JavaScript runtime for server-side development
- Express.js: Web framework for building APIs
- MongoDB: NoSQL database for data storage
- Mongoose: ODM for MongoDB, simplifying data modeling
- Postman: Tool for testing APIs
- REST API: Architecture for building web services
To set up this project on your local machine, follow these steps:
-
Clone the repository:
git clone https://github.com/Gun2RucK/E-Commerce-Project.git
-
Navigate to the project directory:
cd E-Commerce-Project -
Install the dependencies:
npm install
-
Create a
.envfile in the root directory and add your environment variables:MONGO_URI=your_mongodb_uri JWT_SECRET=your_jwt_secret -
Start the server:
npm start
You can now access the application locally.
Once the server is running, you can interact with the API using Postman or any API client. The base URL for the API is http://localhost:5000/api.
- User Registration:
POST /api/users/register - User Login:
POST /api/users/login - Get Products:
GET /api/products - Create Order:
POST /api/orders
For detailed API usage, refer to the API Documentation.
The API is designed to be simple and easy to use. Each endpoint supports standard HTTP methods. Below are some details about the main endpoints:
-
Register User:
- Endpoint:
/api/users/register - Method:
POST - Request Body:
{ "name": "John Doe", "email": "[email protected]", "password": "yourpassword" }
- Endpoint:
-
Login User:
- Endpoint:
/api/users/login - Method:
POST - Request Body:
{ "email": "[email protected]", "password": "yourpassword" }
- Endpoint:
-
Get All Products:
- Endpoint:
/api/products - Method:
GET
- Endpoint:
-
Create Product:
- Endpoint:
/api/products - Method:
POST - Request Body:
{ "name": "Product Name", "price": 29.99, "description": "Product Description", "image": "image_url" }
- Endpoint:
- Create Order:
- Endpoint:
/api/orders - Method:
POST - Request Body:
{ "userId": "user_id", "products": [ { "productId": "product_id", "quantity": 2 } ] }
- Endpoint:
For more detailed documentation, please refer to the Releases section to download the latest version and check for updates.
We welcome contributions to improve this project. To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes.
- Submit a pull request.
Please ensure your code adheres to the existing style and includes appropriate tests.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or feedback, feel free to reach out:
- Email: [email protected]
- GitHub: Gun2RucK
Thank you for checking out the E-Commerce Project! For the latest releases, please visit the Releases section.