This week I finalized the software architecture for the Magic Pillbox by working through various aspects of the backend design step by step. First I identified the core system requirements like structured medication and schedule data, reliable read and write operations between app and device a secure storage for our data, and a clean method to communicate with the ESP32.
Based on these requirements, I chose a relational SQL database because our system depends on strongly connected data such as users, devices, medications, schedules, and dose logs. After this, I compared various relational options and selected PostgreSQL as the best for due to its strong support for relational queries, data integrity and future adherence analytics. After this, I chose Supabase as a PostgreSQL platform because it provides authentication and secure user level access which aligns well with our Magic Pillbox requirements. After this, I finalized hybrid communication architecture in which the web app interacts with Supabase for user-facing data while the ESP32 connects over the Wifi using HTTPS requests to backend Route Handlers which then eventually reads from and writes to Supabase.
To make these design decisions, I had to learn and deep dive into backend system architecture, mainly the differences in databases, how webapps communicate with embedded hardware like ESP32 and I had to learn more about tools and concepts. To build this understanding, I used a mix of learning strategies rather than just using one website. I read some official documentation for the relevant platforms, which ones the industry prefers and uses and compared technical features as well as tradeoffs across options. This entire process helped me move from a broad understanding of possible software architectures to a more concrete and justified system design project.
I am a little behind schedule, I aim to finish most of the integration in the next 2 days so we can start testing. In terms of the overall schedule, I think we are on track for the final presentation, and we aim to start testing this week and complete all testing by mid next week, giving us enough time to write the report.
