I’m writing this project post in late 2020, but I actually coded and built this out in early 2018. It was one of my earliest PHP projects, and also an experiment in starting from scratch (no frameworks, no starter package). I’m making a writeup for it years later, because, looking back I actually really like what I built and feel it deserves one. I kind of wish I had done more with this project, and perhaps built it into a larger-scale SaaS. As it is though, it served its purpose for a long time.
This project came about at the request of a friend of the family. Her son, who has a chronic health condition, was taking special medication to help his body with ingestion. He would take a pill, and then have 90 minutes to eat. Once the 90 minutes were up, he would need to take another pill if he wanted to eat more, even for tiny snacks. The part that I was asked if I could help with was how to track this; at the time he was really young, in elementary school, and because he was often moving between environments (home, school, friend’s houses) it was hard for the adults in his life to have a central place to know:
- A) Had he recently taken a pill?
- B) And, if so, were the 90 minutes up yet?
I thought this sounded like a great opportunity for me to learn some more full-stack development, and build a tiny web app that could have a shared login and “virtual” timer.
The core functionality of the app is fairly simple:
Each adult is given their own “passphrase” to log into the system. This is so that, if the timer is started, everyone can see which adult was the one to administer the pill and start the timer.
The main admin account has the ability to add and delete these passphrases whenever they want. New school nurse? Give them their own login!
Show / Hide Passphrase Demo
After logging in, there is a giant status indicator area, which tells everyone:
- If the timer is running, and he can currently eat
- If he can eat, for how much longer (how much time is left of the 90 minutes)
After the 90 minutes are up, the countdown automatically ends and the status changes. Additionally, if the timer was started on accident, it can be manually cancelled (which still gets saved to history). Or, if you forgot to start it and the pill has already been taken recently, you can offset the start time manually.
All entries are automatically recorded and summarized, under the “History” page:
Show / Hide History Demo Video
Extra Feature – Medication Scheduling
The person I built this for was so pleased with the timer feature, they asked if I could add on another feature; something to replace their paper-and-pen solution for tracking medication and therapy that was being administered. I said yes, and quickly put together a “schedule” feature.
You can configure medications and therapies, specify time of day, and for therapies, even specify and track the required duration (e.g.
30 minutes of hand grips).
👇 Tracking Medications
👇 Tracking Timed Therapies
At the time, I wanted to get a bit more familiar with PHP and general full-stack basics, so I used this project as an exercise in using some PHP, HTML, CSS, JS, and SQL fundamentals.
I built it with zero frameworks, and only a tiny bit of third party for front-end stuff; backend is all vanilla PHP. For tying together the front and backend, I wrote a tiny API in PHP to handle the requests.
- PDO + SQLite
- JQuery (just a little 😅)
Outcome / Wrap-Up
I received very positive feedback from the family that this was built for, and it served its function hundreds of times; to me, that is what matters most.
Overall, I’m happy with what I built, although I might revisit this at some point in the future as a fun project to rebuild at-scale.