API Products

This is a simple RESTful API for managing products and managing a cart, built with Node.js and Firebase.

Technologies

  • Node.js
  • Express
  • Firebase Realtime Database

Endpoints

GET /products

Get all products.

GET /products/:id

Get a single product by ID.

POST /products

Create a new product.

PUT /products/:id

Update a product by ID.

DELETE /products/:id

Delete a product by ID.


GET /cart

Get all cart.

POST /cart

Add a product to the cart.

PUT /cart/:id

Update a product from cart.

DELETE /cart/:id

Delete a product from cart.



Installation

To run this API on your local machine, you'll need to have Node.js and Firebase tools installed.


Clone the repository:

git clone https://github.com/isadoragalvaoss/api-products.git

Install dependencies:

cd api-products
yarn

Credentials:

Add your Firebase service account credentials to FIREBASE_CONFIG and FIREBASE_PROJECT_ID in the file .env root directory of the project.


Start the server

yarn start


Contributing

Contributions are welcome! If you find a bug or want to add a new feature, please open an issue or submit a pull request.