Skip to content

An interactive relational database website developed to help athletes monitor, visualize, and understand their health data.

Notifications You must be signed in to change notification settings

tamsinrogers/PeakPerformanceAthletics

Repository files navigation

Installing dependencies

In order to run this Flask app, activate the virtual environment of your choice, then run:

pip install -r requirements.txt

This will install all the requirements needed to run the Flask app.

In order to actually run the app, navigate to the base repository directory. Your current directory should contain main.py. Run the following:

flask --app main run

The command line will output the port on which the website is running.

Uploading files

CSV files can be uploaded from the path "/upload". An uploaded file will be automatically parsed and ingested into the database. In order for the file to be properly parsed and inserted, the following conventions must be followed:

  • The filename must be in {"user.csv", "nutrition.csv"}, or of the form{ "recovery.'name'.csv", "sleep.'name.csv", "hawkins.'name.csv"}. Uploaded files currently overwrite the previous csv of the same name; this should be changed in a later version.
  • The csv file must contain the correct column labels.

CS321-Milestone5

Deployment to Cloud

Abstract:

This milestone involved developing a dynamic version of our Athletic Management System to the cloud. We relied on our work from Milestone 4 (Flask website) as a base for adding new functional features from our backlog. This included using biometric data (and updating our graphs and tables to reflect this), and deploying our app to the cloud. Our plan was (in the form of issues) as follows:

  • Host the app on the cloud
  • Use real data in the data base
  • Refactor the format of our HTML files
  • Add fields to database objects
  • Aggregate our data
  • Use real data in our graphs and tables
  • Revamp our sign up functionality

Sprint Backlog:

User stories (general):

update this once milestone is completed

As a user I can create a new account using an email and password – Completed
As a user of the website I can log in to the website with a username and password – Completed
As a user of the website I can login to my assigned role –Completed
As a user of the website, I can navigate back to my dashboard by clicking on the mule icon – Partially completed (works for moving between athlete detail pages and dashboard)

Admin/Peak:

As an admin, I can log in with user name and password - completed
As an admin, after logging in I can navigate to my dashbord - completed
As an admin, I can view my dashbord on the website - completed
As an admin, I can view all of the sports teams in the teams table - completed
As an admin, I can edit one file (TeamNames.csv) to change what teams appear on my dashboard - completed
As an admin, when I click on a team name I will be redirected to the associated team view page - completed
As an admin, on my team view pages, I can see team name, team data, and a list athletes of that team - completed
As an admin, when on team view, I can click on an athlete's name and be redirected to the corresponding athlete view page - complete
As an admin, on my view of athletes, I can see their name, their sports science data, and important notes about the athlete - complete at a basic stage (all athletes have same data)

Athlete:

Coach

Results:

Screen Shot 2022-11-09 at 10 13 35 PM

Updated graphs (as shown in athlete dashboard) illustrating real data from our database.

Admin Views: (in order) Dashboard, Team view, Athlete view

Burn Down Chart:

image

Team Reflection:

Contribution List:

  • Calvin: Reformatted the data classes in models.py and reviewed pull requests to resolve conflicts in merging. Created the burndown chart for this milestone.
  • Matt: Worked on parsing csv files into objects in our database with parameters for each of the columns.
  • Ben: Worked on setting up flask security and email confirmation/password reset
  • Hannah: Worked on fixing bugs in permissions.
  • Milo: Added a config file and a secret key to the repo to enable cloud deployment. Configured a free account and webapp service on Microsoft Azure to enable cloud hosting of our application. Helped troubleshoot with other developers and took the lead on reviewing pull requests.
  • Tamsin: connected database to plotly graphs, reconstructed subplots to individual graphs & made appropriate edits in HTMl dashboard files
  • Nicole:

Extensions:

We added a functional ReadMe file to our repository detailing the website.

References:

Naser Al Madi

CS321-Milestone6

CI/CD Testing

Abstract:

This milestone involved developing a CI/CD pipeline to lint, test, and deploy a dynamic version of our Athletic Management System to the cloud. The updates made to our Flask website in this milestone build on top of the previous milestone (Milestone 5), and add tests along with new functional features from our backlog.

