# santoshyalawar-hub/medcore architecture

> Architecture diagram of the GitHub repository santoshyalawar-hub/medcore, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/santoshyalawar-hub/medcore
- Repository: https://github.com/santoshyalawar-hub/medcore

## Overview

MedCore HMS is a multi-tenant hospital-management frontend with a simulated backend, not a production-secure server. The user journey begins at the public hospital-discovery and registration site or login, then enters a role- and tenant-scoped workspace. There, the module router presents clinical, administrative, and platform-owner capabilities; data modules use a shared HTTP client. The README describes browser-localStorage-backed simulation, but its mock implementation files are absent from the supplied tree, so that layer and its connections are not mapped.

Main entry points: [`src/features/modules/ModulePage.jsx`](https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/modules/ModulePage.jsx) (Workspace module router), [`src/app/App.jsx`](https://github.com/santoshyalawar-hub/medcore/blob/main/src/app/App.jsx) (App router and guards), [`src/layouts/parts.jsx`](https://github.com/santoshyalawar-hub/medcore/blob/main/src/layouts/parts.jsx) (Role-specific layouts), [`src/core/auth/AuthContext.jsx`](https://github.com/santoshyalawar-hub/medcore/blob/main/src/core/auth/AuthContext.jsx) (Authentication context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and routing"]
  node_public["Public site<br/>[Home.jsx]"]
  node_discovery["Hospital discovery<br/>[Discovery.jsx]"]
  node_publicforms["Public forms<br/>[Forms.jsx]"]
  node_route["App router and guards<br/>[App.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_login["Login<br/>[Login.jsx]"]
  node_auth["Authentication context<br/>[AuthContext.jsx]"]
  node_access["Role and feature access<br/>[rbac.js]"]
end

subgraph group_workspaces["Hospital workspaces"]
  node_workspace["Role-specific layouts<br/>[parts.jsx]"]
  node_module_router["Workspace module router<br/>[ModulePage.jsx]"]
  node_clinical["Clinical and patient care<br/>[MyAppointments.jsx]"]
  node_records["Configurable records<br/>[DataModule.jsx]"]
  node_dashboard["Role dashboards<br/>[Dashboard.jsx]"]
  node_staff["Employees and setup<br/>[EmployeesPage.jsx]"]
  node_insights["AI and automation<br/>[AiInsightsPage.jsx]"]
  node_subscription["Subscription management"]
end

subgraph group_platform["SaaS platform management"]
  node_platform_ops["Platform administration<br/>[PlatformPages.jsx]"]
end

subgraph group_shared["Shared application services"]
  node_http["HTTP client<br/>[http.js]"]
  node_notifications["Notifications<br/>[NotifyContext.jsx]"]
  node_toast["Toast feedback<br/>[ToastContext.jsx]"]
end

node_visitor(("Visitor or user"))
node_browser_store[("Browser local storage")]

node_visitor -->|"visits"| node_public
node_public -->|"routes to"| node_discovery
node_public -->|"routes to"| node_publicforms
node_visitor -->|"signs in"| node_login
node_login -->|"calls login"| node_auth
node_auth -.->|"loads session data"| node_browser_store
node_auth -->|"sets API context"| node_http
node_route -->|"checks user"| node_auth
node_route -->|"checks workspace"| node_access
node_route -->|"routes unauthenticated"| node_login
node_route -->|"renders layout"| node_workspace
node_workspace -->|"builds navigation"| node_access
node_workspace -->|"shows unread count"| node_notifications
node_workspace -.->|"routes modules"| node_module_router
node_module_router -->|"renders tables"| node_records
node_module_router -->|"renders patient care"| node_clinical
node_module_router -->|"renders dashboard"| node_dashboard
node_module_router -->|"renders staff pages"| node_staff
node_module_router -->|"renders insights"| node_insights
node_module_router -->|"renders subscription"| node_subscription
node_module_router -->|"renders platform pages"| node_platform_ops
node_records -->|"requests data"| node_http
node_platform_ops -.->|"uses simulated data"| node_browser_store
node_notifications -.->|"uses simulated data"| node_browser_store

click node_public "https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/public/Home.jsx"
click node_discovery "https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/public/Discovery.jsx"
click node_publicforms "https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/public/Forms.jsx"
click node_login "https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/auth/Login.jsx"
click node_auth "https://github.com/santoshyalawar-hub/medcore/blob/main/src/core/auth/AuthContext.jsx"
click node_access "https://github.com/santoshyalawar-hub/medcore/blob/main/src/core/rbac.js"
click node_route "https://github.com/santoshyalawar-hub/medcore/blob/main/src/app/App.jsx"
click node_workspace "https://github.com/santoshyalawar-hub/medcore/blob/main/src/layouts/parts.jsx"
click node_module_router "https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/modules/ModulePage.jsx"
click node_clinical "https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/patient/MyAppointments.jsx"
click node_records "https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/modules/DataModule.jsx"
click node_dashboard "https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/dashboard/Dashboard.jsx"
click node_staff "https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/employees/EmployeesPage.jsx"
click node_insights "https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/ai/AiInsightsPage.jsx"
click node_subscription "https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/subscription/SubscriptionPage.jsx"
click node_platform_ops "https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/platform/PlatformPages.jsx"
click node_http "https://github.com/santoshyalawar-hub/medcore/blob/main/src/core/api/http.js"
click node_notifications "https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/notifications/NotifyContext.jsx"
click node_toast "https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/notifications/ToastContext.jsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_public,node_discovery,node_publicforms,node_route,node_visitor toneBlue
class node_login,node_auth,node_access,node_browser_store toneAmber
class node_workspace,node_module_router,node_clinical,node_records,node_dashboard,node_staff,node_insights,node_subscription toneMint
class node_platform_ops toneRose
class node_http,node_notifications,node_toast toneIndigo
```

## Components

### Entry and routing

- [Public site](https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/public/Home.jsx): `src/features/public/Home.jsx`
- [Hospital discovery](https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/public/Discovery.jsx): `src/features/public/Discovery.jsx`
- [Public forms](https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/public/Forms.jsx): `src/features/public/Forms.jsx`
- [App router and guards](https://github.com/santoshyalawar-hub/medcore/blob/main/src/app/App.jsx): `src/app/App.jsx`

### Identity and access

- [Login](https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/auth/Login.jsx): `src/features/auth/Login.jsx`
- [Authentication context](https://github.com/santoshyalawar-hub/medcore/blob/main/src/core/auth/AuthContext.jsx): `src/core/auth/AuthContext.jsx`
- [Role and feature access](https://github.com/santoshyalawar-hub/medcore/blob/main/src/core/rbac.js): `src/core/rbac.js`

### Hospital workspaces

- [Role-specific layouts](https://github.com/santoshyalawar-hub/medcore/blob/main/src/layouts/parts.jsx): `src/layouts/parts.jsx`
- [Workspace module router](https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/modules/ModulePage.jsx): `src/features/modules/ModulePage.jsx`
- [Clinical and patient care](https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/patient/MyAppointments.jsx): `src/features/patient/MyAppointments.jsx`
- [Configurable records](https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/modules/DataModule.jsx): `src/features/modules/DataModule.jsx`
- [Role dashboards](https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/dashboard/Dashboard.jsx): `src/features/dashboard/Dashboard.jsx`
- [Employees and setup](https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/employees/EmployeesPage.jsx): `src/features/employees/EmployeesPage.jsx`
- [AI and automation](https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/ai/AiInsightsPage.jsx): `src/features/ai/AiInsightsPage.jsx`
- [Subscription management](https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/subscription/SubscriptionPage.jsx): `src/features/subscription/SubscriptionPage.jsx`

### SaaS platform management

- [Platform administration](https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/platform/PlatformPages.jsx): `src/features/platform/PlatformPages.jsx`

### Shared application services

- [HTTP client](https://github.com/santoshyalawar-hub/medcore/blob/main/src/core/api/http.js): `src/core/api/http.js`
- [Notifications](https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/notifications/NotifyContext.jsx): `src/features/notifications/NotifyContext.jsx`
- [Toast feedback](https://github.com/santoshyalawar-hub/medcore/blob/main/src/features/notifications/ToastContext.jsx): `src/features/notifications/ToastContext.jsx`

### Other components

- **Visitor or user**
- **Browser local storage**

## Connections

- Visitor or user → Public site: visits
- Public site → Hospital discovery: routes to (evidence: `src/app/App.jsx`)
- Public site → Public forms: routes to (evidence: `src/app/App.jsx`)
- Visitor or user → Login: signs in
- Login → Authentication context: calls login (evidence: `src/features/auth/Login.jsx`)
- Authentication context → Browser local storage: loads session data (evidence: `README.md`)
- Authentication context → HTTP client: sets API context (evidence: `src/core/auth/AuthContext.jsx`)
- App router and guards → Authentication context: checks user (evidence: `src/app/App.jsx`)
- App router and guards → Role and feature access: checks workspace (evidence: `src/app/App.jsx`)
- App router and guards → Login: routes unauthenticated (evidence: `src/app/App.jsx`)
- App router and guards → Role-specific layouts: renders layout (evidence: `src/app/App.jsx`)
- Role-specific layouts → Role and feature access: builds navigation (evidence: `src/layouts/parts.jsx`)
- Role-specific layouts → Notifications: shows unread count (evidence: `src/layouts/parts.jsx`)
- Role-specific layouts → Workspace module router: routes modules
- Workspace module router → Configurable records: renders tables (evidence: `src/features/modules/ModulePage.jsx`)
- Workspace module router → Clinical and patient care: renders patient care (evidence: `src/features/modules/ModulePage.jsx`)
- Workspace module router → Role dashboards: renders dashboard (evidence: `src/features/modules/ModulePage.jsx`)
- Workspace module router → Employees and setup: renders staff pages (evidence: `src/features/modules/ModulePage.jsx`)
- Workspace module router → AI and automation: renders insights (evidence: `src/features/modules/ModulePage.jsx`)
- Workspace module router → Subscription management: renders subscription (evidence: `src/features/modules/ModulePage.jsx`)
- Workspace module router → Platform administration: renders platform pages (evidence: `src/features/modules/ModulePage.jsx`)
- Configurable records → HTTP client: requests data (evidence: `src/features/modules/DataModule.jsx`)
- Platform administration → Browser local storage: uses simulated data (evidence: `README.md`)
- Notifications → Browser local storage: uses simulated data (evidence: `README.md`)
