This project serves as the backend for Eymen's Fruit Shop, providing APIs to manage transactions.
- GET
/transactions
: Retrieve all transactions. - GET
/transactions/:arrayIndex
: Retrieve a specific transaction by index. - POST
/transactions
: Add a new transaction. - DELETE
/transactions/:indexArray
: Delete a transaction by index. - PUT
/transactions/:arrayIndex
: Update a transaction by index.
- Node.js
- Express.js
- nanoid (for generating unique IDs)
- dotenv (for environment variables)
- cors (for enabling CORS)
-
Clone the repository:
git clone <https://github.com/kbodur/eymen-fruit-shops-budget-app--backend.git> cd eymen-fruit-shops-budget-app--backend
npm install
PORT=4001
Returns an array of all transactions.
Returns the transaction at the specified arrayIndex
.
Adds a new transaction to the array. Requires a JSON body with item_name
, amount
, date
, from
, and category
.
Deletes the transaction at indexArray
.
Updates the transaction at arrayIndex
with new data. Requires a JSON body with item_name
, amount
, date
, from
, and category
.
Feel free to contribute to this project by opening issues or pull requests. Your feedback is much appreciated!
renderLiveUrl[https://eymen-fruit-shops-budget-app-backend2.onrender.com/]