The link to Scuba Dive Log
Scuba Dive Log is a Python terminal project designed to log users' scuba dive information. It allows divers to keep track of all their dives by storing useful information such as dive date, dive buddy, dive site name, dive depth (in meters), dive time (in minutes), and air consumed (in PSI).
PSI stands for Pounds per Square Inch which is an important unit of measurement used when scuba diving. It measures the amount of air pressure inside the cylinder that divers breathe from while underwater. Knowing how much air pressure there is in your scuba tank helps divers plan dives safely and accurately so that they can make the most out of their dives!
- Scuba Dive Log
- How to use the program
- User Stories
- Features
- Flowchart
- Database Structure
- Technologies Used
- Bugs
- Testing
- Validation
- Deployment
- Click on this link or copy and paste this text:
https://dive-log-9f66ea37cc55.herokuapp.com/
into your browser's address bar. - Once the page is loaded, click on 'RUN PROGRAM'.
- Follow the instructions provided by the program.
- Choose from various options available, such as viewing dive logs, adding dive logs, deleting dive logs, searching dive logs, reading instructions, learning about the program, or quitting.
- When you are done, choose "Quit" and send the link to this program to your friends!
Link to the program: https://dive-log-9f66ea37cc55.herokuapp.com/
- As a First Time Visitor, I want to quickly understand the purpose of the program so that I can learn more about it.
- As a First Time Visitor, I want to easily navigate through the program to find the content I need.
- As a First Time Visitor, I want to add and store my dive data.
- As a First Time Visitor, I want to find information about the developer and the program.
- As a Frequent User, I want to review my previous dive logs.
- As a Frequent User, I want to update my dive experiences and edit old logs.
- As a Frequent User, I want to see updated features added over time.
-
When the program is loaded
- Users will see a logo and a main menu that explains the purpose of the program:
-
Shows the terminal menu with seven options:
-
View Dive Logs;
-
Add Dive Logs;
-
Delete Dive Logs;
-
Search Dive Logs;
-
Instructions;
-
About;
-
Quit;
-
-
When the user chooses "View Dive Logs"
- The program displays the dive logs.
-
When the user chooses "Add Dive Log"
-
When the user chooses "Delete Dive Log"
-
When the user chooses "Search Dive Logs"
-
When the user chooses "Instructions"
-
When the user chooses "About"
-
When the user chooses "Exit"
The flowchart below represents the logic progression of the Scuba Dive Log application:
The Scuba Dive Log application uses Google Sheets to store and retrieve data. The application has one worksheet named "DiveLog" that stores all the data.
The worksheet consists of seven columns: Dive Date, Dive Buddy, Dive Site Name, Dive Depth, Dive Time, Starting Air, and Ending Air. This structure allows the program to store and retrieve dive log data from the Google Sheets spreadsheet.
The ID column value is assigned automatically when a new divelog is added.
-
Python 3.8.5: used to anchor the project and direct all application behavior
-
JavaScript: used to provide the start script needed to run the Code Institute mock terminal in the browser
-
HTML used to construct the elements involved in building the mock terminal in the browser
-
datetime The datetime module supplies classes for manipulating dates and times.
-
os was used to clear the terminal before running the program.
-
copy The copy module is used in the delete_dive_log() function. The copy.copy() function is used to create a shallow copy of the dive log list obtained from the Google Sheets spreadsheet. This allows the function to update the list of dive logs after deleting a log without modifying the original list.
- Colorama was used to add colors and styles to the project.
- [gspread] Gspread was used to store, retrieve, and manipulate spreadsheets.
- VSCode was used as the main tool to write and edit code.
- Git was used for the version control of the website.
- GitHub was used to host the code of the website.
- SnippingTool was used to capture images for the README file.
- Lucid Flow Chart was used to make a flowchart for the README file.
- heroku.com was used to deploy the project.
Please refer to the TESTING.md file for all bug related documentation.
Please refer to the TESTING.md file for all test related documentation.
PEP8CI app was used to lint the code. It was helpful to edit with then copy the fixed code back into VS Code. After a ropey start with many errors that gave me a fright initially, I got it down to no errors without too much hardship. Most of the issues involved having lines that had too many characters, white space, or wrong indents.
-
Code Institute template was used to create GitHub public repository divelog. In template repository click on "use this template" --> "create new repository", choose repository name and click on the green button "Create repository from template".
-
Clone repository to your local machine using GitHub.
-
Use the following commands to add, commit and push changes:
- git add .
- git commit -m "Do something"
- git push Also:
- clear (to clear the terminal)
- git status (to know if your app is up to date and your working tree is clean)
-
Ensure that all libraries and packages are listed in requirements.txt file.
-
When program is ready for further deployment, visit heroku.com website to deploy on heroku.
-
Navigate to https://heroku.com/ and open dashboard. Then click the button "New" and select "Create new app" button.
-
Enter app name, choose region, and click on "Create app" button
-
The next step is to go to "Deploy" tab and then to "Deployment method" section to authorize and connect your GitHub account.
-
Upon successful connection, select main branch from repository.
-
Then go to "Settings" tab.
-
Next go to "Buildpacks" section. Add python and nodejs buildpacks. Order here is very important.
-
Next go to "Config Vars" section and add KEY "CREDS" - that matches your token name defined in python constant in [api/google_sheets_api.py] with value of your credentials token (copy all and paste).
-
Add key "PORT" with value "8000" and save changes.
-
Go back to "Deploy" tab. I initially used manually deploy, but you can also use automatic deploy. I had this set up, but I found it wasn't deploying the updated latest push for some reason. Maybe I'm just too impatient!
-
The link to my deployed app was shown on screen: https://dive-log-9f66ea37cc55.herokuapp.com//
There are several future enhancements that can be made to improve the functionality and user experience of the Scuba Dive Log program:
-
When I get time I will finish off adding and co-ordinating color to all text, make a more aesthetically pleasing background and make it functioning on mobile phones.
-
Implement user authentication to allow multiple users to log in and manage their own dive logs. This would provide a more secure and personalized experience for users.
-
Add the ability to edit existing dive logs. Currently, users can only add or delete dive logs. Allowing for edits would provide more flexibility in managing dive information.
-
Improve the search functionality to allow for more advanced search options. For example, users could search for dive logs by a specific date range or dive depth range, and search for partial results or keywords, making it easier to find specific dives.
-
Implement more data validation to ensure that input values meet the required format and constraints. This would help prevent errors and ensure that the dive log data is accurate and consistent.
-
Add a feature to add dive certification information / images of dive cert cards to store in the app.
-
Calculate air consumed and document air consumption over time.
-
Add additional statistics and data analysis features to provide insights into the user's dive history. This could include visualizations of dive data, such as charts or graphs, to help users analyze their dive patterns and progress over time.
-
Allow users to export their dive logs to a CSV file for further analysis or sharing. This feature would enable users to extract their dive data and use it in other applications or share it with dive buddies or instructors.
These future enhancements would further enhance the functionality and usability of the Scuba Dive Log program, providing users with a more comprehensive and customizable experience.
- Used Code Institute template to start off project.
- Sourced some style code ideas for formatting long lines of code and adding color effectively: w3schools, Stackoverflow, FreeCodeCamp.
- Rewatched Love Sandwiches project from Code Institute for inspiration on how to start setting up my site
- Used TextKool to create Dive Log logo with Ascii generator.
- Read through README.md and TESTING.md of older projects to get template base of what information I needed to fill in for my documentation.
- Used Asciiart for the ascii scuba diver art in the goodbye message.
- Used gspread google sheets to store and manipulate data. Gspread is a free web-based platform that allows users to store, retrieve, and manipulate spreadsheets.
- Thanks to Viola for keeping me sane and providing advice and motivation at silly o clock in the morning when my eyes weren't working anymore and joining me for ANOTHER halloween hackathon in the middle of the project, just to add more stress to the mix :)
- And thanks to my mentor Juliia for putting up with my "working best under pressure" method of working and providing helpful advice and figuring out my bugs with her keen eye :)