Who want Ice-cream is a command-line user interface providing the customer with the ability to order an ice cream cone or cup of choice. This project was built using Python.
- Objectives
- User Experience
- Features
- Future Features
- Technologies Used
- Testing
- Deployment
- Credits
- Acknowledgements
The goal is to create an interactive site using a command line interface. It provides an automated ordering process for the user, allowing them to order their favourtie ice-cream.
- As a user, I want a clear understanding of the purpose of the page and the ability to use it intuitively with its clear and thought-out design.
- To have a clear layout and a clear understanding of what information is expected of me.
- To be prompted if my input is invalid.
- I want a simple and interactive way to order my favourite ice-cream.
- I want clear guidance throughout.
- I want a receipt with my purchase. Giving a clear outline of my purchase and the cost.
- This system automates the order process for simple orders freeing up staff to concentrate on taking payments and services for both the business and user.
- This allows for quicker delivery of service and allows staff to concentrate on orders with a higher monetary value.
Using the website lucidchart The flow chart below gives a simplified layout of what I was hoping to achieve. The shapes highlighted by the yellow colour show the stages where the user will be asked for simple input. the red boxes symbolise the negative input or an invalid input. While the green shows a positive response from the user.
- Using Patorjk i created a simple logo for the shop.
- By installing Colarama i have added a red colour to any error messages to provide a visual warning to the user.
- I have addig a typerwriter effect by using libraries time,sys. Code sourced from www.101computing.net
- This effect makes it a lot more reader friendly.
- It gives the impressing of a more thoughtful automation process giving the system a more welcoming and customer focused feel.
- Os libary was also use to clear clutter from the screen to allow the user to focus on the question/desision at hand.
- The ice cream flavours have been saved on a google spread to allow the owner to amend the flavours easily.
- I have used the library prettytable to create a user friendly viewing.
- Ice cream flavours are outlined in a simple table form with a relating number that the user can use for quick decision making.
- With every 3 scoops of ice cream the customer can choose to have free sprinkles.
- At the end of the ordering process an order slip is printed to allow for the making up of the order and the taking of payment.
- Expanding the menu available, adding ice lollies.
- To be able to order more than one ice-cream at a time.
- To utilise gspread by holding a stocklist of available products. That would update the system when there are out of stocks.
- Python
- gitpod - Used to develop website.
- GitBash - Used to push repository to Github.
- HeroKu - Used host and deploy website.
- os Used to clear the ordering screen.
- time and sys Used to create a typewriter effect.
- gspread Used to hold the icecream flavours
- google.oauth2.service_account and Credentials Accessing the gspread.
- time date To post on receipts.
- Prettytable Used to display iceCream flavours.
- Colorama Adding a red colour to the warning text.
- PEP8 online validation tool was used to validate code. Although quite a few errors showed up all were easily fixed.
- Testing user input
Test | Input | Desired outcome |
---|---|---|
Welcome | yes | ✔ |
no | ✔ | |
wrong input | ✔ | |
:---------: | :----------: | :--------------: |
cup/cone | cup | ✔ |
cone | ✔ | |
wrong input | ✔ | |
:---------: | :----------: | :--------------: |
How many | 1 | ✔ |
scoops | 2 | ✔ |
3 | ✔ | |
wrong input | ||
:---------: | :----------: | :--------------: |
flavours | 1 scoop | ✔ |
2 scoops | ✔ | |
3 scoops | ✔ | |
wrong input | ||
:---------: | :----------: | :--------------: |
free | yes | ✔ |
sprinkles | No | ✔ |
wrong input | ✔ | |
:---------: | :----------: | :--------------: |
yes | ✔ | |
1 scoop | wrong amount | X |
wrong input | ✔ | |
:---------: | :----------: | :--------------: |
yes | ✔ | |
2 scoop | wrong amount | X |
wrong input | ✔ | |
:---------: | :----------: | :--------------: |
:---------: | :----------: | :--------------: |
yes | ✔ | |
2 scoop | wrong amount | X |
wrong input | ✔ | |
:---------: | :----------: | :--------------: |
- At present the user is able to imput a number higher than 6. Obviously this is not ideal and with more time I would like to have amended this error.
- I had trouble at first trying to find a way to convert the flavour numbers chosen by the customer back to the flavour names. I tried to achieve this in a few different ways. Originally I tried to use the number the user inputted to select the flavour name on gspread but as I had the flavour list already linked to the keyword flavour using the below code it seemed cumbersome way.
- Using the flav-list keyword I used a for loop that would append the flavour name to the customer_order global variable but this would only print one favour to the order receipt.
- In the below example you can see that although there were two scoops chosen, flavours 4,5 only one flavour name is shown.
- In creating a fuction that would take the users number choices and use a for loop to run them through the for loop and append them to new_choice = [] allowed me to print all of the users ice choices by name in the order- receipt.
- The below is a snipping tool showing a loop where the user would place their order and choose if they wanted sprinkles, the order slip would be printed but the terminal would then request if they would like sprinkles again. This was caused by me calling the function sprinkles at the end of the code. Once remove this amended the bug.
- Originally I was using the keyword append to save the price to be called in the order-receipt function. But I the customer chose sprinkles the price would not be added to the price of the ice cream, instead it was shown in conjunction with it. In the end I found that updating the price variable when needed using the = sign was the most straightforward and effective way.
- After adding new liberys to my github I found that the Hekuro terminal was not supporting the amendments. After much research I came to the conclusing that this was because i did not update the requirments file in my github workspace using
pip freeze > requirements.txt
Before you deploy to Heroku, make sure to update any dependencies needed to run your app. A list of dependencies can be saved in the requirements.txt file. This is done automatically after adding the below code into the terminal and then do a git push.
pip3 freeze --local > requirements.txt
-
Navigate to Heroku website and either sign in or click sign up to create a new account.
-
In your account dashboard click the Create new APP button.
-
Add a name for APP in the APP-Name field.
-
Select your region from the drop-down menu and click on Create APP button.
-
On the next page click on the Settings tab to adjust the settings.
-
Click on the "config vars" button and hide any sensitive files from being deployed.
-
In the field for key add the sensitive file name and in the value field copy the entire file from your workspace into this field and click add.
-
in the supply key field below this add PORT and 8000 into the value field. Then click on the "add" button.
-
Click on the ADD Buildpack button.
-
Select python buildpack and click save changes. Then click Add Buldpack button again but this time add node.js and save changes. Please ensure that you are adding them in this order as it may cause issues otherwise.
-
Navigate to the deploy section by using the deploy tab a the top of the screen, select Github and connect to your Github profile.
-
Search for your Github repo name by adding the name to the repo-name tab and click the search button.
-
When the search is complete, click on the connect button to the right of your repo name.
-
Now you can deploy the app automatically or manually. Automatically deploy will update the app automatically every time you push any changes to Github.
-
Once the build is successful, you can open the app by clicking Open App button in the top right corner.
A copy of the GitHub Repository can be made by forking the GitHub account. Changes can be made on this copy without affecting the origional repository.
- Log in to GitHub and locate the repository in question.
- Locate the Fork button which can be found in the top corner, right-hand side of the page, inline with the repository name.
- Click this button to create a copy of the origional repository in your GitHub Account.
- Click on the code button which is underneath the main tab and repository name to the right.
- In the "Clone with HTTPS' section, click on the clipboard icon to copy the URL.
- Open Git Bash in your IDE of choice.
- Change the current working directory to where you wan the cloned directory to be made.
- Type git clone, and then paste the URL copied form GitHub.
- Press enter and the clone of your repository will be created.
-
Acknowledgements This site, was designed and developed in conjunction with the Full Stack Software Developer Diploma course (eccommerce) at the Code Institute. I would like to thank my class facilitator, the members of our class, the Slack community and Code Institute for all their support.