Skip to content

pavsoss/MediFlow

Repository files navigation

Google Solution Challenge 2026

MediFlow

AI-powered medical logistics platform focused on smart resource allocation

Flutter Firebase Gemini AI ORS


Table of Contents


Project Overview

MediFlow is an enterprise-grade medical logistics platform engineered to solve the "Last Mile" medical supply crisis. By combining Generative AI for demand forecasting with Heuristic Optimization for redistribution, MediFlow transforms a fragmented, reactive supply chain into a proactive, life-saving ecosystem, specifically targeting cold-chain pharmaceutical integrity.

The Problem | The Solution

The Crisis: Rural clinics often face 30% higher stockout rates for essential antibiotics, while urban hospitals simultaneously dispose of expired stock due to over-purchasing. This inequality is compounded by the lack of intelligent monitoring for cold-chain medicines (vaccines, insulin).

The MediFlow Solution: We don't just track inventory; we predict shortages before they happen and automate the movement of medicine from surplus hospitals to deficit clinics using road-accurate route optimization, ensuring that every life-saving resource is allocated where it’s needed most.


Core Feature Set

Hospital / Facility Module

Feature Detailed Description
Smart Logging Engine Atomically track daily usage while the system computes burn rates in real-time, ensuring zero data loss even in low-connectivity areas.
AI Forecasting (30-Day) Powered by Gemini-1.5-Flash, predicting seasonal spikes based on historical usage trends (e.g., ORS demand for summer) with a transparency-first "AI Reasoning" component.
Automated Request Drafting Intelligent auto-population of restock indents and redistribution offers based on AI predictions, reducing administrative overhead for clinic managers.
AI Chat Assistant A 24/7 logistics expert that facility managers can query for stock status, expiry alerts, or burn-rate insights using natural language.

Central Administration Module

Feature Detailed Description
Global Command Center Real-time regional oversight with deep-dive analytics into every facility's stock health, parity, and regional logistics KPIs.
Approval Pipeline A secure hub for regional admins to review, edit, and prioritize redistribution plans proposed by the optimization engine.
Interactive Logistics Map High-visibility markers distinguishing surplus sites from deficit clinics with integrated OSRM/ORS paths that calculate real-world travel time and distance.
Global Optimization A "Global Redistribution Plan" that matches thousands of shortage items to local surpluses in seconds using our proprietary matching logic.

Technical Architecture

Component Description
1. AI Engine (Gemini 1.5 Flash) We leverage Gemini's large context window to process months of anonymized usage logs. The model acts as a Predictive Reasoning Layer, identifying non-obvious patterns like demographic-based medicine consumption surges.
2. Optimization Heuristic (OTS) Our proprietary Optimal Transfer Score ensures that redistribution is both efficient and equitable:

$$OTS = (w_{dist} \cdot Proximity) + (w_{prior} \cdot RuralPriority) + (w_{qty} \cdot QtyMatch)$$

Proximity: Minimizes logistics cost and time.
Rural Priority: A weight multiplier ensuring that remote facilities are never "starved" by the algorithm.
3. Geospatial Routing System Integrated with flutter_map and OSRM/OpenRouteService, our routing engine decodes complex polylines to provide precise, road-accurate delivery paths, factoring in real-world geography.

Project Structure

