Giter VIP home page Giter VIP logo

who-wants-ice-cream's Introduction

Who wants Ice-cream - Portfolio Project 3 - Python

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.

You can view the live site here - Who wants ice-cream?

Content

Objective

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.

Back to top

User Experience (UX)

User

  • 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.

User Stories

  • 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.

Owner of site

  • 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.

Flow Chart

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.

Flow ChartFlow Chart

Back to top

Features

Header

  • Using Patorjk i created a simple logo for the shop.

logo

Error messages

  • By installing Colarama i have added a red colour to any error messages to provide a visual warning to the user.

Heading

Typing effect

  • 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.

Gspread

  • The ice cream flavours have been saved on a google spread to allow the owner to amend the flavours easily.

gspread

Prettytable

  • 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.

Prettytable

Free sprinkles

  • With every 3 scoops of ice cream the customer can choose to have free sprinkles.

order receipt

  • 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. order receipt

Back to top

Future Features

  • 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.

Technologies used

  • Python
  • gitpod - Used to develop website.
  • GitBash - Used to push repository to Github.
  • HeroKu - Used host and deploy website.

Framework/Packages Used

  • 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.

Back to top

Testing

Code Validation

validation

Manual Testing

  • 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
:---------: :----------: :--------------:

Known bug

  • 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.

know bugs

Bugs Fixed

Printing flavours by name

  • 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.

gspread-1 information

  • 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.

know error with flavours

  • 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.

flav-choice

Sprinkles in a loop

  • 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.

sprinkles-loop

Price updating

  • 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.

price-update

Updating requiremnets file

  • 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

Requirements file update

Deployment

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

  1. Navigate to Heroku website and either sign in or click sign up to create a new account.

  2. In your account dashboard click the Create new APP button.

  3. Add a name for APP in the APP-Name field.

  4. Select your region from the drop-down menu and click on Create APP button.

  5. On the next page click on the Settings tab to adjust the settings.

  6. Click on the "config vars" button and hide any sensitive files from being deployed.

  7. 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.

  8. in the supply key field below this add PORT and 8000 into the value field. Then click on the "add" button.

  9. Click on the ADD Buildpack button.

  10. 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.

  11. Navigate to the deploy section by using the deploy tab a the top of the screen, select Github and connect to your Github profile.

  12. Search for your Github repo name by adding the name to the repo-name tab and click the search button.

  13. When the search is complete, click on the connect button to the right of your repo name.

  14. Now you can deploy the app automatically or manually. Automatically deploy will update the app automatically every time you push any changes to Github.

  15. Once the build is successful, you can open the app by clicking Open App button in the top right corner.

To Fork the repository on GitHub

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.

  1. Log in to GitHub and locate the repository in question.
  2. Locate the Fork button which can be found in the top corner, right-hand side of the page, inline with the repository name.
  3. Click this button to create a copy of the origional repository in your GitHub Account.

To Clone the repository on GitHub

  1. Click on the code button which is underneath the main tab and repository name to the right.
  2. In the "Clone with HTTPS' section, click on the clipboard icon to copy the URL.
  3. Open Git Bash in your IDE of choice.
  4. Change the current working directory to where you wan the cloned directory to be made.
  5. Type git clone, and then paste the URL copied form GitHub.
  6. Press enter and the clone of your repository will be created.

who-wants-ice-cream's People

Contributors

lauramayock avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.