ECOMAPI is an e-commerce platform API developed using Node.js and MongoDB. This project aims to provide the necessary API to manage products, users, orders, and payment operations for an e-commerce site.
- User registration and login (JWT-based authentication)
- Add, update, and delete products
- Cart and order management
- Payment processing
- Product search and filtering
- Node.js: Used for server-side JavaScript execution.
- Express.js: A Node.js framework used for building the API.
- MongoDB: NoSQL database for data management.
- Mongoose: Used for interacting with MongoDB.
- JWT (JSON Web Token): Ensures secure user authentication.
-
Clone this repository:
git clone https://github.com/Cerennly/ECOMAPI.git
-
Navigate to the project directory:
cd ECOMAPI -
Install the required dependencies:
npm install
-
Start MongoDB and configure the
.envfile (e.g., database URI, JWT secret):MONGO_URI=mongodb://localhost:27017/ecomapi JWT_SECRET=your_secret_key -
Start the server:
npm start
The API will be running on
http://localhost:5000by default.
- POST
/api/users/register– Register a new user - POST
/api/users/login– User login (returns JWT token)
- GET
/api/products– Retrieve all products - POST
/api/products– Add a new product - PUT
/api/products/:id– Update a specified product - DELETE
/api/products/:id– Delete a specified product
- POST
/api/orders– Create a new order - GET
/api/orders– Retrieve user orders
- Ceren - Project developer
This project is licensed under the MIT License.