Tesla is a CLI data automation program created for educational purposes only as part of the Code Institute Diploma in Full-Stack Software Development.
- Tesla
- UX
- Data Storage (Google Sheets)
- Features
- Technology used
- Testing and Validation
- Deployment
- Credits
- Acknowledgements
- Rent Tesla car.
- View Booking.
- Cancel booking.
- As a user, I want to be able to rent a Tesla car so that I can use it for my transportation needs.
- As a user, I want to view my booking details so that I can verify the information.
- As a user, I want to cancel my booking if my plans change so that I can avoid unnecessary charges and free up the car for other customers.
- Easy to navigate.
- Provide a diverse selection of Tesla car models and prices.
- Provide feedback or a response to the user when they perform a task or action.
- Implement a reservation system to allow users to schedule car rentals in advance, ensuring availability and convenience.
During planning, I created a flowchart of how I wanted program to work and interact. The flowchart was created using Figma
The data for the application's rental details is stored in Google Sheet.
- The Main Menu:
- Users are greeted and presented with three options to choose from.
- Rent Car Section:
- View Booking:
- Cancel Booking:
- In this section, users are provided with the option to cancel their booking. Users will be prompted to input their name to identify their booking. If a booking is found for the entered name, the system will display all relevant booking information and prompt the user to confirm the cancellation. If confirmed, the booking will be canceled.
- If no booking is found for the entered name, user will be informed accordingly.
- In this section, users are provided with the option to cancel their booking. Users will be prompted to input their name to identify their booking. If a booking is found for the entered name, the system will display all relevant booking information and prompt the user to confirm the cancellation. If confirmed, the booking will be canceled.
- Generate Booking IDs:
- When a user makes a booking, generate a unique booking ID for that reservation.
- Cancel booking/s by booking id.
- HTML
- CSS
- JavaScript
- Python Used to create the program.
- os Module Used for clearing the terminal.
- tabulate Module Used to present data in a table format.
- datetime Module Used for handling date and time operations.
- VSCode Used to write code.
- Google Sheets Used to store data.
- gspread Used to allow the Python program to interact with Google Sheets.
- google.oauth2.service_account Credentials: Used for authentication with Google APIs using service account credentials.
- Heroku Used to deploy the project.
- GitHub Version control and repository hosting.
- Git - Version control system used to commit and push code during development.
- Figma - Used to create the flowchart.
- pep8ci Used to check python code for errors.
Test scenario | Steps | Observation | Pass/Fail |
---|---|---|---|
Main Menu - selecting options | 1.Input letters. 2.Input letters, numbers, and symbols. 3.Input letters '1', '2', and '3'. 4.Input numbers greater than '3'. |
1.Program should prompt to enter a number between '1' and '3'. 2.Program should prompt to enter a number between '1' and '3'. 3.Program should navigate to the selected option. 4.Program should prompt to enter a number between '1' and '3'. |
1.Pass 2.Pass 3.Pass 4.Pass |
Rent Car - selecting start date | 1.Input letters. 2.Input letters, numbers, and symbols. 3.Input past dates. 4.Input the current date. 5. Input future dates. |
1.Program should prompt to enter a valid date. 2.Program should prompt to enter a valid date. 3.Program should prompt to enter a valid date. 4.Program should prompt to enter a valid date. 5.Program should prompt to enter the end date. |
1.Pass 2.Pass 3.Pass 4.Pass 5.Pass |
Rent Car - selecting end date | 1.Input letters. 2.Input letters, numbers, and symbols. 3.Input past dates. 4.Input the current date. 5.Input the start date. 6.Input dates greater than the start date. |
1.Program should prompt to enter a valid date. 2.Program should prompt to enter a valid date. 3.Program should prompt to enter a valid date. 4.Program should prompt to enter a valid date. 5.Program should prompt to enter a valid date. 6.Program should display car models to select. |
1.Pass 2.Pass 3.Pass 4.Pass 5.Pass 6.Pass |
Rent Car - selecting car model | 1.Input letters. 2.Input letters, numbers, and symbols. 3.Input the letters '1', '2', and '3'. 4.Input numbers greater than '3'. |
1.Program should display: "Invalid choice. Please select a valid number." and prompt to select a car model. 2.Program should display: "Invalid choice. Please select a valid number." and prompt to select a car model. 3.Program should prompt to enter the user's name. 4.Program should display: "Invalid choice. Please select a valid number." and prompt to select a car model. |
1.Pass 2.Pass 3.Pass 4.Pass |
Rent Car - enter user name | 1.Input numbers. 2.Input numbers, letters, and symbols. 3.Input letters only. |
1.Program should display: "Name should contain only letters." and prompt to enter a name. 2.Program should display: "Name should contain only letters." and prompt to enter a name. 3.Program should display the booking details. |
1.Pass 2.Pass 3.Pass |
View Booking - enter user name | 1.Input numbers. 2.Input numbers, letters, and symbols. 3.Input lowercase letters. 4.Input capital letters only |
1.Program should display: "Name should contain only uppercase letters." and prompt to enter a name. 2.Program should display: "Name should contain only uppercase letters." and prompt to enter a name. 3.Program should display: "Name should contain only uppercase letters." and prompt to enter a name. 4.Program should display user's booking details. |
1.Pass 2.Pass 3.Pass 4.Pass |
Cancel booking - enter user name | 1.Input numbers. 2.Input numbers, letters, and symbols. 3.Input lowercase letters. 4.Input capital letters only. |
1.Program should display: "Name should contain only uppercase letters." and prompt to enter a name. 2.Program should display: "Name should contain only uppercase letters." and prompt to enter a name. 3.Program should display: "Name should contain only uppercase letters." and prompt to enter a name. 4.Program should display user's booking details. |
1.Pass 2.Pass 3.Pass 4.Pass |
Cancel booking - users booking data display | 1.Enter the user's name with no booking. 2.Enter the user's name with booking. |
1.Program should display: "No booking found for USER." 2.Program should display users booking and ask user to cancel booking(s) (yes/no). |
1.Pass 2.Pass |
Cancel booking - yes/no confirmation | 1.Input numbers. 2.Input letters, numbers, and symbols. 3.Input yes. 4.Input no. |
1.Program should display: "Invalid input. Please enter 'yes' or 'no'." and prompt the user to enter yes/no. 2.Program should display: "Invalid input. Please enter 'yes' or 'no'." and prompt the user to enter yes/no. 3.Program should return to the main menu. 4.Program should display: "Booking cancelation canceled." |
1.Pass 2Pass 3.Pass 4.Pass |
User Stories | Pass/Fail |
---|---|
As a user, I want to be able to rent a Tesla car so that I can use it for my transportation needs. | Pass |
As a user, I want to view my booking details so that I can verify the information. | Pass |
As a user, I want to cancel my booking if my plans change so that I can avoid unnecessary charges and free up the car for other customers. | Pass |
- Python No error were found passing through the pep8ci
To the best of my knowledge and understanding there are no bugs present.
Navigate to the GitHub Repository you want to clone to use locally:
- Click on the code drop down button
- Click on HTTPS
- Copy the repository link to the clipboard
- Open your IDE of choice
- Type git clone copied-git-url into the IDE terminal
The project will now be cloned on your local machine for use.
For setting up APIs I falowed videos and instructions provided in Love Sandwiches and Spreadsheet Point.
APIs used for this project:
- Google Drive API.
- Google Sheet API.
- Update requirements.txt file:
- In your IDE, run the command:
pip3 freeze > requirements.txt
to include all dependencies. - Commit the changes and push to GitHub.
- In your IDE, run the command:
- Log in to Heroku:
- Access your Heroku account.
- Create new app:
- From the dashboard, click "New" (top right corner) and choose "Create new app".
- Provide a unique name for your app (e.g., "rent-tesla") and select your preferred region (e.g., Europe).
- Click "create app".
- Configure environment variables:
- Navigate to the settings tab, find "Config Vars", and click "Reveal config vars".
- Add a config var:
- KEY:
CREDS
- VALUE: Copy and paste the contents of your creds.json file.
- KEY:
- Add another config var:
- KEY:
PORT
- VALUE:
8000
.
- KEY:
- Set up buildpacks:
- Scroll to the "Buildpacks" section and click "Add buildpack".
- Select Python as the first buildpack and save changes.
- Add another buildpack:
- Select Node.js.
- Save changes again.
- Ensure that the Python buildpack is positioned above the Node.js buildpack.
- Connect to GitHub:
- Navigate to the "Deploy" section by clicking the "Deploy" tab.
- Choose "GitHub" as the deployment method and click "Connect to GitHub".
- Search for your GitHub repository and click "Connect".
- Deploy the app:
- Scroll down and click "Deploy Main".
- View deployed app:
- Once the app is deployed, Heroku will notify you and provide a button to view the app.
- Tech Coffee Break used to create virtual environment for Python in VS Code.
- Love Sandwiches and Spreadsheet Point used how to create and link APIs.
- Stackoverflow used to clear Python terminal.
- Stackoverflow used to import tabulate.
- Programiz used to import datetime.
- Ammon Quarshie used for project insparation.
- The Code Institute community and my Cohort Facilitator Laura Mayock, for motivation and support.
- My mentor, Gareth McGirr, for providing me with information and advices through the development process.