TrainOn 002: First steps - sketches and thoughts about database design

TrainOn 002: First steps - sketches and thoughts about database design

Giving TrainOn an appearance

So - before starting to write the code, a plan needs to be laid out. Wildly starting to program normally ends in chaos. Or in more chaos than usual, a little bit of chaos is inevitable. Last time I already wrote about what steps I am planning to do and what to focus on in the upcoming weeks. Since then, I started to brainstorming about the possible design and what I want to see on which page. Additionally, I made the first steps into DB-design and had a discussion with a good friend about fundamental design choices for the DB-setup (thank you Simon!). Today I'd like to give a little insight in these small steps towards the TrainOn vision.

First sketches of TrainOn

Home

One main focus should be on the first page, namely the "Home", of TrainOn: Home-Screen_Sketch.jpg There, you should be able to make your daily notes, track different characteristics (e.g. sleep, fatigue or stress) and track or see workouts of the day. Days should be changeable by clicking on arrow buttons. It should also be possible to add new workouts by hand. Additional, to the daily tracking, there should be two overview elements as well. One is the graphical overview of the month. There, I'd like to display training minutes, resting heart rate and so on. The other element will be a summary table of distances and time spent doing a certain type of sport. You should be able to switch between week, month and year.

Diary

The diary section should enable the user to gain a simple overview of the inputs of each day in the past. You should be able to quickly edit something or add information when you haven't had time for it on that day: Diary_Sketch.jpg

Dashboard

The dashboard is inspired a lot by my current work, where I am programming dashboards to give coworkers the chance to execute their own data analysis and exploration. I want to create something similar for the dashboard section of TrainOn: Dashboard_Sketch.jpg My goal is to preprocess imported data or the input of the user in such a way, that plots can be "build" by the user. Enabling them to really explore and work with the generated training data. If this is possible, it is also an option to give the user the ability to add new plots. So I will have to work and experiment with my own data, to check the possibilities. This is always a fun time for me!

Training plan

This section is inspired by all the training plans that I have seen in the last years training for a triathlon: Trainigsplan_Sketch.jpg I always had the wish to add a target-performance-comparison to that. Doing that on a printed out plan is a little bit unhandy. Trying to execute that in a functional way in Excel without getting desperate, sad or angry at the same time seems also impossible. So I will try to solve this very personal problem of mine in TrainOn. I am thinking of adding the planed training sessions on this page and then a switch, allowing to see the comparison of what I really did on this day.

Careful first steps towards a database design

Thinking about the database is one of the harder steps for me. I already experienced how much work a database can result in, when certain design choices were made. So I at least want to try to avoid the biggest flaws. And I am pretty sure that I will still run into some of them! The first brainstorming about the possible entities and their attributes lead to the following sketch: Database_First_Brainstorming.jpg Doing this, I already came across one big question: How do I handle time series and "normal" data? On one hand I have none-time-serial data, like the user, planned trainings etc. on the other hand I want to track GPS-routes, HR during the workout and therefore I have time-serial data here. In the past, I have seen and worked with three scenarios for a similar use case:

  • Using a SQL database for it
  • Combining two databases
  • Using a db that can do both in a good way

These options do all have their pros and cons. Since I am working on this alone right now, I am not seeing myself setting up and maintaining two databases. So this option is stroked out immediately for me. Talking with my friend about this, we came to the conclusion, that the last scenario will be the one I am going with. Right now I am already working with postgreSQL and python, so I will check that DB first for my use case of TrainOn, if it doesn't fit to my needs I will look into other ones as well.

Next steps

Upcoming to dos for TrainOn and consequently stuff I will talk about the next times:

  • Checking databases for TrainOn
  • Deciding on a database
  • Set up the product backlog
  • Continue the page design