+1 (315) 557-6473 

MyFitTimer Application Homework Help Using Python

Are you searching for professional Python homework tutors to assist you with your project? Programming Homework Help boasts of some of the best Python coders. If you need help with MyFitTimer application project, do not hesitate to get in touch with us immediately. Our experts understands the Python coding rules and programming best practices. Securing our MyFitTimer application homework help is the best decision you can ever make if you want to score a top grade.
MyFitTimer Application Assignment Help

MyFitTimer Application That Uses Frameworks at Necessary Layers

The program should display an interface to the user with a start timer and end timer button. When the start timer button is clicked, the application needs to keep track of the start time. When the end timer is clicked, the screen should display a textbox with the elapsed time. Under the timer display, it should display a list of previous timer runs. This means that you need to store the time elapsed for each new run in a database. The application should use frameworks at the necessary layers
Presentation Layer – Razor or Asp.net MVC or WPF
Application Layer – A StopwatchTracker class as a POCO
Data Access Layer – Entity Framework.
Bonus Points for using the following:
1. DI 5 pts
2. Unit Tests 5 pts
3. REST 5 pts
*** The project is to be completed in Python using Flask / SQL Alchemy / RESTful Services
Prerequisite to run the project
1. make sure you have python 3.8.5 or higher
2. make sure you have pip intalled
3. install required packages from terminal by typing pip freeze > requirements.txt on project root
4. run the project by typing python server.py on terminal from the app folder
5. the project is now running on http://localhost:5000
Python Project structure
├── app
│ ├── app.py
│ ├── controllers
│ │ ├── __init__.py
│ │ │
│ │ │
│ │ │
│ │ │
│ │ ├── timeapi.py
│ │ └── time.py
│ ├── dbs
│ │ ├── stopwatch.db
│ │ └── stopwatch.sql
│ ├── models
│ │ ├── __init__.py
│ │ │
│ │ │
│ │ │
│ │ │
│ │ └── time_elapsed.py
│ │
│ │
│ ├── server.py
│ ├── static
│ │ ├── favicon.ico
│ │ ├── script.js
│ │ └── style.css
│ └── templates
│ └── index.html
├── requirements.txt
“app” directory
app.py: identifies Flask current running instance.
server.py: this runs the server or flask instance and here we set database information and controllers.
“controllers” directory
__init__.py: this file allows the controllers folder to be imported from other files.
timeapi.py: this file contains the api for saving and querying data.
time.py: this is the controller that renders the views.
“dbs” directory
stopwatch.db: this file is the sqlite database where data is stored.
stopwatch.sql: this is a script containing the creation of the table.
“models” directory (the classes, POCO’s are here)
__init__.py: this file allows the models folder to be imported from other files.
time_elapsed.py: this file is the model mapped to the timelist table using sqlalchemy allowing to query and save to database.
“static” directory (default for scripting, css and multimedia)
script.js: this file contains the client code that communicates with the server to bring and send the elapsed time.
style.css: this files gives the page the styling.
“templates” directory (default folder for all html files)
index.html: this is the main file that contains the stopwatch.
How it works
MyFit Timer
1. By clicking “START TIMER” button the timer begin counting by running the fallowing script…
 the timer function create a trigger to run the add function every 1000 miliseconds (1 second).
MyFit Timer

MyFit Timer
the add function evaluate what part of the timer needs to be increased every second, it takes into account if it already has 60 seconds is a minute, 60 minutes is an hour and assign the time to the html header (h1).
2. By clicking the “END TIMER” button the timer stops clean the header, assign the elapsed time to the textbox bellow the buttons, send the information to the server and and refresh the list with the new saved elapsed time, it runs the fallowing script…
 this stops the timer, set the elapsed time to the textbox, clean the timer by setting seconds, minutes and hours to 0, stop running the add function and call the function saveTime to save the time.
MyFit Timer

This function make a post to the api (“/api/savetime”) to save the time and then call loadTimeList function to update the list of elapsed times.

MyFit Timer

MyFit Timer

MyFit Timer

This function call the api (“/api/timelist”) to retrieve the list of elapsed times and populate the html tag select.
3. Api on python…

This is the class/model (time_elapsed.py) that allows to retrieve and save the data, the serialize function allows to format the response in json format to make it more restful like.
MyFit Timer

This is the api controller (timeapi.py), there you can see the routes to retrieve and save the data, the first one retrieves the second saves.
MyFit Timer
This controller (time.py) renders the default page (index.html).
MyFit Timer
This is the server (server.py) here you load all controllers and apply some configuration like the database connection.
Related Blogs