AI-Powered Healthcare at Your Fingertips
A comprehensive Flutter mobile application that bridges the gap between patients and healthcare services using artificial intelligence and real-time data management.
- Overview
- Features
- Prerequisites
- Installation
- Configuration
- Project Structure
- Usage
- Architecture
- Contributing
- License
- Support
Digital Healthcare Assistance is a modern healthcare management application built with Flutter and Firebase. It leverages AI-powered symptom analysis using the Groq API to provide preliminary health assessments, helps users find and book appointments at hospitals, manage bed reservations, and streamlines healthcare staff workflows.
The application is designed with a multi-user architecture supporting:
- Patients - Access healthcare services and symptom analysis
- Healthcare Staff - Manage patient appointments and bed allocations
- Administrators - Oversee system operations and hospital management
- Email/Password registration and login
- Firebase Authentication integration
- Secure session management
- User role-based access control (Patient, Staff, Admin)
- AI-powered symptom analysis using Groq LLaMA 3.3 70B model
- Real-time health assessment recommendations
- Structured JSON output for consistent results
- Free Tier: 30 requests/minute, 14,400 requests/day
- Browse available hospitals
- View hospital details, specializations, and ratings
- Real-time bed availability tracking
- Hospital search and filtering
- Easy-to-use appointment scheduling
- View available time slots
- Appointment confirmation and tracking
- Manage active and past appointments
- Reserve hospital beds
- Check real-time bed availability
- Manage bed reservations
- Emergency bed allocation
- Personalized patient dashboard
- Quick access to health records
- Appointment and booking history
- Emergency assistance button
- One-tap emergency alerts
- Nearby hospital location
- Emergency contact integration
Before you begin, ensure you have the following installed:
-
Flutter SDK (v3.9.2 or higher)
- Download from flutter.dev
- Run
flutter --versionto verify
-
Dart SDK (v3.9.2 or higher) - Included with Flutter
-
Android Studio or Xcode for mobile emulation/development
- Android: SDK level 21 or higher
- iOS: iOS 11.0 or higher
-
Git for version control
-
Groq API Key (Free tier)
- Sign up at console.groq.com
- Create an API key from the dashboard
-
Firebase Project Setup
- Create a project on Firebase Console
- Enable Authentication (Email/Password)
- Enable Cloud Firestore
- Download configuration files
git clone https://github.com/asadullah098/digital-healthcare-assistance.git
cd digital-healthcare-assistanceflutter pub getflutter pub run build_runner buildflutter doctorEnsure all required components are installed. Fix any issues reported.
For Android:
cd android
./gradlew build
cd ..For iOS:
cd ios
pod install
cd ..-
Create a Firebase Project
- Go to Firebase Console
- Click "Create Project"
- Follow the setup wizard
-
Configure Android
- Download
google-services.jsonfrom Firebase Console - Place it in
android/app/ - Ensure this file is in
.gitignorefor security
- Download
-
Configure iOS
- Download
GoogleService-Info.plistfrom Firebase Console - Add it to your iOS project using Xcode
- Add to
.gitignorefor security
- Download
-
Enable Firebase Services
- Authentication โ Enable Email/Password provider
- Cloud Firestore โ Enable with appropriate security rules
- Storage (Optional) โ For user profile pictures
-
Get Your API Key
# Visit https://console.groq.com/keys # Sign up or log in # Create an API key
-
Set Environment Variable
For Development:
flutter run --dart-define=GROQ_API_KEY=your_actual_key_here
Using .env File (Local Development Only):
- Create a
.envfile in the project root:
GROQ_API_KEY=your_actual_key_here- Add to
.gitignore:
.env .env.local- Load in your app using
flutter_dotenvpackage
- Create a
lib/
โโโ main.dart # Application entry point
โโโ models/ # Data models
โ โโโ appointment_model.dart
โ โโโ bed_booking_model.dart
โ โโโ hospital_model.dart
โ โโโ symptom_analysis_model.dart
โ โโโ user_model.dart
โโโ providers/ # State management (Riverpod)
โ โโโ auth_provider.dart
โ โโโ booking_provider.dart
โ โโโ hospital_provider.dart
โ โโโ symptom_provider.dart
โโโ screens/ # UI Screens
โ โโโ auth/ # Authentication screens
โ โโโ patient/ # Patient-specific screens
โ โโโ staff/ # Staff management screens
โ โโโ admin/ # Admin panel screens
โโโ services/ # Business logic & API calls
โ โโโ auth_service.dart
โ โโโ grok_api_service.dart # Groq API integration
โ โโโ hospital_service.dart
โโโ utils/ # Utilities & constants
โ โโโ app_theme.dart # Theme configuration
โ โโโ constants.dart # App constants
โโโ widgets/ # Reusable UI components
โ โโโ dashboard_card.dart
โโโ firebase_options.dart # Firebase configuration
android/ # Android native code
ios/ # iOS native code
test/ # Unit and widget tests
For Development:
# Run on connected device or emulator
flutter run
# With API key
flutter run --dart-define=GROQ_API_KEY=your_keyFor Release Build:
flutter build apk --release # Android APK
flutter build appbundle --release # Android App Bundle
flutter build ios --release # iOS (requires macOS)1. Patient Registration & Login
- Launch app โ Register with email/password
- Firebase authenticates and creates user profile
2. Symptom Analysis
- Go to "Symptom Analysis"
- Enter your symptoms
- AI analyzes and provides health recommendations
- View results and next steps
3. Hospital Search & Booking
- Search for hospitals by name/location
- View hospital details and ratings
- Book appointments for specific dates/times
- Confirm booking and receive confirmation
4. Bed Reservation
- Check available beds
- Select bed and duration
- Complete reservation
- Track reservation status
- Riverpod: Modern state management solution for Flutter
- Providers for auth, booking, hospitals, and symptom analysis
- Reactive updates across the UI
- Firebase Firestore: Real-time database
- Firebase Authentication: Secure user management
- Groq API: AI-powered symptom analysis
- MVVM-like architecture with Riverpod
- Separation of concerns (Services, Providers, UI)
- Reusable widgets and components
- HTTP Client: For Groq API calls
- Firebase SDKs: Real-time database operations
- JSON serialization/deserialization
- Never commit secrets to version control
- Use environment variables for API keys
- Enable Firestore Security Rules to restrict database access
- Implement Firebase Authentication for user verification
- Use HTTPS for all API communications
- Keep dependencies updated regularly
Key dependencies used in this project:
flutter:
sdk: flutter
flutter_riverpod: ^3.3.1 # State management
firebase_core: ^3.13.0 # Firebase core
firebase_auth: ^5.6.0 # Authentication
cloud_firestore: ^5.6.7 # Firestore database
http: ^1.6.0 # HTTP requests
google_fonts: ^8.0.2 # Custom fonts
intl: ^0.20.2 # Internationalization
shared_preferences: ^2.5.5 # Local storage
url_launcher: ^6.3.1 # URL handlingSee pubspec.yaml for complete list.
Contributions are welcome! To contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Dart style guide
- Write meaningful commit messages
- Test your changes before submitting PR
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- Report issues on GitHub
- Include detailed description and reproduction steps
- GitHub: @asadullah098
- Project Issues: GitHub Issues
- Push notifications for appointments
- Prescription digital management
- Video consultation support
- Multi-language support
- Offline mode capabilities
- Payment gateway integration
- Insurance verification
- Medical records export
- Flutter - UI framework
- Firebase - Backend services
- Groq - AI API
- Riverpod - State management
- All contributors and the open-source community
Made with โค๏ธ for better healthcare access
Last Updated: August 2026