# reviverkid/smartdoctorappointmentsystem architecture

> Architecture diagram of the GitHub repository reviverkid/smartdoctorappointmentsystem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/reviverkid/smartdoctorappointmentsystem
- Repository: https://github.com/reviverkid/smartdoctorappointmentsystem

## Overview

##### Main Components
- Presentation Layer: This is represented by the various Activities (MainActivity, SplashScreen, LoginActivity, DoctorMainActivity, PatientMainActivity, etc.), Fragments (DoctorFragments and PatientFragments), and UI Adapters that provide the user interface and handle user interactions.
- Business Logic / Controller Layer: Although not explicitly separated via packages, check the Java classes (such as the ReusableFunctionsAndObjects or DataRetrievalClass sub-packages) that handle core logic, data processing, and decision-making. This layer coordinates between the UI and data components.
- Data Layer & External Services: The project relies on Firebase (for authentication, real-time database, notifications) and perhaps Retrofit for network calls. Additionally, integration with Google Services (as seen in the google-services.json file) should be a part of this layer.
- External Libraries & UI Frameworks: Technologies like Glide for image handling and Material Design components should be represented as part of the supportive infrastructure that enhances the UI and performance.

##### Relationships and Interactions Between Components
- How the Presentation Layer interacts with the Business Logic/Controller layer (e.g., through Activities invoking helper classes and functions).
- How the adapters and fragments are used by Activities to render data retrieved from backend services.

##### Architectural Patterns and Design Principles
- Modularity by showing how different user roles (doctor, patient, admin) are managed via separate dashboards and flows.

##### Detailed Elements
- Each block/component should have a clear label (e.g., “Doctor Dashboard”, “Patient Appointment Management”).
- UI triggers -> Business logic controllers.
- Business logic -> Data retrieval/storage APIs.
- Push notifications directed from Firebase to device-level notification services.
- Android client components (Activities, Fragments)
- External services (Firebase, Google Services)
- Utility classes/adapters that bridge data and UI.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        subgraph "Activities"
            MA["MainActivity"]:::ui
            SS["SplashScreen"]:::ui
            LA["LoginActivity"]:::ui
            DMA["DoctorMainActivity"]:::ui
            PMA["PatientMainActivity"]:::ui
            DR["DoctorRegister"]:::ui
            PR["PatientRegister"]:::ui
            AD["AdminDashboard"]:::ui
            AL["AdminLogin"]:::ui
        end
        subgraph "Fragments"
            DF["DoctorFragments"]:::ui
            PF["PatientFragments"]:::ui
        end
        subgraph "Adapters"
            ADP["Adapters"]:::ui
        end
    end

    %% Business Logic / Controller Layer
    subgraph "Business Logic / Controller Layer"
        RFO["ReusableFunctionsAndObjects"]:::logic
        subgraph "Data Processing & Retrieval"
            DRC["DataRetrievalClass"]:::logic
        end
        ADisease["AddDisease"]:::logic
        CM["CreditMoney"]:::logic
        ADP2["AskDoctorPatient"]:::logic
    end

    %% Data Layer & External Services
    subgraph "Data Layer & External Services"
        FGS["Firebase & Google Services"]:::data
        GS["google-services.json"]:::data
    end

    %% Connections between layers
    %% Presentation to Business Logic interactions
    MA -->|"triggers"| RFO
    SS -->|"initializes"| RFO
    LA -->|"authenticates via"| RFO
    DMA -->|"manages"| DF
    PMA -->|"manages"| PF
    DF -->|"renders data"| ADP
    PF -->|"renders data"| ADP

    %% Business Logic interactions
    RFO -->|"calls"| DRC
    DRC -->|"fetches data from"| FGS
    ADisease -->|"updates"| DRC
    CM -->|"updates"| DRC
    ADP2 -->|"facilitates queries"| DRC

    %% External Services internal connection
    FGS -->|"contains"| GS

    %% Click Events - Presentation Layer Activities
    click MA "https://github.com/reviverkid/smartdoctorappointmentsystem/blob/master/app/src/main/java/thereviverkid/atwebpages/medcare/MainActivity.java"
    click SS "https://github.com/reviverkid/smartdoctorappointmentsystem/blob/master/app/src/main/java/thereviverkid/atwebpages/medcare/SplashScreen.java"
    click LA "https://github.com/reviverkid/smartdoctorappointmentsystem/blob/master/app/src/main/java/thereviverkid/atwebpages/medcare/LoginActivity.java"
    click DMA "https://github.com/reviverkid/smartdoctorappointmentsystem/blob/master/app/src/main/java/thereviverkid/atwebpages/medcare/DoctorMainActivity.java"
    click PMA "https://github.com/reviverkid/smartdoctorappointmentsystem/blob/master/app/src/main/java/thereviverkid/atwebpages/medcare/PatientMainActivity.java"
    click DR "https://github.com/reviverkid/smartdoctorappointmentsystem/blob/master/app/src/main/java/thereviverkid/atwebpages/medcare/DoctorRegister.java"
    click PR "https://github.com/reviverkid/smartdoctorappointmentsystem/blob/master/app/src/main/java/thereviverkid/atwebpages/medcare/PatientRegister.java"
    click AD "https://github.com/reviverkid/smartdoctorappointmentsystem/blob/master/app/src/main/java/thereviverkid/atwebpages/medcare/AdminDashboard.java"
    click AL "https://github.com/reviverkid/smartdoctorappointmentsystem/blob/master/app/src/main/java/thereviverkid/atwebpages/medcare/AdminLogin.java"

    %% Click Events - Presentation Layer Fragments
    click DF "https://github.com/reviverkid/smartdoctorappointmentsystem/tree/master/app/src/main/java/thereviverkid/atwebpages/medcare/DoctorFragments"
    click PF "https://github.com/reviverkid/smartdoctorappointmentsystem/tree/master/app/src/main/java/thereviverkid/atwebpages/medcare/PatientFragments"

    %% Click Events - Presentation Layer Adapters
    click ADP "https://github.com/reviverkid/smartdoctorappointmentsystem/tree/master/app/src/main/java/thereviverkid/atwebpages/medcare/Adapters"

    %% Click Events - Business Logic / Controller Layer
    click RFO "https://github.com/reviverkid/smartdoctorappointmentsystem/blob/master/app/src/main/java/thereviverkid/atwebpages/medcare/ReusableFunctionsAndObjects.java"
    click DRC "https://github.com/reviverkid/smartdoctorappointmentsystem/tree/master/app/src/main/java/thereviverkid/atwebpages/medcare/DataRetrievalClass"
    click ADisease "https://github.com/reviverkid/smartdoctorappointmentsystem/blob/master/app/src/main/java/thereviverkid/atwebpages/medcare/AddDisease.java"
    click CM "https://github.com/reviverkid/smartdoctorappointmentsystem/blob/master/app/src/main/java/thereviverkid/atwebpages/medcare/CreditMoney.java"
    click ADP2 "https://github.com/reviverkid/smartdoctorappointmentsystem/blob/master/app/src/main/java/thereviverkid/atwebpages/medcare/AskDoctorPatient.java"

    %% Click Events - Data Layer & External Services
    click GS "https://github.com/reviverkid/smartdoctorappointmentsystem/blob/master/app/google-services.json"

    %% Styles
    classDef ui fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef logic fill:#A9DFBF,stroke:#145A32,stroke-width:2px;
    classDef data fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
```
