diff options
| -rw-r--r-- | BUGS | 2 | ||||
| -rw-r--r-- | README | 10 | ||||
| -rw-r--r-- | app/forms/workout.py | 5 | ||||
| -rw-r--r-- | app/routes/api.py | 2 | ||||
| -rw-r--r-- | app/routes/basic.py | 2 | ||||
| -rw-r--r-- | app/routes/workout.py | 1 | ||||
| -rw-r--r-- | app/templates/home.html | 96 | ||||
| -rw-r--r-- | docs/poster.tex | 24 |
8 files changed, 64 insertions, 78 deletions
@@ -1,3 +1,5 @@ /workout/record: Timers don't automatically done a row Timer data isn't written to database + New sets don't have values cleared + Tab does not work for new sets @@ -0,0 +1,10 @@ +How to run: + +1. Install dependencies + $ pip install -r requirements.txt + +2. Change to app directory + $ cd app + +3. Start Flask + $ flask run diff --git a/app/forms/workout.py b/app/forms/workout.py index f3a1082..a06c771 100644 --- a/app/forms/workout.py +++ b/app/forms/workout.py @@ -4,6 +4,7 @@ from wtforms import ( FormField, HiddenField, IntegerField, + FloatField, SelectField, StringField, ) @@ -14,7 +15,7 @@ class ExerciseCreateForm(Form): id = HiddenField("id", [Optional()]) name = StringField("name", [DataRequired()]) sets = IntegerField("sets", [DataRequired()]) - units = IntegerField("units", [DataRequired()]) + units = FloatField("units", [DataRequired()]) type = SelectField( "type", [DataRequired()], choices=[("reps", "Reps"), ("time", "Time")] ) @@ -27,7 +28,7 @@ class WorkoutCreateForm(FlaskForm): # /workout/record class SetForm(Form): - lbs = IntegerField("lbs", [Optional()]) + lbs = FloatField("lbs", [Optional()]) units = IntegerField("units", [Optional()]) diff --git a/app/routes/api.py b/app/routes/api.py index 77c8650..097400d 100644 --- a/app/routes/api.py +++ b/app/routes/api.py @@ -1,5 +1,5 @@ from app import app, db -from flask import redirect, request, jsonify +from flask import redirect, request, jsonify, url_for from flask_login import current_user, login_required from tables import Exercise, SetRecord, Workout, WorkoutRecord diff --git a/app/routes/basic.py b/app/routes/basic.py index b211da7..584d837 100644 --- a/app/routes/basic.py +++ b/app/routes/basic.py @@ -17,6 +17,7 @@ def home(): db.session.query(WorkoutRecord) .filter_by(user_id=current_user.id) .order_by(WorkoutRecord.finished.desc()) + .all() ) # Set records length @@ -36,6 +37,7 @@ def home(): .filter(SetRecord.exercise_id == Exercise.id) .group_by(Exercise.id) .order_by(db.func.count(SetRecord.id).desc()) + .having(db.func.count(SetRecord.id) > 1) .limit(3) .all() ) diff --git a/app/routes/workout.py b/app/routes/workout.py index e27cee8..767603e 100644 --- a/app/routes/workout.py +++ b/app/routes/workout.py @@ -131,6 +131,7 @@ def workout_record(workout_id=None): return redirect(url_for("home")) else: + print(form.errors) # Populate form with data for exercise in workout.exercises: form.exercises.append_entry( diff --git a/app/templates/home.html b/app/templates/home.html index e082173..e75d7ec 100644 --- a/app/templates/home.html +++ b/app/templates/home.html @@ -9,8 +9,7 @@ <h1 class="title"> Hello {{ current_user.username }} </h1> - <h2 class="subtitle"> - Welcome to your home. + <h2 class="subtitle"> Welcome to your home. </h2> </div> </div> @@ -20,12 +19,10 @@ <div class="tile is-parent"> <article class="tile is-child box"> <p class="title has-text-black">{{ current_user.workouts.count() }}</p> - <p class="subtitle has-text-black">Workouts</p> - </article> - </div> + <p class="subtitle has-text-black">Workouts</p> </article> </div> <div class="tile is-parent"> <article class="tile is-child box"> - <p class="title has-text-black">{{ records.count() }}</p> + <p class="title has-text-black">{{ records|length }}</p> <p class="subtitle has-text-black">Workouts Completed</p> </article> </div> @@ -36,12 +33,12 @@ </article> </div> <!-- Something else? - <div class="tile is-parent"> + <div class="tile is-parent"> <article class="tile is-child box"> - <p class="title">19</p> - <p class="subtitle">Exceptions</p> + <p class="title">19</p> + <p class="subtitle">Exceptions</p> </article> - </div> --> + </div> --> </div> </section> <div class="columns"> @@ -49,7 +46,7 @@ <div class="card events-card"> <header class="card-header"> <p class="card-header-title"> - My Workouts + My Workouts </p> </header> <div class="card-table"> @@ -57,34 +54,34 @@ <table class="table is-fullwidth is-striped"> <tbody> {% for workout in current_user.workouts %} - <tr> - <td>{{ workout.name }}</td> - <td>{{ workout.exercises.count() }} exercises</td> - <td class="level-right"> - <p class="buttons"> - <a class="button is-small is-primary" href="/workout/record/{{ workout.id }}">Record</a> - <a class="button is-small is-info" href="/workout/edit/{{ workout.id }}">Edit</a> - <a class="button is-small is-danger js-modal-trigger" data-target="modal-{{ workout.id }}" href="#">Delete</a> + <tr> + <td>{{ workout.name }}</td> + <td>{{ workout.exercises.count() }} exercises</td> + <td class="level-right"> + <p class="buttons"> + <a class="button is-small is-primary" href="/workout/record/{{ workout.id }}">Record</a> + <a class="button is-small is-info" href="/workout/edit/{{ workout.id }}">Edit</a> + <a class="button is-small is-danger js-modal-trigger" data-target="modal-{{ workout.id }}" href="#">Delete</a> + </p> + </td> + </tr> + <!-- Confirmation Modal --> + <div class="modal" id="modal-{{ workout.id }}"> + <div class="modal-background"></div> + <div class="modal-card"> + <section class="modal-card-body"> + <h1 class="title has-text-black">Are you sure?</h1> + <p> + Are you sure you want to delete this workout? + You will not be able to restore it once you do. </p> - </td> - </tr> - <!-- Confirmation Modal --> - <div class="modal" id="modal-{{ workout.id }}"> - <div class="modal-background"></div> - <div class="modal-card"> - <section class="modal-card-body"> - <h1 class="title has-text-black">Are you sure?</h1> - <p> - Are you sure you want to delete this workout? - You will not be able to restore it once you do. - </p> - </section> - <footer class="modal-card-foot"> - <a href="/api/workout/delete?id={{ workout.id }}" class="button is-danger">Confirm</a> - <button class="button">Cancel</button> - </footer> - </div> + </section> + <footer class="modal-card-foot"> + <a href="/api/workout/delete?id={{ workout.id }}" class="button is-danger">Confirm</a> + <button class="button">Cancel</button> + </footer> </div> + </div> {% endfor %} </tbody> </table> @@ -99,7 +96,7 @@ <div class="card events-card"> <header class="card-header"> <p class="card-header-title"> - Recent Workouts + Recent Workouts </p> </header> <div class="card-table"> @@ -118,35 +115,26 @@ </div> </div> <footer class="card-footer"> - <a href="#" class="card-footer-item">View All</a> + <p class='card-footer-item'>{{ records|length }} Recent Workouts</p> </footer> </div> </div> </div> <div class="columns"> + {% for completed_workout in top3 %} <div class="column is-4"> <div class="box"> - <canvas id="chart-1"> - </div> - </div> - <div class="column is-4"> - <div class="box"> - <canvas id="chart-2"> - </div> - </div> - <div class="column is-4"> - <div class="box"> - <canvas id="chart-3"> + <canvas id="chart-{{ loop.index }}"> </div> </div> + {% endfor %} </div> </div> <script type="text/javascript" src="/static/js/chart.js"></script> <script> -// TODO top 3 - exercise_chart('chart-1', {{ top3[0].id }}, "{{ top3[0].name }}"); - exercise_chart('chart-2', {{ top3[1].id }}, "{{ top3[1].name }}"); - exercise_chart('chart-3', {{ top3[2].id }}, "{{ top3[2].name }}"); + {% for completed_workout in top3 %} + exercise_chart('chart-{{ loop.index }}', {{ top3[loop.index0].id }}, "{{ top3[loop.index0].name }}"); + {% endfor %} </script> {% endblock %} diff --git a/docs/poster.tex b/docs/poster.tex index 604d196..555f3a5 100644 --- a/docs/poster.tex +++ b/docs/poster.tex @@ -72,10 +72,9 @@ Missouri State University, MO, USA}} Our proposal is to develop a web application to track weightlifting sessions, progress, and statistics. This web-app will allow users to create personal accounts to track their information. We will allow the user to upload their data from days at the gym and be able to watch their progress as they continue to go to the gym. It will also show useful calculations, such as percentages of your 1RM (One repetition max). Statistics like progress prediction of the user and analysis will be included. Users will also be able to create their own workout plans, or routines. The routines will suggest values in order for the user to make meaningful progression at the gym. Users can also record their weight. } -\headerbox{Experiments}{name=info,column=2,row=0,span=1, below=introduction}{ +\headerbox{Home Page}{name=info,column=2,row=0,span=1, below=introduction}{ \begin{center} \includegraphics[width=66mm]{img/1.png} -The growth of cloud computing is growing increasingly due to its accessing convenience, unlimited amount of resources, the 24/7 IT support, and the affordable cost. \end{center} } @@ -88,39 +87,22 @@ The growth of cloud computing is growing increasingly due to its accessing conve } \headerbox{Proposed Solution}{name=mcs,column=0,below=model,span=2}{ -\begin{itemize} -\item Step 1: Select Dashboard from the left side of the screen. Once you have selected Dashboard, look for the area labeled Marketplace and select Marketplace (Fig.1). -\item Step 2: Type in Lab Services in the search bar and press enter. Then select Lab Services (preview). After you have done that, you will select button that says Create located on the right side of the page. Once you have selected Create, you will be taken to a screen where you will need to fill out information pertaining to the new lab service being created. Once you have filled out the information, select create. -\item Step 3: Return back to the Dashboard (as described in Step 1) and select the name of the lab you created in Step 2 (Fig.1). -\item Step 4: Once you have selected the lab, you will be taken to the following screen. Once on that screen, you will then need to select the link titled Create a lab at http://lab.azure.com (Fig.2). -\item Step 5: Once you have selected the link, you will be taken to a new page that will allow you to create a lab environment to begin the creation of the new lab, you will first select + New Lab. Once you have selected that, you will need to rename your lab and set the number of students you want to allow access to the lab. Once completed filling out the information, select save. -\item Step 6: Once you have selected Save, you will be taken to another page that will require you to select the size of your machine(s), the region, and the operating system. Once you have filled out the information you will select Next. -\item Step 7: Once Next has been select, you will need to enter a Username and Password for individuals to have access to your labs. Once the information has been filled out, you will need to select Create. (Do not make this username and password your own personal information because you will need to provide this information to all the individuals that will be accessing your lab. -\item Step 8: Once you have selected Create, you will now need to wait about 20 minutes for the lab to be created. -\item Step 9: Once the lab has been created, you will need to fill out some required information and select publish. Publishing will take about an hour to complete. -\item Step 10: Once the lab has been published, you will then be taken to a dashboard that allows you to control the main virtual machine. With this main virtual machine, you will be able to upload whatever information would like and it will be available on all other virtual devices for the environment you created (Fig.3). -\end{itemize} +Strengthy solves the problem of data at the gym. As a smart and easy way to record data, you can take bigger, better steps to achieving your fitness goals. As time progresses, users will be able to get a clear visualization of the data they've been entering showing their statistics at the gym. With these insights, users can target weak points, and go after goals in areas they want to see improvement in. Many of those involved in regular fitness also typically stick to a routine at the gym, or what some might call a split. These splits we call workouts in our app to allow a user to create an easy to understand format of their routine while at the gym. We also wanted to accomodate for users who do timer-based workouts. For instance, some common exercises that use a timer are the 'plank' and the 'sprint'. Strengthy allows you to set a time for your activity and start a timer based for that activity. Since you may one do more than one sprint or plank, you can add sets accordingly while working out. The same goes with rep-based workouts too, to provide the ease of getting more work in on days you feel more ready to go at the gym. Users can now view their data without the cost of their privacy, their personal information, or their money. Since our solution is open source, users can self-host the platform on their own machine with just a few commands in the command prompt. } \headerbox{Results}{name=screen,column=2,span=1,below=info}{ % To reduce this block to 1 column width, remove 'span=2' -%The development team used the ASP.Net Web Forms development stack to create this project. On top of the standard web technologies, the Web Forms development stack uses a Microsoft SQL Server database for data retrieval/storage, ASP Web Form Controls for front-end development and C\# for back-end development. \begin{center} \includegraphics[width=60mm]{img/2.png} \end{center} -%Additionally, the Bootstrap front-end library was also used for various components of the web pages to create responsive elements. Some of the associated tools that were used for development included Visual Studio Community 2016 as the main integrated development environment (IDE), Microsoft SQL Server Management Studio for database management and Azure Web Services for project deployment. } \headerbox{Conclusions and Future Work}{name=sea,span=3,column=0,below=mcs}{ %\includegraphics[width=151mm]{GUI1_revised.jpg} -We have come to the conclusion that LaaS is a effective and useful service that can be easily set up by any individual. After looking at the projected growth of LaaS, we have concluded that LaaS will save schools and companies a lot of money and increase the amount of individuals who use the service because of its’ convenience. We have also concluded that LaaS environments will become a popular option for universities within the next few years. We will continue our expand our knowledge on LaaS and well as learn more about the cloud and the useful services that can be provided by the cloud. +From the beginning, we were looking for a good solution to know what our data looked like at the gym. For awhile it was neglected, but as time went on, seeing graphs and figures showed to be in direct correlation to our success at the gym. While we were able to include basic functionality, it would be interesting to see what we can do with the data once we have it and expand upon it further. } -%\headerbox{Conclusions and Future Work}{name=conclusion,column=2,below=screen,span=1}{ -%We have come to the conclusion that LaaS is a effective and useful service that can be %easily set up by any individual. After looking at the projected growth of LaaS, we have %concluded that LaaS will save schools and companies a lot of money and increase the amount %of individuals who use the service because of its’ convenience. -%} - \end{poster} \end{document} |
