Rent A Car Quickstart Tutorial - Pioneer18/Rent-A-Car GitHub Wiki
NOTE: If gifs or images are not loading, please refresh the page
Rent-a-car is a demonstrative peer-to-peer car rental application. The app is designed to enable users to travel to a new city and easily locate a convenient rental car near their location, or to list their own vehicle for rental. Like other similar car rental applications, Rent-A-Car users may list rental vehicles at their home or near a well traveled public location; e.g. near a Train Station. Users may also manage their profiles, upload images for their rentals, edit rental details, and more. This application was built with the NestJS webframework.
To quickly get started with a tour of the application, please follow this guide, or read it on the Rent-A-Car Wiki.
The first step to using the Rent-A-Car API is to login to the application. You may use one of the premade accounts available in the request body, or create a new account to begin.
To create a new account use the User Module - Create User request. Once you have created or selected an account, open the Auth Module and select the Login request to enter your selected account credentials. A successful login request will return the created profile data in the response as seen below.
Now that you are logged in, create a new rental listing at your home address or any address of your choice. You may use the example rental JSON object already in the request, one of the rental examples from here, or rewrite the rental data yourself.
A successful request will return the rental you just sent and a '201 Created' response, as seen below. Notice that the returned rental has an _id property now, this is its unique id in the remote MongoDB database.
To upload images to the new rental you've just created, select the List Your Rentals request to find your rental's _id. Copy the _id of the rental you would like to upload images to, and paste it into the Upload Rental Images's rentalId param, as seen below. Then, in the body tab of the Upload Rental Images request, select the images you wish to upload from your computer's local file system.
The images are stored in a public AWS S3 Bucket in a directory with your account email, the link returned in the response is the download link for the Bucket. In the two images below you can see the download link, and a screenshot of the bucket where the images are stored.
Because Rent-A-Car is demonstrative and does not have a real user base actively listing rentals, please reference the below table to simulate searching for rentals in a city. There are a total of 15 rentals listed in 3 different Florida cities; Tampa, Orlando, and Riverview. Search with one of the addresses to find that rental and any others in a 2, 4, 6, or 8 mile radius. The addresses were generated with an online random address generator.
City | User | Vehicle | Address | _id | Max Duration | Min Duration | Required Notice |
---|---|---|---|---|---|---|---|
Tampa | [email protected] | 1980 Volkswagen Rabbit | 1103 E Lambright St Tampa 33604 | 5fe018f2975b32000e391509 | 6 | 4 | 4 |
Tampa | [email protected] | 2020 Subaru Outback | 2512 E Stanley Matthew Cir Tampa 33604 | 5fe01a64975b32000e39150a | 6 | 4 | 4 |
Tampa | [email protected] | Rezvani Tank X | 5807 Osceola Pl Tampa 33604 | 5fe01d94975b32000e39150c | 6 | 2 | 2 |
Tampa | [email protected] | Rexvani Hercules 6x6 | 5801 N 9th St Tampa 33604 | 5fe02065975b32000e39150d | 6 | 2 | 2 |
Tampa | [email protected] | 2020 Harley Street Rod | 8203 N Mulberry St Tampa 33604 | 5fe140fb85f8fe000e59c806 | 6 | 4 | 5 |
Riverview | [email protected] | Tesla Model 3 | 10417 Avelar Ridge Dr Riverview 33578 | 5fe001c28d3a5b000e7ab5e3 | 5 | 1 | 2 |
Riverview | [email protected] | Cybertruck SM | 10262 Post Harvest Dr Riverview 33578 | 5fe003b18d3a5b000e7ab5e4 | 5 | 1 | 2 |
Riverview | [email protected] | 2017 Toyota Prius | 7022 Blue Beech Dr Riverview 33578 | 5fe01441975b32000e391506 | 6 | 1 | 1 |
Riverview | [email protected] | 2002 Dodge Grand Caravan | 8203 N Mulberry St Tampa 33604 | 5fe016b1975b32000e391507 | 6 | 1 | 1 |
Riverview | [email protected] | 2020 Honda Accord | 5334 Bandera Springs Cir Riverview 33578 | 5fdec36f1815d8000eb06f49 | 5 | 2 | 3 |
Riverview | [email protected] | 2020 Ram Power Truck | 11323 Poinsettia St Riverview 33578 | 5fdffc7c8d3a5b000e7ab5e2 | 5 | 2 | 3 |
Orlando | [email protected] | Willys MB Jeep | 3205 Landtree Pl Orlando 32812 | 5fe02991975b32000e391513 | 5 | 2 | 3 |
Orlando | [email protected] | Honda Fit | 4446 Gilpin Way Orlando 32812 | 5fe13e1485f8fe000e59c804 | 6 | 2 | 2 |
Orlando | [email protected] | Suzuki Wagon R | 4209 Monarch Dr Orlando 32812 | 5fe02ba5975b32000e391515 | 6 | 3 | 4 |
Orlando | [email protected] | 1997 Honda VFR 750 F | 1713 Watauga Ave Orlando 32812 | 5fe027c7975b32000e391512 | 6 | 1 | 1 |
Orlando | [email protected] | Plymouth Road Runner | 5300 E Grant St Orlando 32812 | 5fe02450975b32000e39150f | 6 | 4 | 1 |
Note: Max Duration, Min Duration, and Required Notice are Enums that translate into time as days, weeks, and months
Below is a example of each filter option for the Search Rentals request, only an address and radius are required to make a request
- address: 2496 W Brandon Blvd, Brandon, FL 33511
- radius: 0 = 2 miles, 1 = 4 miles, 2 = 6 miles, and 3 = 8 miles
- rentalStartTime: "December 24, 2020 11:13:00"
- rentalEndTime: "December 27, 2020 10:00:00"
- price: 27
- features: ["Heated Seats"]
Below is an example of how to use the Search Rentals request. In this example the search is being made from the town movie theater with a radius of 3 (6 miles), and will only return rentals that have the Heated Seats feature.
In this next example the radius is adjusted from 2 miles up to 6 miles to find rentals near the Tampa International Airport. The results are then further narrowed by limiting the price to $60.
This example narrows the rental search by specifying a rental start time and end time, which will filter only rentals with a duration that accommodates the requested rental duration. You can see the initial search results reduce from 5 to 3 after specifying the rental duration.
Now that you have created a rental listing and searched for other available rentals, let's edit the Pickup Unavailability of one of your rentals and add a block of unavailable time for Christmas Break. Select the Schedule Pickup Unavailability request and create an Unavailability as seen in the example below. You may schedule Unavailability as close as a minute a part, the application has middleware to prevent any scheduling overlap or logical errors.
After scheduling pickup unavailability, you may reschedule it or completely remove the unavailability from your rental's calendar. To reschedule a pickup unavailability, select the Reschedule Pickup Unavailability request and follow the
example below.
Maybe your not getting as many rental requests as you'd like, lets edit the price on your rental to try to get more clients! Open the Edit Rental Price request and follow the example below
Now that you've had a brief tour of some of Rent-A-Car's main features, let's logout of the application. Select the Logout request and press send.
Feel free to explore the other request available in the application, each request has documentation explaining its proper use. For more information about the application visit the GitHub page, the Wiki, or the technical application documentation website
- No Response From Request: If your request is infinitely pending and never receives a successful response, you may have not logged into the application or your session has expired. Please try logging into the application again before making the request.
- Image Upload Error: If you are unable to upload one or several images, make sure that the selected files exist and are not corrupted in any way.
- Create Rental Error: If you get a bad request error when you send the Create Rental request, try these solutions.
- Double check the gasGrade value is one of the following exactly (regular, mid, premium, diesel, N/A)
- Make sure you have filled in every property and that there are no missing commas
- If everything looks perfect but there is still an error, make sure that the last property of each section does not have a comma
- No Search Rental Results: If you cannot find any rentals near the addresses you are entering, you may be searching to far from any listed rentals. Please try one of the searching with one of the examples below.
- Cannot Read Property 'Slice' of Undefined: If you receive this error message, check that you have the Cookie property selected in the Headers tab of the request.
- Slow Request Response: If you are experiencing slow request response time, such as on initial login, this is likely due to the Google Platform's 'Cold Load'