Healthify

Aug 14, 2025Β·
Cayden Miguel Theseira
Cayden Miguel Theseira
,
Jethro
Β· 8 min read
Image credit: Me
Table of Contents
GitHub Logo GitHub Repository for Healthify

Overview

Healthify is a comprehensive Flutter healthcare application that makes healthcare accessible, intelligent, and user-friendly. Built with Material Design 3, the app provides:

  • AI-powered health assistance using Google Gemini 2.0 Flash
  • Interactive clinic discovery via OpenStreetMap and GPS location services
  • Smart appointment booking with email notifications
  • Personal health management features tailored for Singapore

πŸ“š School Project Disclaimer
This is a mock concept application developed by Jethro and I as part of our EGE312 Mobile Computing Project (Year 3, Computer Engineering Specialisation). No actual clinic bookings or medical appointments are made through this app. All features are for demonstration and educational purposes only.

Your health and wellness journey starts here.


Screenshots πŸ“±

App Icon

Onboarding

Intro 1 Intro 2 Intro 3 Intro 4

Authentication & Home

Login Home Home Light Purple Theme Home Dark Reddish Theme

AI Health Assistant

AI Chat AI Image Analysis

Clinic Discovery

Regions Nearby Saved Open

Appointment Booking

Select Category Select Service Select Date Select Time

Appointments Management

Upcoming Location Edit Appointment Passed Email Notification

Settings & Profile

Settings Dark Mode Themes

User Profile

Profile Phone Input

Slides

Healthify by caydenmtheseira

Problem

Finding clinics, understanding what service you need, and booking appointments often requires:

  • switching between apps or websites,
  • searching unfamiliar clinic details,
  • and navigating unclear booking flows.

Healthify consolidates these steps into a single, user-friendly workflow.


Key Features

πŸ€– AI Health Assistant (Google Gemini 2.0 Flash)

  • Natural chat interface for intelligent health conversations
  • Image analysis β€” upload medical images for AI-powered insights
  • Markdown support with rich text formatting (code blocks, lists, tables, blockquotes)
  • Appointment intent detection β€” AI extracts booking intent and suggests appropriate services
  • Conversational memory β€” maintains context throughout discussions
  • AI shortcuts β€” quick access buttons for Symptoms, Medicines, and Wellness tips

πŸ“… Smart Appointment Management

  • Step-by-step booking flow with service selection, date/time picker, and clinic selection
  • AI-assisted booking β€” Gemini suggests appropriate appointment types based on conversations
  • Full CRUD operations β€” create, view, edit, and cancel appointments
  • Status tracking β€” automatic status updates (upcoming β†’ passed) based on time
  • Email notifications β€” confirmation emails sent via Resend API
  • Comprehensive service categories:
    • Doctor Consultation (General, Chronic Conditions, Family Planning, Specialist Referral)
    • Vaccination (Adult, Child, COVID-19, Flu, Travel)
    • Screening & Tests (Cervical Cancer, Diabetic Eye, Mammogram, Blood Pressure, Cholesterol)
    • Nursing Services (Wound Dressing, Injection, Health Education, Postnatal Care)
    • Allied Health (Nutritionist, Physiotherapy, Medical Social Service, Financial Counselling)
    • Dental (Cleaning, Check-up, Fluoride Treatment, X-Ray)

πŸ—ΊοΈ Interactive Clinic Discovery

  • Flutter Map integration with OpenStreetMap tiles for interactive clinic locator
  • Geoapify API integration fetching healthcare clinics across Singapore
  • Multiple search options:
    • By Region (Central, Northwest, Southwest, Northeast, Southeast)
    • By Distance (5km radius from current location)
    • Saved Clinics (personal favorites)
    • Open Status (currently operating clinics)
  • Real-time GPS with accurate location services using Geolocator
  • Opening hours parser with intelligent OSM format parsing
  • Distance calculation using Haversine formula for accuracy
  • Draggable bottom sheet with smooth clinic list UI

πŸ‘€ User Profile & Personalization

  • Comprehensive profile management β€” name, contact, age, gender, email
  • Profile pictures β€” Cloudinary integration for image upload and hosting
  • International phone input with country code selector and validation
  • Theme customization:
    • Dark/Light mode toggle with persistence
    • 15+ color palette options for theme personalization
  • Language support β€” English (currently supported)
  • Firebase sync β€” all preferences stored and synced across devices

🚢 Health Tracking

  • Real-time step counter using pedometer integration
  • Activity permissions for Android activity recognition
  • Daily goals with visual progress tracking

🎨 Onboarding Experience

  • 4-page introduction β€” Welcome, AI Assistant, Find & Connect, Get Started
  • Shared preferences β€” remembers first-time users
  • Animated transitions with smooth page indicators and navigation