Burn Down Chart:

image

Team Reflection:

This week we worked on our communication and by the latter half of the milestone we made some good progress. Our issues we made sure to be smaller so that each team member was able to make progress on a number of individual issues. Our meeting to get our develop branch working took longer than it should have because we didn't fully respect every team member's ideas. We also had two team members leave our group without making clear that they had which made finishing the issues they were assigned much more difficult.

Sprint Backlog:

User stories (general):

As a user I can login with my email and password - completed

Admin/Peak:

As an Admin I can view the averages of all of the athletes' data - completed
As an Admin I can see a breakdown of all of the teams' average data - completed
As an Admin I can add new users - partially complteded, anyone can do this through the upload file but adding a user in the permissions page does not fully work

Athlete:

As an Athlete I can view my recent data - completed
As an Athlete I can view a history of my data - partially completed, only readiness is shown

Coach

As a coach I can view data on my team as a whole - completed
As a coach I can see my athlete's breakdowns for my team - completed
As a coach I can click on an athlete and see their specific data - completed

Results:

Contribution List:

  • Calvin: Reviewed and resolved pull requests, wrote (but not finished at time of sprint-end) functional tests for athlete data views on nutrition, readiness, and sleep quality. Created the burndown chart.
  • Matt: Added continuous integration. Made permissions page more accurate. Made admins be able to view all of the teams and their data averages. Added functinality to coach's view to see athletes of their team and the athletes' data. Worked on setting up a functional database. Added function to populate empty database. Was scrum master for this Milestone.
  • Ben:
  • Milo: Wrote several functional & unit tests. Deployed the website to the web publicly, and created another develop deployment slot for testing.
  • Tamsin: wrote code to pull database data into views.py for use in adminView, teamView, and athleteView graphs, fixed general CSS layout bugs throughout the website, edited HTML redirects to appropriate data view pages

Extensions:

We added a functional ReadMe file to our repository detailing the website.

References:

Naser Al Madi

CS321-Milestone7

API Integration

Abstract:

This milestone involved researching APIs to pull data from wearable devices into our app. An API is a set of functions and procedures allowing the creation of applications that access the features or data of an operating system, application, or other service. We focused on the Google Drive API and learned a lot from the example we went over in class last week.

Burn Down Chart:

image

Team Reflection:

We continued implementing our goals in the form of smaller issues and assigned these issues early on so that it was clear what was expected of each team member during the milestone. Our testing practices also improved during this milestone, and our communication via pull requests and Git comments was good. This week, we split assignments and time between working on integrating the APIs, developing new features, and fixing bugs from previous milestones. We hope to improve our work and add even more functional features for the version submission of our system. We also experienced some difficulty this week due to our Azure subscription being discontinued. We had to rush to start moving things over to Heroku at the last minute, so this project is still a work in progress.

Sprint Backlog:

User stories (general):

As a user I can login with my email and password - completed

Admin/Peak:

As an Admin I can view the averages of all of the athletes' data - completed
As an Admin I can see a breakdown of all of the teams' average data - completed
As an Admin I can add new users - completed
As an Admin I can remove users - completed

Athlete:

As an Athlete I can view my recent data - completed
As an Athlete I can view a history of my readiness data - completed

Coach

As a coach I can view the averages of all of my team's data - completed
As a coach I can see a breakdown for each individual athlete on my team - completed
As a coach I can view a history of my team's readiness data data - completed

Results:

login screen:

Screen Shot 2022-12-09 at 10 06 11 AM

admin dashboard:

Screen Shot 2022-12-09 at 10 07 03 AM

permissions dashboard:

Screen Shot 2022-12-09 at 10 10 43 AM

add users:

Screen Shot 2022-12-09 at 10 11 15 AM

remove users:

Screen Shot 2022-12-09 at 10 11 52 AM

upload data (admin only):

Screen Shot 2022-12-09 at 10 12 17 AM

improved methods of switching between teams (search bar and dropdown menu):

Screen Shot 2022-12-12 at 6 18 56 PM

