- Live link of the project
In this project I have created a hotel bookings management system that links to a spreadsheet. The user operating the system can create a booking by entering inputs of the client for whom the booking is made. The system ensures correct data is entered within each input by raising an error if incorrect data or format is entered. The system also generates a total cost of stay at the hotel based on the type of room selected, the number of nights and number of guests. Finally the system than generates a booking ID for each client and adds it to the spreadsheet. The user can also fetch all bookings to be displayed altogether or display each booking by entering a specific booking ID.
- The Boutique Hotel
- Project Overview
- User stories:
- Design
- Flowchart
- Current Features
- Technology
- Testing
- Deployment
- Credits
- As a user I want to use booking management system
- As a user I want to create a customer booking
- As a user I want specific data requirements i.e name, contact no, checkin/checkout to be able to make a distinct booking
- As a user I want to assign a unique booking ID to for each booking
- As a user I want to be able to store bookings in a spreadsheet
- As a user I want to fetch all bookings from the spreadsheet or by booking ID
- The project is a terminal based application that opens in web page, with a button to run the program at the top and a background image.
-
The application runs the main menu home page which displays 3 options the user can choose from:
- Enter/Manage Bookings
- Display Booking Data
- Exit
-
Enter/Manage Bookings, a booking sub menu opens displaying 3 options:
- The Enter a booking
- Display booking
- Back to main menu
-
Enter a booking, the system prompts a series of sequential inputs, NAME, TELEPHONE NO., DATE OF BIRTH, CHECK-IN, CHECK-OUT, ROOM TYPE, and NO. OF GUESTS and saves the data in a spreadsheet.
-
Each of these inputs is validated to only accept certain inputs i.e alphabets or digits and formatt.
-
Display booking displays the booking just created with a unique booking ID and calculates and displays the total cost of the stay based on the number of nights from CHECK-IN, CHECK-OUT, ROOM TYPE, and NO. OF GUESTS.
-
Display Booking Data, a display sub menu opens with 3 options:
- Display all Booking Data
- Display Booking Data by BookingID
- Back to main menu
-
Display all Booking Data, display all bookings stored in the spreadsheet
-
Display Booking Data by BookingID, promopts the user to enter an ID and displays only the booking with that ID.
- Add a feature to update booking and also to delete bookings
- HTML: - HTML5 provided the skeleton for the project for the display
- CSS: - CSS was used to style.CSS was used to manage the UI.
- Python - Used for the main interaction with the user.
- Git - Git was used to managing the code. Allowing me to create backups whenever significant changes were made to code by utilizing the gitpod terminal to commit to Git and Push to GitHub.
- GitHub: - GitHub was used to externally store repository and site deployment.
- Os -Os library was used to clear the previous print statement in the terminal. The OS module in Python provides functions for interacting with the operating system. Allowing me to perfome functionality between Windows and Mac operating systems.
- Datetime - Time library was used to for check-in/check-out, no. of nights
- Random- Random library was used to get random booking ID
- Am I Responsive?- Am I Responsive? was used to see if the site is responsive on different types of devices.
- Lucid - To create the flow chart
- platform- Returns the system/OS name, such as 'Linux', 'Darwin', 'Java', 'Windows'.
- Gspread- gspread is a Python API for Google Sheets. Features: Google Sheets API v4. Open a spreadsheet by title, key or url. Read, write, and format cell ranges.
- Credentials- A credential file is nothing but just a configuration file with a tad bit of encryption and an unseen security structure in the backend.
- re - A regular expression (or RE) specifies a set of strings that matches it;
-
Through out the project I have carried out regular testing using print statments
-
Navigate throught the menu and sub menu
-
Display room price based on type of room
-
Displays the unique booking ID and calculates total cost of stay
-
Broken while loop, when inaccurate booking ID entered, displays error of "Customer doesn't exist with that ID " but does not prompt for ID again.
-
To resolve the bug I removed the while loop and recalled the functions within its self at the end of the code block with in the else of an if/else statement.
-
- To resolve this error I used the black formatter
- In the terminal enter "Pip3 install black"
- Then enter "$ black -l 79 --preview run.py"
-
- To resolve this error I use "is"
- PEP8 was used to check code errors
- Login to GitHub
- Click "Repository" and select "New"
- Give the repository a name and description and then click "Create repository"
- Click "Gitpod" to start editing
- In the terminal enter "python3 run.py" to run your code
- The project was deployed using Heroku
- Navigate to your heroku dashboard
- Click "New" and select "Create new app".
- Input a meaningful name for your app and choose the region best suited to your location.
- Select "Settings" from the tabs.
- Click "Reveal Config Vars".
- Input
PORT
and8000
as one config var and click add. - Input
CREDS
and the content of your Google Sheet API creds file as another config var and click add. - Click "Add buildpack".
- Add "nodejs" and "python" from the list or search if necessary, remember to click save.
- Python must be the first buildpack. They can be dragged into the correct position if needed.
- Select "Deploy" from the tabs.
- Select "GitHub - Connect to GitHub" from deployment methods.
- Click "Connect to GitHub" in the created section.
- Search for the GitHub repository by name.
- Click to connect to the relevant repo.
- Either click
Enable Automatic Deploys
for automatic deploys orDeploy Branch
to deploy manually. Manually deployed branches will need re-deploying each time the repo is updated. - Click
View
to view the deployed site.
- The live site can also be accessed from your repo in GitHub from the
environments section of the repo.
- Click the link to view deployments history.
- Click
View deployment
. This page also shows all the deployment history.
The site is now live and operational
- Login to GitHub
- Click "Repository" and select "project"
- Click the "Code" dropdown menu.
- Click "Clone with HTTPS" and copy the link
- Open IDE "Ternimal" in local machine
- Type "git clone" followed by URL
- Press "Enter" to create clone
- Click "Repository" and select "project"
- My friend Abu Bakar for his time helping me explain code logic flows and methodology
- Rohit Sharma, my mentor, for keeping me on track at different stages of the project and pace my work feature by feature.
- pynative helped me go over concepts and examples