# darrylmagdalaga-bot/e-medics architecture

> Architecture diagram of the GitHub repository darrylmagdalaga-bot/e-medics, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/darrylmagdalaga-bot/e-medics
- Repository: https://github.com/darrylmagdalaga-bot/e-medics

## Overview

This is a web-based database POS dashboard with pharmacy and warehouse inventory workflows. Users sign in, then the app selects role- and page-specific screens for dashboard monitoring, dispensing, product and stock management, orders, customers, reports, and settings. The frontend screens reference centralized API configuration, while a separate Express server and SQL-oriented setup scripts indicate a backend/data layer. The excerpts do not show the server routes or screen request calls, so those runtime connections are left unverified rather than inferred.

Main entry points: [`src/app/App.tsx`](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/App.tsx) (Application Router), [`src/app/api-config.ts`](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/api-config.ts) (API Configuration), [`src/main.tsx`](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/main.tsx) (Web Entry), [`src/app/components/dashboard-screen.tsx`](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/dashboard-screen.tsx) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Shell"]
  node_app["Application Router<br/>[App.tsx]"]
  node_login["Sign-in<br/>[login-screen.tsx]"]
  node_navigation["Navigation<br/>[sidebar.tsx]"]
  node_header["Top Bar<br/>[topbar.tsx]"]
  node_entry["Web Entry<br/>[main.tsx]"]
end

subgraph group_operations["POS Operations"]
  node_dashboard["Dashboard"]
  node_pos["POS Terminal"]
  node_orders["Orders<br/>[orders-screen.tsx]"]
  node_customers["Customers"]
end

subgraph group_management["Inventory Management"]
  node_products["Pharmacy Stock"]
  node_inventory["Inventory"]
  node_warehouse["Warehouse"]
  node_reports["Reports<br/>[reports-screen.tsx]"]
  node_settings["Settings"]
end

subgraph group_backend["Backend and Data"]
  node_api_config["API Configuration<br/>[api-config.ts]"]
  node_server["HTTP Server<br/>[index.cjs]"]
  node_database[("SQL Database")]
end

node_user(("User"))

node_user -->|"opens"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"renders"| node_login
node_app -->|"renders"| node_navigation
node_app -->|"renders"| node_header
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_pos
node_app -->|"routes to"| node_orders
node_app -->|"routes to"| node_customers
node_app -->|"routes to"| node_products
node_app -->|"routes to"| node_inventory
node_app -->|"routes to"| node_warehouse
node_app -->|"routes to"| node_reports
node_app -->|"routes to"| node_settings
node_dashboard -->|"imports"| node_api_config
node_pos -->|"imports"| node_api_config
node_products -->|"imports"| node_api_config
node_inventory -->|"imports"| node_api_config
node_warehouse -->|"imports"| node_api_config
node_server -.->|"uses"| node_database
node_api_config -.->|"configures endpoint"| node_server

click node_app "https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/App.tsx"
click node_login "https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/login-screen.tsx"
click node_navigation "https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/sidebar.tsx"
click node_header "https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/topbar.tsx"
click node_dashboard "https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/dashboard-screen.tsx"
click node_pos "https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/pos-terminal-screen.tsx"
click node_orders "https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/orders-screen.tsx"
click node_customers "https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/customers-screen.tsx"
click node_products "https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/products-screen.tsx"
click node_inventory "https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/inventory-screen.tsx"
click node_warehouse "https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/warehouse-screen.tsx"
click node_reports "https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/reports-screen.tsx"
click node_settings "https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/settings-screen.tsx"
click node_api_config "https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/api-config.ts"
click node_server "https://github.com/darrylmagdalaga-bot/e-medics/blob/main/server/index.cjs"
click node_entry "https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/main.tsx"

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_app,node_login,node_navigation,node_header,node_entry,node_user toneBlue
class node_dashboard,node_pos,node_orders,node_customers toneAmber
class node_products,node_inventory,node_warehouse,node_reports,node_settings toneMint
class node_api_config,node_server,node_database toneRose
```

## Components

### Application Shell

- [Application Router](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Sign-in](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/login-screen.tsx): `src/app/components/login-screen.tsx`
- [Navigation](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/sidebar.tsx): `src/app/components/sidebar.tsx`
- [Top Bar](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/topbar.tsx): `src/app/components/topbar.tsx`
- [Web Entry](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/main.tsx): `src/main.tsx`

### POS Operations

- [Dashboard](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/dashboard-screen.tsx): `src/app/components/dashboard-screen.tsx`
- [POS Terminal](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/pos-terminal-screen.tsx): `src/app/components/pos-terminal-screen.tsx`
- [Orders](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/orders-screen.tsx): `src/app/components/orders-screen.tsx`
- [Customers](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/customers-screen.tsx): `src/app/components/customers-screen.tsx`

### Inventory Management

- [Pharmacy Stock](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/products-screen.tsx): `src/app/components/products-screen.tsx`
- [Inventory](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/inventory-screen.tsx): `src/app/components/inventory-screen.tsx`
- [Warehouse](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/warehouse-screen.tsx): `src/app/components/warehouse-screen.tsx`
- [Reports](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/reports-screen.tsx): `src/app/components/reports-screen.tsx`
- [Settings](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/components/settings-screen.tsx): `src/app/components/settings-screen.tsx`

### Backend and Data

- [API Configuration](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/src/app/api-config.ts): `src/app/api-config.ts`
- [HTTP Server](https://github.com/darrylmagdalaga-bot/e-medics/blob/main/server/index.cjs): `server/index.cjs`
- **SQL Database**

### Other components

- **User**

## Connections

- User → Web Entry: opens (evidence: `src/main.tsx`)
- Web Entry → Application Router: renders (evidence: `src/main.tsx`)
- Application Router → Sign-in: renders (evidence: `src/app/App.tsx`)
- Application Router → Navigation: renders (evidence: `src/app/App.tsx`)
- Application Router → Top Bar: renders (evidence: `src/app/App.tsx`)
- Application Router → Dashboard: routes to (evidence: `src/app/App.tsx`)
- Application Router → POS Terminal: routes to (evidence: `src/app/App.tsx`)
- Application Router → Orders: routes to (evidence: `src/app/App.tsx`)
- Application Router → Customers: routes to (evidence: `src/app/App.tsx`)
- Application Router → Pharmacy Stock: routes to (evidence: `src/app/App.tsx`)
- Application Router → Inventory: routes to (evidence: `src/app/App.tsx`)
- Application Router → Warehouse: routes to (evidence: `src/app/App.tsx`)
- Application Router → Reports: routes to (evidence: `src/app/App.tsx`)
- Application Router → Settings: routes to (evidence: `src/app/App.tsx`)
- Dashboard → API Configuration: imports (evidence: `src/app/components/dashboard-screen.tsx`)
- POS Terminal → API Configuration: imports (evidence: `src/app/components/pos-terminal-screen.tsx`)
- Pharmacy Stock → API Configuration: imports (evidence: `src/app/components/products-screen.tsx`)
- Inventory → API Configuration: imports (evidence: `src/app/components/inventory-screen.tsx`)
- Warehouse → API Configuration: imports (evidence: `src/app/components/warehouse-screen.tsx`)
- HTTP Server → SQL Database: uses
- API Configuration → HTTP Server: configures endpoint