Screen Shot 2022-12-12 at 6 19 02 PM

coach dashboard:

Screen Shot 2022-12-12 at 6 18 32 PM

athlete dashboard:

Screen Shot 2022-12-12 at 6 18 45 PM

Contribution List:

  • Calvin: Implemented more tests to increase test coverage and ensure quality code. Created both funtional and unit tests, and added the burndown chart.
  • Matt:
  • Ben:
  • Milo: Implemented Google Drive API capabilities.
  • Tamsin: scrum master, wrote and assigned new issues, researched Google Drive, MyFitnessPal, Oura Ring, Hawkins, and FitBits Apis, improved documentation, implemented a dropdown menu in the dashboard header to allow users with multiple teams to switch between their teams, made slides to introduce project presentation
  • Anton:

Extensions:

  • Functional ReadMe file to our repository detailing the website.
  • Extensive documentation in all files to improve coherence.
  • Implemented functionality to remove users.
  • Implemented functionality to send login recovery emails for improved security.
  • Added more UI features for increased accessibility (search bar, dropdown menu to switch between teams)

References:

Naser Al Madi

CS321-Milestone8

Refactoring & Better Design

Abstract:

This milestone involved refactoring and enhancing the quality of our software by focussing on design patterns and anti-patterns. We implemented remaining items in our product backlog and refactored our code to enhance readability and maintainability. We strove to implement multiple APIs, maintain a test coverage above 90%, and reduce the complexity of our code by refactoring it (as measured by code metrics). This milestone also involved the use of Radon (a Python tool for calculating code metrics) to calculate Cyclomatic Complexity and Maintainability Index for our code before and after refactoring, with the “before” calculations being from the repository submitted for Milestone 7.

Burn Down Chart:

Burndown Chart 8

Team Reflection:

Sprint Backlog:

User stories (general):

As a user I can login with my email and password - completed

As a user I can use my email for account recovery - completed

Admin/Peak:

As an Admin I can view the averages of all of the athletes' data - completed
As an Admin I can see a breakdown of all of the teams' average data - completed
As an Admin I can add new users - completed
As an Admin I can remove users - completed

Athlete:

As an Athlete I can view my recent data - completed
As an Athlete I can view a history of my readiness data - completed

Coach

As a coach I can view the averages of all of my team's data - completed
As a coach I can see a breakdown for each individual athlete on my team - completed
As a coach I can view a history of my team's readiness data data - completed

Results:

Radon results before refactoring:

Screen Shot 2022-12-18 at 9 39 40 PM

Radon results after refactoring:

Latest commit number: 214cb3a1695f3d94b0335d2f5fe1ab498451ddd9

Cyclomatic Complexity:

Screen Shot of Radon

ScreenShot of Radon Two

Maintainability Index:

ScreenShot of Radon Three

Contribution List:

  • Calvin: Created burndown chart, reviewed pull requests, added more testing, and added post-refactor radon output.
  • Matt:
  • Ben: refactored graph code to reduce length of views.py, set up heroku deployment here, created oauth.py to handle oauth2 flow
  • Milo: Increased test coverage by 11%, configured pytest and radon with custom repository commands, collected code complexity metrics and refactored views and auth.
  • Tamsin: scrum master, wrote and posted issues for new milestone, fixed team breakdown table to reflect real data, improved formatting in athlete breakdown table, fixed bug where roles were not being assigned/User table was not being created, cleaned up name variables to standardize capitalization and spacing, cleaned up and linted code, connected dashboard stats table to database so it reflects real changes in data over time, connected coach schedule to Google calendar
  • Anton:

NEW FEATURE SUMMARY:

Functional Heroku deployment: Screen Shot 2022-12-19 at 5 40 27 PM Dashboard stats table now reflects real database data: Screen Shot 2022-12-19 at 5 41 57 PM Functional & unit tests for new features Connected Google Drive API to database

Extensions:

  • Functional ReadMe file to our repository detailing the website.

References:

Naser Al Madi

About

An interactive relational database website developed to help athletes monitor, visualize, and understand their health data.

Topics

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published