Tech Stack

CategoryTechnology
FrameworkFlutter 3.6.0+ / Dart ^3.6.0
UI DesignMaterial Design 3 with custom theming, Product Sans typography
BackendFirebase (Authentication, Firestore)
State ManagementProvider + StatefulWidget patterns
AI IntegrationGoogle Gemini 2.0 Flash via flutter_gemini
Chat UIDash Chat 2, Flutter Markdown
MapsFlutter Map + OpenStreetMap tiles
Location ServicesGeolocator, Geoapify Places API
Image StorageCloudinary (profile pictures)
Email ServiceResend API
Health TrackingPedometer, Permission Handler
UI/UX LibrariesCommunity Material Icons, Font Awesome Flutter, Flutter SVG

Key Dependencies

  • Core: flutter_gemini, dash_chat_2, flutter_markdown
  • Firebase Suite: firebase_core, firebase_auth, firebase_ui_auth, cloud_firestore
  • Location & Maps: flutter_map, geolocator, latlong2
  • UI Libraries: provider, community_material_icon, font_awesome_flutter, flutter_svg
  • User Input: phone_input, image_picker
  • Utilities: http, flutter_dotenv, url_launcher, shared_preferences, resend

My Role

As a co-developer, I was responsible for designing and implementing core features across the entire application stack:

AI Integration

  • Integrated Google Gemini 2.0 Flash API for health conversations
  • Implemented system prompt engineering for healthcare context
  • Built JSON-structured appointment intent extraction from conversations
  • Developed conversational history management (last 6 messages context)
  • Created image analysis feature with textAndImage API
  • Added real-time typing animations during AI responses

Location & Maps

  • Built interactive clinic discovery system with Flutter Map and OpenStreetMap
  • Integrated Geoapify Places API for fetching healthcare facilities across Singapore
  • Implemented real-time GPS tracking with permission handling
  • Developed Haversine formula for accurate distance calculations
  • Created region-based and radius-based clinic search functionality (5km default)
  • Built background clinic caching to Firestore for performance

Appointment System

  • Designed and implemented multi-step booking flow (Category β†’ Service β†’ Date β†’ Time β†’ Info)
  • Built full CRUD operations for appointment management
  • Implemented AI-assisted booking with pre-fill from conversations
  • Created automatic status transition system (upcoming β†’ passed)
  • Integrated Resend API for email confirmations
  • Developed Firestore batched writes for efficient data operations

UI/UX & Theming

  • Implemented Material Design 3 color scheme with seed colors
  • Built custom theme system with 15 curated color palettes
  • Developed dark/light mode toggle with Firebase persistence
  • Created HSL color manipulation for dark mode variations
  • Integrated Product Sans custom typography
  • Built onboarding flow with animated transitions

Additional Contributions

  • Set up Firebase Authentication and Firestore database architecture
  • Implemented Cloudinary integration for profile picture uploads
  • Built comprehensive user profile management system
  • Performed testing, bug-fixing, and performance optimization across the app

Technical Implementation Highlights

AI Health Assistant Architecture

The health assistant leverages Google Gemini 2.0 Flash for intelligent health guidance through:

  • System prompt engineering tailored for healthcare context and appropriate medical disclaimers
  • JSON-structured appointment intent extraction to parse user requests into actionable booking data
  • Conversational history management maintaining the last 6 messages for context continuity
  • Real-time typing animation during AI response generation for better UX
  • Image analysis with textAndImage API for medical image interpretation
  • Automatic nearest clinic detection for seamless booking flow

Location Services & Mapping

  • Real-time GPS tracking with comprehensive permission handling
  • Distance calculation using the Haversine formula for accurate clinic proximity
  • Region-based clinic search mapped to Singapore’s Community Development Council (CDC) regions
  • Radius-based search with configurable 5km default range
  • Background clinic caching to Firestore for improved performance and offline support
  • OSM opening hours format parser for accurate “open now” filtering

Appointment Booking System

  • Multi-step wizard UI guiding users through: Category β†’ Service β†’ Date β†’ Time β†’ Info
  • Pre-fill from AI conversation or existing appointment for editing
  • Edit and reschedule functionality for upcoming appointments
  • Automatic status transition based on appointment date/time
  • Firestore batched writes for atomic multi-document operations
  • Resend API integration for professional email notifications

Dynamic Theme System

  • Material Design 3 color scheme seeding for consistent, modern UI
  • HSL color manipulation for harmonious dark mode variations
  • Per-user theme persistence in Firestore for cross-device sync
  • 15 curated pastel color options providing visual variety
  • Custom Product Sans typography throughout the app

Firebase Data Structure

The app uses three main Firestore collections:

