# bhardwajabhi/doctriod-client-app architecture

> Architecture diagram of the GitHub repository bhardwajabhi/doctriod-client-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhardwajabhi/doctriod-client-app
- Repository: https://github.com/bhardwajabhi/doctriod-client-app

## Overview

##### Main System Components

a) Client Layer (Android App)
- UI Components (Activities and Fragments)
- Services Layer
- Data Management Layer

b) External Services Integration
- Location Services (for nearby facilities)
- Firebase Services (for notifications)
- Chat Bot System (Virtual Doctor)
- Emergency Services Integration

##### Architectural Components Breakdown

a) Core Features Modules:
- Appointment Management
- Emergency Detection System
- Virtual Doctor (Chat Bot)
- Medicine Recognition
- Reminder System
- Nearby Places Finder

b) Supporting Modules:
- User Authentication
- Profile Management
- Notification System
- Prescription Management

##### Data Flow Representation

Following interactions:

a) User Authentication Flow:
- Login/Signup → Firebase Auth → User Profile

b) Appointment Booking Flow:
- Doctor Selection → Time Slot Selection → Booking Confirmation → Notification

c) Emergency Detection Flow:
- Sensor Data → Accident Detection → Emergency Contact Notification

##### Technical Implementation Details

Technical aspects:

a) Android Components:
- Activities
- Services (ShakeService, AlarmService)
- BroadcastReceivers
- ContentProviders

b) External APIs:
- Google Maps API (for nearby places)
- Firebase Cloud Messaging
- Custom REST APIs

##### Key Relationships to Highlight

- User Authentication → Profile Management
- Location Services → Nearby Facilities
- Sensor Data → Emergency Detection
- Reminder System → Local Database
- Virtual Doctor → Chat Interface

##### External Services Layer

Keep the abstraction level high enough to understand the system architecture but detailed enough to show the unique features like accident detection and virtual doctor integration.

This system design should emphasize the mobile-first architecture while showing how different components interact to provide a comprehensive healthcare solution.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef ui fill:#2196F3,color:white
    classDef service fill:#4CAF50,color:white
    classDef data fill:#FFC107,color:black
    classDef api fill:#FF5252,color:white
    classDef legend fill:#E0E0E0,color:black

    %% Legend
    subgraph Legend
        L1[UI Components]:::ui
        L2[Services]:::service
        L3[Data Storage]:::data
        L4[External APIs]:::api
    end

    %% Main Application Layers
    subgraph "Client Layer"
        UI[Home Interface]:::ui
        click UI "https://github.com/bhardwajAbhi/Doctriod-Client-App/tree/master/app/src/main/java/apps/abhibhardwaj/com/doctriod/patient/home/"
    end

    subgraph "Core Features"
        AppointmentMgmt[Appointment Management]:::ui
        EmergencySystem[Emergency Detection System]:::service
        VirtualDoc[Virtual Doctor]:::service
        MedRecognition[Medicine Recognition]:::service
        ReminderSys[Reminder System]:::service
        NearbyFinder[Nearby Places Finder]:::service

        click AppointmentMgmt "https://github.com/bhardwajAbhi/Doctriod-Client-App/tree/master/app/src/main/java/apps/abhibhardwaj/com/doctriod/patient/appointments/"
        click EmergencySystem "https://github.com/bhardwajAbhi/Doctriod-Client-App/tree/master/app/src/main/java/apps/abhibhardwaj/com/doctriod/patient/emergency/"
        click VirtualDoc "https://github.com/bhardwajAbhi/Doctriod-Client-App/tree/master/app/src/main/java/apps/abhibhardwaj/com/doctriod/patient/vdoctor/"
        click MedRecognition "https://github.com/bhardwajAbhi/Doctriod-Client-App/tree/master/app/src/main/java/apps/abhibhardwaj/com/doctriod/patient/recognizemeds/"
        click ReminderSys "https://github.com/bhardwajAbhi/Doctriod-Client-App/tree/master/app/src/main/java/apps/abhibhardwaj/com/doctriod/patient/reminder/"
        click NearbyFinder "https://github.com/bhardwajAbhi/Doctriod-Client-App/tree/master/app/src/main/java/apps/abhibhardwaj/com/doctriod/patient/nearby/"
    end

    subgraph "Supporting Modules"
        Auth[User Authentication]:::service
        Profile[Profile Management]:::ui
        Notifications[Notification System]:::service
        Prescriptions[Prescription Management]:::ui

        click Auth "https://github.com/bhardwajAbhi/Doctriod-Client-App/tree/master/app/src/main/java/apps/abhibhardwaj/com/doctriod/patient/startup/"
        click Profile "https://github.com/bhardwajAbhi/Doctriod-Client-App/tree/master/app/src/main/java/apps/abhibhardwaj/com/doctriod/patient/profile/"
        click Notifications "https://github.com/bhardwajAbhi/Doctriod-Client-App/tree/master/app/src/main/java/apps/abhibhardwaj/com/doctriod/patient/notifications/"
        click Prescriptions "https://github.com/bhardwajAbhi/Doctriod-Client-App/tree/master/app/src/main/java/apps/abhibhardwaj/com/doctriod/patient/prescription/"
    end

    subgraph "Data Layer"
        Models[Data Models]:::data
        LocalDB[(Local Database)]:::data
        
        click Models "https://github.com/bhardwajAbhi/Doctriod-Client-App/tree/master/app/src/main/java/apps/abhibhardwaj/com/doctriod/patient/models/"
    end

    subgraph "External Services"
        Firebase[Firebase Services]:::api
        Maps[Google Maps API]:::api
        ChatBot[Chat Bot API]:::api
        EmergencyAPI[Emergency Services API]:::api
    end

    %% Relationships
    UI --> AppointmentMgmt
    UI --> EmergencySystem
    UI --> VirtualDoc
    UI --> MedRecognition
    UI --> ReminderSys
    UI --> NearbyFinder

    Auth --> Firebase
    Auth --> Profile
    Profile --> Models
    
    NearbyFinder --> Maps
    VirtualDoc --> ChatBot
    EmergencySystem --> EmergencyAPI
    EmergencySystem --> Notifications
    
    AppointmentMgmt --> LocalDB
    ReminderSys --> LocalDB
    Prescriptions --> LocalDB
    
    Notifications --> Firebase
    
    Models --> LocalDB
```
