PillPal

An iOS medication management application built with SwiftUI that helps users track their medications, receive timely reminders, manage refills, and maintain a comprehensive medication history. The app features a clean, dark-themed UI, secure Google authentication, and robust offline capabilities for a seamless user experience.

Technologies Used

Frontend

  • SwiftUI
  • Swift

Backend & Storage

  • Firebase Firestore
  • UserDefaults
  • Firebase Authentication

Authentication

  • Google Sign-In
  • Firebase Auth

Notifications

  • UNUserNotificationCenter
  • Local Notifications
  • Custom Notification Actions
PillPal

Challenges & Solutions

Challenge 1: User-Friendly Medication Entry System

Creating an intuitive interface for medication entry that balances simplicity with the need to capture comprehensive medication details including dosage instructions, scheduling, pill counts, and categorization.

Solution Approach

Created a carefully designed form interface with appropriate input controls for different data types, including a segmented picker for dosage timing, time selector for scheduling, numeric inputs for pill counts, and a stepper for pills per dose. The form validates inputs before saving and provides clear visual hierarchy to guide user attention.

Challenge 2: Reliable Notification System

Developing a robust notification system that reliably delivers medication reminders, remembers user actions (such as snoozing or marking as taken), and manages refill alerts based on remaining pill counts and consumption rates.

Solution Approach

Implemented a comprehensive notification management system that handles scheduling, updating, and canceling of medication reminders. The system maintains a history of past notifications, provides interactive actions like snooze and 'mark as taken', and intelligently schedules refill reminders based on consumption rates. All notification data is persistently stored using UserDefaults to maintain state across app launches.

Challenge 3: Secure Authentication Implementation

Implementing secure, frictionless authentication with Google Sign-In while ensuring proper data separation between users and maintaining a smooth user experience during sign-in, sign-out, and app initialization.

Solution Approach

Built a secure authentication flow using Firebase Authentication with Google Sign-In integration. The system handles the OAuth flow gracefully, maintains user state across app launches, and includes proper error handling. The implementation preserves user context and ensures secure access to medication data through proper Firebase security rules.

Challenge 4: Elegant State Management

Managing complex application state across multiple views while maintaining data consistency between local state, Firestore database, and notification scheduling systems.

Solution Approach

Implemented a robust state management architecture using a combination of ObservableObject view models, environment objects, and publishers. Each view model is responsible for a specific domain of functionality, such as medication management or authentication. The architecture ensures data consistency between the UI, local state, and Firestore database through careful use of two-way bindings and asynchronous updates.

Outcomes & Results

PillPal successfully delivers a comprehensive medication management solution that helps users manage their health regimen effectively. The application combines an elegant user interface with robust backend services to create a reliable, user-friendly experience.

Key Metrics

  • Reliable medication reminders with interactive notification actions
  • Secure user authentication with proper data separation
  • Intuitive medication management interface with validation
  • Intelligent refill reminders based on consumption patterns
  • Comprehensive medication history tracking

Key Learnings

  • Mastered SwiftUI form design patterns and custom input validation techniques
  • Developed expertise in local notification scheduling, management, and user interactions
  • Gained deep understanding of Firebase Authentication flows and security best practices
  • Improved skills in designing reactive applications with proper state management
  • Learned effective techniques for creating accessible, user-friendly health applications

Project Gallery

Demo of loggin in using Google Auth.

Demo of the Homescreen, adding/editing/deleting medication, replenishing refills, and receiving a notification.

Project Duration

December 2024

Role

Solo project - iOS Development

What's Next?

Future enhancements include implementing medication interaction warnings, adding prescription photo capture and OCR for easy entry, building a companion Apple Watch app for even more convenient reminders, and adding a healthcare provider sharing feature to facilitate better communication during appointments.