# ashishpalttn/wecare architecture

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

- Interactive diagram: https://gitdiagram.com/ashishpalttn/wecare
- Repository: https://github.com/ashishpalttn/wecare

## Overview

##### Main Application Architecture Layer
- Redux Store (noticed in src/store) as a central state management component
- Main routing system (indicated by routesConfig.js)
- Theme configuration (themeConfig.js)

##### Component Layer
Create three main sections:

a. Core Components:
- ClippedDrawer (Navigation)
- PrimarySearchAppBar (Header)
- EnhancedTable (Reusable table component)
- TextField (Form input component)
- Link (Navigation component)

b. Feature Modules:
- Doctor Management Module
- Doctor
- View Doctors
- Patient Management Module
- Patient
- View Patient
- Reports Module
- Report
- View Report

c. State Management:
- Redux Store
- Dashboard Slice
- Counter Slice

##### Data Flow Layer
- How components interact with Redux store
- Routing flow between pages
- Component hierarchy

##### Component Hierarchy
- App
- PrimarySearchAppBar
- ClippedDrawer
- Main Content Area
- Doctor Management
- Patient Management
- Reports

##### State Management Flow
- Redux store as central state
- Slices connecting to respective features
- Action dispatches and state updates

##### Routing Structure
- Main routes configuration
- Navigation between features
- Error page handling

Level of Detail:
- Component composition
- State management flow
- Routing structure

Additional Considerations:

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Main
        App["React Application"]:::main
        click App "https://github.com/ashishpalttn/weCare/blob/develop/src/App.js"
        Store["Redux Store"]:::store
        click Store "https://github.com/ashishpalttn/weCare/blob/develop/src/store/index.js"
        Routes["Routing System"]:::config
        click Routes "https://github.com/ashishpalttn/weCare/blob/develop/src/config/routesConfig.js"
        Theme["Theme Config"]:::config
        click Theme "https://github.com/ashishpalttn/weCare/blob/develop/src/config/themeConfig.js"
    end

    subgraph CoreComponents
        Nav["ClippedDrawer"]:::core
        click Nav "https://github.com/ashishpalttn/weCare/blob/develop/src/components/ClippedDrawer/index.jsx"
        Header["PrimarySearchAppBar"]:::core
        click Header "https://github.com/ashishpalttn/weCare/blob/develop/src/components/PrimarySearchAppBar/index.jsx"
        Table["EnhancedTable"]:::core
        click Table "https://github.com/ashishpalttn/weCare/blob/develop/src/components/EnhancedTable/index.js"
        Input["TextField"]:::core
        click Input "https://github.com/ashishpalttn/weCare/blob/develop/src/components/TextField/index.jsx"
        LinkComp["Link"]:::core
        click LinkComp "https://github.com/ashishpalttn/weCare/blob/develop/src/components/Link/index.jsx"
    end

    subgraph FeatureModules
        subgraph DoctorModule
            AddDoc["Add Doctor"]:::feature
            click AddDoc "https://github.com/ashishpalttn/weCare/blob/develop/src/pages/doctor/addDoctor/index.js"
            ViewDoc["View Doctors"]:::feature
            click ViewDoc "https://github.com/ashishpalttn/weCare/blob/develop/src/pages/doctor/viewDoctors/index.js"
        end

        subgraph PatientModule
            AddPat["Add Patient"]:::feature
            click AddPat "https://github.com/ashishpalttn/weCare/blob/develop/src/pages/patient/addPatient/index.js"
            ViewPat["View Patient"]:::feature
            click ViewPat "https://github.com/ashishpalttn/weCare/blob/develop/src/pages/patient/viewPatient/index.js"
        end

        subgraph ReportsModule
            AddRep["Add Report"]:::feature
            click AddRep "https://github.com/ashishpalttn/weCare/blob/develop/src/pages/reports/addReport/index.js"
            ViewRep["View Report"]:::feature
            click ViewRep "https://github.com/ashishpalttn/weCare/blob/develop/src/pages/reports/viewReport/index.js"
        end
    end

    subgraph StateManagement
        DashSlice["Dashboard Slice"]:::state
        click DashSlice "https://github.com/ashishpalttn/weCare/blob/develop/src/store/slices/dashboardSlice.js"
        CountSlice["Counter Slice"]:::state
        click CountSlice "https://github.com/ashishpalttn/weCare/blob/develop/src/store/slices/counterSlice.js"
    end

    subgraph ErrorHandling
        ErrorPage["Error Page"]:::error
        click ErrorPage "https://github.com/ashishpalttn/weCare/blob/develop/src/pages/errorPage/index.js"
    end

    RootPage["Root Page"]:::main
    click RootPage "https://github.com/ashishpalttn/weCare/blob/develop/src/pages/Rootpage.jsx"

    %% Connections
    App --> Store
    App --> Routes
    App --> Theme
    App --> RootPage

    Store --> DashSlice
    Store --> CountSlice

    RootPage --> Nav
    RootPage --> Header

    Nav -.-> DoctorModule
    Nav -.-> PatientModule
    Nav -.-> ReportsModule

    DoctorModule --> Table
    PatientModule --> Table
    ReportsModule --> Table

    AddDoc & AddPat & AddRep --> Input
    ViewDoc & ViewPat & ViewRep --> LinkComp

    Routes -.-> ErrorPage

    %% Styles
    classDef main fill:#f9f,stroke:#333,stroke-width:2px
    classDef store fill:#9f9,stroke:#333,stroke-width:2px
    classDef config fill:#999,stroke:#333,stroke-width:2px
    classDef core fill:#69f,stroke:#333,stroke-width:2px
    classDef feature fill:#6f9,stroke:#333,stroke-width:2px
    classDef state fill:#96f,stroke:#333,stroke-width:2px
    classDef error fill:#f66,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["Main Components"]:::main
        L2["Store"]:::store
        L3["Configuration"]:::config
        L4["Core Components"]:::core
        L5["Feature Modules"]:::feature
        L6["State Management"]:::state
        L7["Error Handling"]:::error
    end
```
