Check out a demo of FitHQ features hidden to the public here!
Description:

This is an ecommerce Drupal site for a gym with a staff of personal trainers. It includes both a master calendar and per-trainer calendar for training sessions, as well as a full recurring billing system with variable monthly payment amounts based on the number of training sessions scheduled. It also includes data visualization for tracking client progress with their fitness goals.

  • User Roles: A moderator can add trainer accounts. A trainer can add user accounts for their clients. Each of these roles must sign separate legal documents to make sure they agree to the rules of the gym.
  • Booking Training Sessions: The site allows a trainer to schedule workouts with their clients on the master calendar. Each workout is a piece of custom content called a 'training session' which includes date/time information.
  • Recurring Billing: Full Ubercart and Stripe integration to allow trainers to be billed on a monthly basis. If the trainer does not have any workouts booked that month, then their membership is free. Otherwise, they are charged half of whatever they choose to charge their clients (up until a cap of $1000.)
  • Fitness Progress Visualization: A trainer can add a 'Progress Update' to any of their client profile pages. A Progress Update is a piece of content which includes measurements such as waist size and weight, as well as a picture of the client. These progress updates are displayed with graphs for measurements and a slideshow for recent pictures.
  • Workouts and Meal Plans: Each trainer can create 'Workouts' and 'Meal Plans' to assign to any of their clients. A Workout is a set of instructions for which exercises to do, for how long, and with what weight at the gym. A Meal Plan might specify the number of meals to eat per day, how large portions should be, and what sort of nutrients should be focused on (lots of protein, or small portions, etc.) A client can log into their profile and review these and remember what to focus on when the trainer is not present.
  • Fitness Tests: A Trainer can create 'Fitness Tests' to measure a client's progress over time. This would be something like "How many pushups can you do in 30 seconds?" or "How much weight bench press?". Results of a test are recorded with whatever units are applicable to that test, and a client can see their progress on their profile page. 
Favorite Features:

I got to get really creative with how to display client fitness progress with their pictures, measurements and fitness tests using Google Charts and a nice slideshow on their profile page using Views. I'm really into fitness myself, so I know how motivating it can be for someone to see how far they have come when they are trying to reach their fitness goals so this will help business by motivating clients to keep pushing themselves.

Challenges:

PCI Compliant Automatic Variable Recurring Payment System:

The ecommerce integration required me to make a custom module to query the database and calculate the correct amount to charge any time a trainer scheduled a new training session. The module also needed to account for trainers who are still owed money by their clients.

  • For example, Trainer A schedules an hour long session with Client B, it costs a total of $80, but the client pays $50 on the day of the session. 
  • Trainer A has already had two sessions that month of $100 each, so they have earned $200.
  • Then the module adds that $50 to the total amount earned by the trainer for that month, making a total of $250 earned.
  • Then, it needs to divide that total by two (since it's less than $1000) and display the upcoming recurring charge for that month as $125, with the correct date based on when that trainer signed up.
  • When the client pays the rest of the money they owe, the trainer enters this into their records on their calendar. Now they have earned $280, so their recurring total needs to reflect that and show that they will be billed $140. 

To accomplish this I used the UC_Recurring module's API with the Ubercart Stripe module. 

Technologies Used:
Drupal, PHP, E-Commerce
,