# sakshidadge09-coder/medipoint-medical-stores architecture

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

- Interactive diagram: https://gitdiagram.com/sakshidadge09-coder/medipoint-medical-stores
- Repository: https://github.com/sakshidadge09-coder/medipoint-medical-stores

## Overview

Medipoint is a PHP/MySQL medical-store admin system. An admin signs in at the login page, uses the dashboard for inventory, supplier/customer entry, billing and reports, then views or prints bills. The dashboard directly queries data and renders these capabilities; dedicated PHP handlers perform stock changes and bill creation, while the shared database connection serves the PHP pages. The README also identifies reporting and supplier management. Several dashboard details and its client-side wiring are only partially excerpted, so those links are documented at the dashboard boundary rather than expanded into unverified calls.

Main entry points: [`dashboard.php`](https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/dashboard.php) (Dashboard), [`config/database.php`](https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/config/database.php) (MySQL database), [`index.php`](https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/index.php) (Login), [`logout.php`](https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/logout.php) (Session logout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Admin access"]
  node_login["Login<br/>[index.php]"]
  node_session["Session logout<br/>[logout.php]"]
  node_admin_setup["Admin setup<br/>[create_admin.php]"]
end

subgraph group_operations["Store operations"]
  node_dashboard["Dashboard<br/>[dashboard.php]"]
  node_stock["Stock management<br/>[manage_stock.php]"]
  node_supplier["Supplier entry<br/>[add_supplier.php]"]
  node_customer["Customer entry<br/>[add_customer.php]"]
  node_billing["Bill creation<br/>[save_bill.php]"]
  node_receipt["Bill viewing<br/>[view_bill.php]"]
  node_reports["Sales reports<br/>[dashboard.php]"]
end

subgraph group_data["Persistence"]
  node_database[("MySQL database<br/>[database.php]")]
end

node_admin(("Store admin"))

node_admin -->|"submits credentials"| node_login
node_login -->|"redirects on success"| node_dashboard
node_dashboard -->|"redirects if unauthenticated"| node_login
node_admin -->|"uses admin console"| node_dashboard
node_dashboard -.->|"posts stock actions"| node_stock
node_dashboard -.->|"adds suppliers"| node_supplier
node_dashboard -.->|"adds customers"| node_customer
node_dashboard -.->|"submits bill"| node_billing
node_admin -->|"views bill"| node_receipt
node_dashboard -->|"queries store data"| node_database
node_stock -->|"updates medicines"| node_database
node_supplier -->|"writes suppliers"| node_database
node_customer -->|"writes customers"| node_database
node_billing -->|"writes bill and stock"| node_database
node_receipt -->|"reads bill details"| node_database
node_dashboard -->|"renders sales metrics"| node_reports
node_reports -->|"queries sales totals"| node_database
node_admin_setup -->|"creates admin account"| node_database
node_admin -->|"logs out"| node_session
node_session -->|"redirects"| node_login

click node_login "https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/index.php"
click node_session "https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/logout.php"
click node_dashboard "https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/dashboard.php"
click node_stock "https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/manage_stock.php"
click node_supplier "https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/add_supplier.php"
click node_customer "https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/add_customer.php"
click node_billing "https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/save_bill.php"
click node_receipt "https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/view_bill.php"
click node_database "https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/config/database.php"
click node_reports "https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/dashboard.php"
click node_admin_setup "https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/config/create_admin.php"

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_login,node_session,node_admin_setup toneBlue
class node_dashboard,node_stock,node_supplier,node_customer,node_billing,node_receipt,node_reports toneAmber
class node_database toneMint
class node_admin toneIndigo
```

## Components

### Admin access

- [Login](https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/index.php): `index.php`
- [Session logout](https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/logout.php): `logout.php`
- [Admin setup](https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/config/create_admin.php): `config/create_admin.php`

### Store operations

- [Dashboard](https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/dashboard.php): `dashboard.php`
- [Stock management](https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/manage_stock.php): `manage_stock.php`
- [Supplier entry](https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/add_supplier.php): `add_supplier.php`
- [Customer entry](https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/add_customer.php): `add_customer.php`
- [Bill creation](https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/save_bill.php): `save_bill.php`
- [Bill viewing](https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/view_bill.php): `view_bill.php`
- [Sales reports](https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/dashboard.php): `dashboard.php`

### Persistence

- [MySQL database](https://github.com/sakshidadge09-coder/medipoint-medical-stores/blob/main/config/database.php): `config/database.php`

### Other components

- **Store admin**

## Connections

- Store admin → Login: submits credentials (evidence: `index.php`)
- Login → Dashboard: redirects on success (evidence: `index.php`)
- Dashboard → Login: redirects if unauthenticated (evidence: `dashboard.php`)
- Store admin → Dashboard: uses admin console (evidence: `README.md`)
- Dashboard → Stock management: posts stock actions
- Dashboard → Supplier entry: adds suppliers
- Dashboard → Customer entry: adds customers
- Dashboard → Bill creation: submits bill
- Store admin → Bill viewing: views bill (evidence: `README.md`)
- Dashboard → MySQL database: queries store data (evidence: `dashboard.php`)
- Stock management → MySQL database: updates medicines (evidence: `manage_stock.php`)
- Supplier entry → MySQL database: writes suppliers (evidence: `add_supplier.php`)
- Customer entry → MySQL database: writes customers (evidence: `add_customer.php`)
- Bill creation → MySQL database: writes bill and stock (evidence: `save_bill.php`)
- Bill viewing → MySQL database: reads bill details (evidence: `view_bill.php`)
- Dashboard → Sales reports: renders sales metrics (evidence: `dashboard.php`)
- Sales reports → MySQL database: queries sales totals (evidence: `dashboard.php`)
- Admin setup → MySQL database: creates admin account (evidence: `config/create_admin.php`)
- Store admin → Session logout: logs out (evidence: `README.md`)
- Session logout → Login: redirects (evidence: `logout.php`)
