# sumilsuthar197/medicure-app architecture

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

- Interactive diagram: https://gitdiagram.com/sumilsuthar197/medicure-app
- Repository: https://github.com/sumilsuthar197/medicure-app

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) Client Layer
- Patient Module
- Doctor Module
- Shared Components
- Navigation System

b) State Management Layer
- Context Providers
- Data Flow Management

##### Architectural Pattern Representation

**[Client Layer]**

- [Navigation Container]
- Patient Routes
- Doctor Routes

- [Context Layer]
- PatientProfileProvider
- DoctorProfileProvider

- [Component Layer]
- Shared Components
- Module-Specific Components

##### Detailed Component Breakdown

a) Patient Module (Blue Components):
- Profile Management
- Doctor Search
- Hospital Search
- Appointment Booking
- Chat System
- Explore Feature

b) Doctor Module (Green Components):
- Profile Management
- Leave Management
- Emergency Services
- Patient Management
- Appointment Overview

c) Shared Components (Gray Components):
- Custom Buttons
- Cards
- Pickers
- Rating System
- Error Handling

##### Data Flow Representation

- User authentication flow
- Appointment booking process
- Profile data management
- State updates through context

##### Key Technical Elements

- Expo Framework integration
- Navigation structure (using _layout.js files)
- Context API implementation
- Component reusability paths

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        direction TB
        Nav["Navigation Container"]
        
        subgraph PatientSection
            direction TB
            PM["Patient Module"]:::patient
            PS["Profile Management"]:::patient
            DS["Doctor Search"]:::patient
            HS["Hospital Search"]:::patient
            AB["Appointment Booking"]:::patient
            CS["Chat System"]:::patient
            EF["Explore Feature"]:::patient
        end

        subgraph DoctorSection
            direction TB
            DM["Doctor Module"]:::doctor
            DPM["Profile Management"]:::doctor
            LM["Leave Management"]:::doctor
            ES["Emergency Services"]:::doctor
            PAM["Patient Management"]:::doctor
        end

        subgraph SharedComponents
            direction TB
            CB["Custom Buttons"]:::shared
            Cards["Cards"]:::shared
            Pickers["Pickers"]:::shared
            RS["Rating System"]:::shared
            EH["Error Handling"]:::shared
        end
    end

    subgraph StateManagement
        direction TB
        PProv["Patient Profile Provider"]:::context
        DProv["Doctor Profile Provider"]:::context
    end

    subgraph Navigation
        direction TB
        RN["Root Navigation"]:::nav
        PN["Patient Navigation"]:::nav
        DN["Doctor Navigation"]:::nav
    end

    subgraph Onboarding
        direction TB
        IS["Initial Screen"]:::onboard
        GS["Get Started"]:::onboard
    end

    %% Connections
    Nav --> PatientSection
    Nav --> DoctorSection
    PProv --> PatientSection
    DProv --> DoctorSection
    SharedComponents --> PatientSection
    SharedComponents --> DoctorSection
    IS --> GS
    GS --> Nav

    %% Click Events
    click PM "https://github.com/SumilSuthar197/Medicure-App/tree/master/app/Patient/"
    click DM "https://github.com/SumilSuthar197/Medicure-App/tree/master/app/Doctor/"
    click PProv "https://github.com/SumilSuthar197/Medicure-App/blob/master/context/PatientProfileProvider.js"
    click DProv "https://github.com/SumilSuthar197/Medicure-App/blob/master/context/DoctorProfileProvider.js"
    click RN "https://github.com/SumilSuthar197/Medicure-App/blob/master/app/_layout.js"
    click PN "https://github.com/SumilSuthar197/Medicure-App/blob/master/app/Patient/_layout.js"
    click DN "https://github.com/SumilSuthar197/Medicure-App/blob/master/app/Doctor/_layout.js"
    click PS "https://github.com/SumilSuthar197/Medicure-App/blob/master/app/Patient/Profile.js"
    click DS "https://github.com/SumilSuthar197/Medicure-App/blob/master/app/Patient/DoctorSearch.js"
    click HS "https://github.com/SumilSuthar197/Medicure-App/blob/master/app/Patient/HospitalSearch.js"
    click AB "https://github.com/SumilSuthar197/Medicure-App/blob/master/app/Patient/bookAppointment.js"
    click CS "https://github.com/SumilSuthar197/Medicure-App/blob/master/app/Patient/menu/chats.js"
    click EF "https://github.com/SumilSuthar197/Medicure-App/blob/master/app/Patient/menu/explore.js"
    click DPM "https://github.com/SumilSuthar197/Medicure-App/blob/master/app/Doctor/Doctormenu/DoctorProfile.js"
    click LM "https://github.com/SumilSuthar197/Medicure-App/blob/master/app/Doctor/Doctormenu/DoctorLeave.js"
    click ES "https://github.com/SumilSuthar197/Medicure-App/blob/master/app/Doctor/Emergency.js"
    click PAM "https://github.com/SumilSuthar197/Medicure-App/blob/master/app/Doctor/patientProfile.js"
    click CB "https://github.com/SumilSuthar197/Medicure-App/blob/master/components/CustomButton.js"
    click Cards "https://github.com/SumilSuthar197/Medicure-App/blob/master/components/AppointmentCard.js"
    click Pickers "https://github.com/SumilSuthar197/Medicure-App/blob/master/components/CustomPicker.js"
    click RS "https://github.com/SumilSuthar197/Medicure-App/blob/master/components/RatingCard.js"
    click EH "https://github.com/SumilSuthar197/Medicure-App/blob/master/components/ErrorPage.js"
    click IS "https://github.com/SumilSuthar197/Medicure-App/blob/master/app/onboarding.js"
    click GS "https://github.com/SumilSuthar197/Medicure-App/blob/master/app/getStarted.js"

    %% Styles
    classDef patient fill:#3498db,stroke:#2980b9,color:white
    classDef doctor fill:#2ecc71,stroke:#27ae60,color:white
    classDef shared fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef context fill:#e67e22,stroke:#d35400,color:white
    classDef nav fill:#9b59b6,stroke:#8e44ad,color:white
    classDef onboard fill:#f1c40f,stroke:#f39c12,color:black

    %% Legend
    subgraph Legend
        P[Patient Components]:::patient
        D[Doctor Components]:::doctor
        S[Shared Components]:::shared
        C[Context Providers]:::context
        N[Navigation]:::nav
        O[Onboarding]:::onboard
    end
```