appUsers β€” User profiles with preferences

{
  "userid": "firebase-uid",
  "name": "John",
  "nameLast": "Doe",
  "email": "john@example.com",
  "contact": "+65 9123 4567",
  "age": "25",
  "gender": "Male",
  "profilePic": "https://cloudinary.com/...",
  "darkMode": false,
  "colorSeed": 4290190335,
  "savedClinics": ["place_id_1", "place_id_2"]
}

appointments β€” Appointment records

{
  "userId": "firebase-uid",
  "placeId": "clinic-place-id",
  "appointmentDateTime": "Timestamp",
  "serviceCategory": "Doctor Consultation",
  "serviceType": "General Consultation",
  "status": "upcoming",
  "additionalInfo": "",
  "createdAt": "Timestamp"
}

clinics β€” Cached clinic data from Geoapify

{
  "properties": {
    "name": "Clinic Name",
    "place_id": "geoapify-place-id",
    "address_line2": "Address",
    "opening_hours": "Mo-Fr 09:00-18:00",
    "contact": { "phone": "+65...", "email": "..." },
    "facilities": { "wheelchair": true }
  },
  "geometry": { "coordinates": [103.8, 1.3] }
}

API Keys & Services

The application integrates with multiple third-party services:

ServicePurposeGet Key
Google GeminiAI chat & image analysisAI Studio
GeoapifyClinic location dataGeoapify
ResendEmail notificationsResend
CloudinaryProfile image hostingCloudinary
FirebaseAuthentication & DatabaseFirebase Console

Getting Started

  1. Clone the repository:
git clone https://github.com/yourusername/Healthify.git
cd Healthify
  1. Install dependencies:
flutter pub get
  1. Create a .env file:
GEMINI_API_KEY=your_gemini_api_key_here
GEOAPIFY_API_KEY=your_geoapify_api_key_here
RESEND_API_KEY=your_resend_api_key_here
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_UPLOAD_PRESET=your_cloudinary_upload_preset
  1. Configure Firebase (Authentication + Firestore)

  2. Run the app:

flutter run

Project Structure

lib/
β”œβ”€β”€ main.dart                    # App entry point, theme configuration, routes
β”œβ”€β”€ firebase_options.dart        # Firebase configuration
β”‚
β”œβ”€β”€ models/                      # Data models
β”‚   β”œβ”€β”€ app_user.dart           # User profile with theme preferences
β”‚   β”œβ”€β”€ appointment.dart        # Appointment with clinic reference
β”‚   β”œβ”€β”€ appointment_data.dart   # Service categories and time slots
β”‚   β”œβ”€β”€ clinic.dart             # Clinic with Geoapify JSON parsing
β”‚   β”œβ”€β”€ gemini_appointment.dart # AI-extracted appointment intent
β”‚   β”œβ”€β”€ opening_hours.dart      # OSM opening hours parser
β”‚   β”œβ”€β”€ settings_item.dart      # Settings list item model
β”‚   └── theme_colors.dart       # Available theme color palette
β”‚
β”œβ”€β”€ screens/                     # UI screens
β”‚   β”œβ”€β”€ appointments_screen.dart    # View/manage appointments
β”‚   β”œβ”€β”€ clinics_screen.dart         # Map + clinic discovery
β”‚   β”œβ”€β”€ health_assistant.dart       # AI chat interface
β”‚   β”œβ”€β”€ home.dart                   # Dashboard with steps, shortcuts
β”‚   β”œβ”€β”€ login_screen.dart           # Firebase authentication
β”‚   β”œβ”€β”€ make_appointments_screen.dart # Booking workflow
β”‚   β”œβ”€β”€ onboarding_screen.dart      # First-time user intro
β”‚   β”œβ”€β”€ settings.dart               # App settings & profile
β”‚   └── update_app_user_screen.dart # Profile editor
β”‚
β”œβ”€β”€ utilities/                   # Backend services
β”‚   β”œβ”€β”€ firebase_calls.dart     # Firestore CRUD, auth, themes
β”‚   β”œβ”€β”€ geoapify_calls.dart     # Clinic API integration
β”‚   └── status_bar_utils.dart   # System UI styling
β”‚
└── widgets/                     # Reusable components
    β”œβ”€β”€ bottom_navigation_bar.dart
    β”œβ”€β”€ appointments/           # Appointment list widgets
    β”œβ”€β”€ clinics/               # Map, search bar, dialogs
    β”œβ”€β”€ home/                  # App bar, search, steps card, schedule
    └── make_appointments/     # Booking flow components

Outcome

Healthify demonstrates a practical integration of AI, maps, and secure user management to deliver a simple, end-to-end healthcare workflow β€” from asking questions to finding a clinic and booking an appointment.