-
Notifications
You must be signed in to change notification settings - Fork 1
Home (Main Page)
malhaq edited this page Nov 8, 2024
·
17 revisions
Welcome to the RentItOut API documentation! This platform facilitates item rentals, making it easy for users to list and manage items for rent, such as tools, vehicles, and electronics. Built with Node.js and MongoDB, the project provides flexible rental durations and pricing models to meet user needs.
- Project Repository: GitHub - malhaq/RentItOut
- Technologies: Node.js, Express, MongoDB (Mongoose)
- Postman: Link
- Node.js
- Express.js
- MongoDB
- Git
- Clone the repository:
git clone https://github.com/malhaq/RentItOut.git cd RentItOut - Install dependencies:
npm install
- Start the server:
nodemon app
With the server running, use these endpoints to interact with the RentItOut platform.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/items |
Fetch all rentable items |
| POST | /api/items |
Add a new item |
| PUT | /api/items/:id |
Update item details |
| DELETE | /api/items/:id |
Remove an item from the database |
| POST | /api/ownersignup |
create new owner in the database |
| POST | /api/rentrsignup |
create new rentr in the database |
| POST | /api/delivsignup |
create new deliv in the database |
| POST | /api/adminsignup |
create an admin in the database |
| POST | /api/ownersignup |
login the owner in the platform |
| POST | /api/rentrsignup |
login the renter in the platform |
| POST | /api/delivsignup |
login the delivy in the platform |
| POST | /api/adminsignup |
login an admin in the platform |
| POST | /api/onrinsu:id |
owner subscription the insurance |
| POST | /api/ouninsu:id |
owner unsubscribes the insurance |
| POST | /api/complain:id |
renter complaint about some item |
| POST | /api/admfeedback |
owner ask owners,renter feedback |
| POST | /api/comment:id |
renters add comment about product |
| POST | /api/question:id |
renters ask owner for item |
| GET | /api/Owners |
admin retrieves all owners |
| GET | /api/renters |
admin retrieves all renters |
| GET | /api/delivery |
admin retrieves all delivery's |
| PUT | /api/insu:id |
admin update insurance details |
| DELETE | /api/insu:id |
admin delete insurance |
| GET | /api/recomd |
recommendation for high rent item |
| POST | /api/recomd:n |
recommendation n high rent item |
| GET | /api/revenues |
retrieving all platform revenues |
| POST | /api/owneremail |
notify the owner by email |
| POST | /api/rentremail |
notify the renter by email |
| POST | /api/forgetpass |
user can create new password |
| POST | /api/otp |
sending otp code to verify email |
| PUT | /api/verify-otp | Verify the email using OTP |
| POST | /api/resend-otp | Resend verification OTP |
| PUT | /api/delivery/:id | Rate the delivery driver by his ID |
| PUT | /api/order/:id | Rate the ordered item by its ID |
| GET | /api/delivery/unassigned | Get all the orders that need delivery but not assigned to any |
| PUT | /api/delivery/:id/assigned/ | Delivery driver assigns an order to himself |
| PUT | /api/delivery/:id/delivered/ | Mark an order as delivered |
| GET | /api/delivery/tobe-delivered/ | Get all driver's undelivered orders |
| GET | /api/delivery/my-orders/ | Get all delivery orders, both delivered and undelivered |
| GET | /api/my-orders/ | Get all orders placed by a specific renter |
| POST | /api/:id/pickup/ | Add or update the pickup location for an item |
| PUT | /api/:id/order-pickup/ | Update the pickup location for an order |
| DELETE | /api/delete/admin/:id | Delete admin account by ID (only by admins) |
| DELETE | /api/delete/renter/:id | Delete renter account by ID (admin or user himself) |
| DELETE | /api/owner/renter/:id | Delete owner account by ID (admin or user himself) |
| DELETE | /api/delivery/renter/:id | Delete delivery account by ID (admin or user himself) |
-
curl http://localhost:3000/api/items
-
curl -X POST -H "Content-Type: application/json" -d '{ "name": "Electric Drill", "category": "Tools", "price": 5.0, "duration": "Hourly" }' http://localhost:3000/api/items
-
curl -X PUT -H "Content-Type: application/json" -d '{ "price": 6.0 }' http://localhost:3000/api/items/{itemId}
-
curl -X DELETE http://localhost:3000/api/items/{itemId} - Replace {itemId} with the actual ID of the item you want to delete.
This code provides example requests with brief explanations, helping users understand how to interact with each endpoint
-
curl -X POST -H "Content-Type: application/json" -d '{ "userName":"jaber Mohammad", "age":"21", "email": "jab@gmail.com", "address":"Nablus - Plastain", "phoneNumber":"0595050784", "gender":"Male", "password": "85269741" }' localhost:3000/auth/ownerSignUp
-
curl localhost:3000/admin/allInsurance
-
curl -X PUT -H "Content-Type: application/json" -d '{ "price": 100 }' localhost:3000/admin/updateInsurance/{insuranceId}
-
curl -X DELETE localhost:3000/AQ/deleteComment{commentID} -
curl -X localhost:3000/feedback/ask/owners
Current Features
- Create, view, update, and delete rental listings
- Flexible rental durations and pricing models
- RESTful API for managing rentable items
- Email verification with OTP, verify,resend and generate
- JWT verification with each API call
- Logistics Management, suggesting pickup location based on the current location , map integration
- create, view, update, and delete users
- logging users into renter platform
- managing forget password procccess
- create, update, view, and delete insurances
- create and delete a comment posted to owner about a certain item
- requesting the renter and owners to write feedbacks
- showing the items with high rentals as recommendations
- create, and retrieve the platform revenues
External API
- FOURSQUARE maps API utilized to help with the logistics and delivery
Planned Enhancements
- User authentication and authorization
- Rental history tracking
- Advanced filtering options
To contribute to RentItOut, please:
- Fork the repository and create a new branch for your feature.
- Make your changes, then test thoroughly.
- Submit a pull request for review.
- Follow consistent code styling and commenting.
- Document your contributions.