Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davesimoes/api-ecommerce
Complete API for an e-commerce site, developed with Node.js, Express and MongoDB
https://github.com/davesimoes/api-ecommerce
api e-commerce express-js mongodb nodejs nosql nosql-database portfolio-project
Last synced: about 2 months ago
JSON representation
Complete API for an e-commerce site, developed with Node.js, Express and MongoDB
- Host: GitHub
- URL: https://github.com/davesimoes/api-ecommerce
- Owner: DaveSimoes
- License: mit
- Created: 2024-07-26T14:12:52.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-26T15:04:27.000Z (5 months ago)
- Last Synced: 2024-08-24T02:10:35.935Z (4 months ago)
- Topics: api, e-commerce, express-js, mongodb, nodejs, nosql, nosql-database, portfolio-project
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# E-commerce API
## Description:
This is a complete API for an e-commerce site, developed with Node.js, Express and MongoDB. The API offers essential functionalities for an e-commerce system, including product management, shopping cart, orders and stock management.## Features:
- Modern Technologies: Uses Node.js and Express for fast and efficient server deployment.
- NoSQL Database: Uses MongoDB, providing flexibility and scalability in data storage.
- Modular Structure: Code organized into controllers, models, routes and middleware, facilitating maintenance and scalability.
- RESTful API: Follows REST standards, allowing easy integration with front-ends and other APIs.
- Product Management: Complete CRUD for products, including creation, reading, updating and deletion.
- Shopping Cart: Adding and removing products from the cart, with automatic calculation of the total.
- Orders: Creation of orders from the cart, with status control.
- Error Handling Middleware: Centralized error handling for a consistent and informative response.## Table of Contents
- Installation
- Configuration
- Usage
- API routes
- Products
- Shopping cart
- Orders
- Contribution
- LicenseInstalation:
Clone the repository:
```
git clone https://github.com/DaveSimoes/ecommerce-api.git
```
Browse to the project directory:
```
cd api-ecommerce
```Install the dependencies:
```
npm install
```
Settings
Create an .env file in the root of the project and add the MongoDB database configuration:env
Copiar cรณdigo
MONGO_URI=seu_mongo_uri_aqui
PORT=5000
Uso
Para iniciar o servidor em modo de desenvolvimento, execute:```
npm run dev
```
The server will be started at http://localhost:5000.# API routes
## ๐๏ธ Products
- GET /api/products: Returns all products.
- GET /api/products/:id: Returns a specific product.
- POST /api/products: Creates a new product.
- PUT /api/products/:id: Updates an existing product.
- DELETE /api/products/:id: Deletes a product.## ๐ Shopping cart
- GET /api/cart: Returns the contents of the cart.
- POST /api/cart/add: Adds a product to the cart.
- POST /api/cart/remove: Removes a product from the cart.## ๐ Orders
- POST /api/orders: Creates a new order from the cart.
- GET /api/orders/:id: Returns a specific order.
- GET /api/orders: Returns all orders.
- PUT /api/orders/:id: Updates the status of an order.
## โ Contributions
- Contributions are welcome! Feel free to open an issue or send a pull request.## ๐จ Fork the project.
- Create a new branch (git checkout -b feature/new-feature).
- Commit your changes (git commit -am 'Add new feature').
- Push to the branch (git push origin feature/new-feature).
- Open a Pull Request.
## ๐ชช License
Distributed under the MIT license. See LICENSE for more information.If you like this project, leave a star in the repository! โญ
# โ๏ธ Contact us:
Created by David De Paiva - feel free to contact me!๐ This project was developed with a lot of effort and dedication.
If you found it useful, please consider contributing and helping to keep it updated and improved.
Your contribution is invaluable! ๐