lib/
├── constants/
│   └── colors.dart             # Project-wide design tokens & premium palette
│
├── models/                     # Immutable Data Domain
│   ├── daily_usage_log.dart    # Atomic snapshots of medicine consumption
│   ├── facility.dart           # Metadata & Geospatial profiles for nodes
│   ├── inventory_item.dart     # Stock tracking & expiry metadata
│   ├── request.dart            # Ledger for redistribution & restock flows
│   └── usage_log.dart          # Helper models for analytics visualization
│
├── services/                   # Business Logic & Intelligence Layer
│   ├── ai_service.dart         # Gemini-1.5-Flash forecasting & reasoning
│   ├── chat_service.dart       # NLP pipeline for the AI Assistant
│   ├── firebase_service.dart   # Firestore infrastructure & transactions
│   ├── optimization_service.dart # OTS heuristic & matching algorithm
│   ├── routing_service.dart    # Geospatial OSRM/ORS pathfinding logic
│   ├── simulation_service.dart # Real-time demo data generation engine
│   └── tool_dispatcher.dart    # AI tool-calling & data registry
│
├── views/                      # Presentation Layer (UI)
│   ├── admin/                  # Central Command Module
│   │   ├── admin_indent_approval_page.dart
│   │   ├── admin_indent_status_page.dart
│   │   ├── admin_overview.dart
│   │   └── route_optimization_map.dart
│   │
│   ├── auth/                   # Security & Role Gatekeeping
│   │   ├── login_screen.dart
│   │   └── role_selection_screen.dart
│   │
│   ├── facility/               # Local Management Module
│   │   ├── active_indents_page.dart
│   │   ├── ai_forecast_page.dart
│   │   ├── alerts_page.dart
│   │   ├── daily_logging_page.dart
│   │   ├── facility_overview.dart
│   │   └── indent_creation_page.dart
│   │
│   └── shared/                 # Common & Reusable Components
│       ├── ai_chat_page.dart
│       ├── help_page.dart
│       └── sidebar_layout.dart
│
├── firebase_options.dart       # Cross-platform Firebase configuration
└── main.dart                   # Application entry & Router configuration

Data & Schema

MediFlow utilizes a hierarchical Firestore schema designed for high-concurrency performance:

  • /facilities: Metadata, type (urban/rural), and geospatial coordinates.
  • /inventory/{fac_id}/medicines: Sub-collection tracking individual batches and live stock levels.
  • /requests: Global collection for tracking movement, status (Pending/Approved/Fulfilled), and manifest details.

🔑 Demo Credentials

Role Email ID Password Facility Type
CMS Admin admin@mediflow.com password123 Central Management
Facility Head rampur@mediflow.com password123 Rural PHC
Facility Head modinagar@mediflow.com password123 Urban CHC
Facility Head loni@mediflow.com password123 Urban PHC
Facility Head ghaziabad@mediflow.com password123 District Hospital
Facility Head bhojpur@mediflow.com password123 Rural PHC
Facility Head hapur@mediflow.com password123 Urban CHC
Facility Head dasna@mediflow.com password123 Rural PHC
Facility Head pilkhuwa@mediflow.com password123 Rural Sub-Centre

If the dashboard appears empty, use the "Seed DB" button on the Login/Role Selection screen to populate the database with demo records.


Development & Setup

Prerequisites

  • Flutter SDK (>=3.0.0)
  • Firebase Project
  • Google AI Studio API Key (Gemini)
  • OpenRouteService API Key

Quick Start

# 1. Clone & Install
git clone https://github.com/pavsoss/MediFlow.git && cd MediFlow
flutter pub get

# 2. Configure Environment
# Create .env and add:
# GEMINI_API_KEY=your_key
# ORS_API_KEY=your_key

# 3. Run Prototype
flutter run -d chrome --web-renderer html

Future Developments

  • Offline-First Sync: Native SQLite integration for zero-connectivity environments.
  • Batch Tracking: QR-code integration for granular tracking of individual medicine strips.
  • IoT Cold Chain: Integration with sensors to track temperature-sensitive vaccines during transit.

The Team

Built with ❤️ for the Google Solution Challenge 2026.

  • [Aarush Yadav]
  • [Paavni Bansal]
  • [Devansh Rana]
  • [Sharvi Singhal]

© 2026 MediFlow Team. Engineering a smarter, healthier supply chain.

About

MediFlow is an AI-powered medical logistics platform focused on smart resource allocation ensuring medicines are efficiently distributed based on real-time needs. By combining predictive forecasting, intelligent alerts, and optimized redistribution plans, it minimizes wastage and prevents stockouts, creating a proactive healthcare supply chain.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors