Giter VIP home page Giter VIP logo

yoga-flow-class-record's Introduction

Yoga Flow Class Record

Live Site: Yoga Flow Class Record Terminal

Repository: Yoga Flow Class Record Repository

About

This project is for users who teach lessons in any field who work for themselves. The aim is to collect lesson data from the user for the purpose of calculating earnings and updating the worksheet.

It is made with the intention of helping a small business owner keep their financial information in order by keeping track of total earnings, both for the lesson added and a running total so far.

The calculations for the earnings of the class being added use the price data per class duration that is stored in a separate worksheet and the attendance data that is directly input by the user into the terminal. The terminal will then print the earnings to the user as well as store them back in the attendance worksheet.

Table of Contents

User Experience

Features

Features to be Implemented

Technologies Used

Testing

Validator Testing

Bugs Found

Deployment

Credit

Acknowledgments

User Experience

User Stories

  • As a self-employed teacher I want to:
    • Keep track of the business earnings
    • Plan for the future growth of the business

Features

Input Data

Input of lesson data including:

  1. Day
  2. Date
  3. Time

  1. Duration
  2. Location

  1. Attendance and calculations

Calculations

  • Calculate earnings per class and update spreadsheet
  • Calculate the total of all inputted lessons

Features to be Implemented

  • Calculations of the busiest days in the week
  • Analytics of the current timetable over the month to decipher:
    • Average student attendance per day
    • Busiest time period throughout the month
    • busiest time period throughout the year

The above should aid with decision making, such as making adjustments to the current timeable, running of workshops (when and where is best) and identifying capacity to add locations/lessons.

Technologies Used

Languages Used

Python

Frameworks, Libraries and Programmes Used

GitHub - Used to hold a repository of my project and deploy the live website to Git Pages, making it public.

GitPod โ€“ Connected to GitHub, GitPod hosted the coding space, allowing the project to be built and then committed to the GitHub repository.

Heroku - Connected to GitHub repositiry, Heroku is a cloud application platform used to deploy this project so this backend language can be utilised/tested.

Google Sheets is used to create an online based spreadsheet.

Google Sheets API is used to link into my spreadsheet.

datetime to work with the date and time, ensuring it follows the correct format and doesn exceed the possible day and month.

Colorama is used to add colour to the terminal which adds to the users experience.

Testing

Functionality

The project follows the below logic:

The user must input each entry of data individually as each item has to be validated using different parameters. Once all data is input the system makes its calculations. These inputs and calculations are then pushed back into the approproate worlsheet.

I have manually tested the projecy by:

  • running through a PEP8 linter
  • Intentionally added incorrect data to ensure the code rejects it
  • Tested both in Gitpod and Heroku terminals
  • Ensured the data input from the deployed terminal pushes the data back into the worksheet as expected (see images below)

Validator Testing

The code was validated using PEP8. No errors were retruned.

Bugs Found

During testing I found that the date was not in the dd/mm/yy format I thought I had set it as. To fix this I changed the order of the following line of code from "day, month, year" to be "year, month, date":

my_date = date(int(year), int(month), int(day))

I also found that some user input errors were terminating the code although I used a while loop. To fix this I identified which lines of code were causing the errors using the Traceback in the terminal. What I found was the code that was causing the break in the loop wasn't within the while loop. To fix this I placed the code in the loop and function began to work as expected.

Currently, there are no bugs found, however, the below pylint errors were appearing in the Problems tab:

I attempted to remove the errors however the variables I have stored globally were not working when moved into the module. Therefore I had to use the global keyword within the following functions:

  • lesson_duration_data()
  • lesson_location_data
  • lesson_attendance_data

Deployment

The below steps are to deploy to Heroku, this project has been re-deployed to Render.


This project was deployed using the Code Institutes mock terminal for Heroku.

I followed the following steps:

  1. Login to Heroku and Create a New App.

  1. Give the App a name, it must be unique, and select a region.

  1. Click on 'Create App'. This will take you to a page where you can deploy your project.

  2. Click on 'Settings' among the tabs at the top of the page. The following sets must be dione before deployment.

  1. Next, scroll down to Config Vars (also knownas Environment Variables). In order for Heroku to access my spreadsheet it must have access to the contents of the creds.json file. As this file is to be kept secure it cannot be found in my GitHub repository. To enable access securely, sensitive data is stored in a Config Vars.

  1. Click 'Reveal Config Vars'. Where it says 'KEY', input CREDS and 'VALUE', input the contents of the creds.json file. Then click 'ADD'. I also had to add a second Config Vars of KEY: PORT and VALUE: 8000, to improve compatability with the Code Institute Template I am using.

  2. Scroll down to Buildpacks. This adds futher required dependencies outside of the requirements.txt file. Click 'Add Buildpack', select 'python' first and then click 'Save Changes'. Then, add a second Buildpack, 'nodejs', to handle the mock terminal provided by The Code Institute.

The order of these Buildpacks is intentional, ensure Python is on top and nodejs underneath. The order can be changed by clicking and dragging.

  1. Go to the 'Deploy' section using the tabs at the top. Find the 'Deployment Method' section and choose GitHub. Then, I connected to my relevant GitHub Repository by searching the repository name and clicking 'Connect'.

  1. Scroll down to the Automatic and Manual Deploys sections. I have enabled Automatic Deploys as I want my project to automatically redeploy if push any changes back into my repository. I then clicked 'Deploy Branch' in the Manual Deploy section and waited as Heroku installed all dependencies and deployed my code.

  1. Once my code was finished deploying I clicked view, to see my newly deployed project in the terminal.

Credit

Content

I used the following websites to help with different areas of my project:

  • Stack Overflow to test user input against the lesson_day list.

  • Stack Overflow to help with the while loop when writing the lesson day function.

  • Stack Overflow to aid with ensuring the date can be validated correctly in the lesson_date_data function.

  • Gspread Documentation to find out how to link to a column of data in a spreadsheet.

  • Colorama YouTube Video to find out how to use Colorama to change the text colour seen by the user in the terminal.

  • Lucid Charts to create the logic flow diagram for the project.

  • W3Schools to help with using the Global keyword.

  • Geeks for Geeks to help clear the list of user inputs (that were already pushed into the worksheet) if the user chooses to input more data for another lesson.

  • Maschituts for with the code to start the programme again if the user has more data to input.

  • Method 3 on this Geeks for Geeks article to turn a list of strings into a list of integers.

  • Programiz and Stock Overflow to help with using the index to check a user input.

  • Stack Overflow to help with comparing the users answer with a list.

  • Edureka to find out how to remove an item from a list.

  • Slack Overflow to help with working on the lesson_time_data function.

Acknowledgments

Thank you to all who encouraged and supported me as I created my first game, espcially to my mentor for his guidance and patience and tutor support at The Code Institute who helped when I was stuck.

yoga-flow-class-record's People

Contributors

samanthabooth81 avatar

Stargazers

k.ly avatar

Watchers

 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.