# sivasainikhil/local-medical-shop architecture

> Architecture diagram of the GitHub repository sivasainikhil/local-medical-shop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sivasainikhil/local-medical-shop
- Repository: https://github.com/sivasainikhil/local-medical-shop

## Overview

##### Project type and purpose
- This is a classic LAMP‐style monolithic web app: a PHP/MySQL “Local Medical Shop” system that allows customers and administrators to browse products (medicines, lab tests, healthcare items, tablets), perform CRUD operations (add/edit/delete), handle signups/logins, and process checkouts. It’s not split into separate microservices; instead, everything lives in one folder structure served by Apache + PHP, backed by a single MySQL database.

##### File structure
Top‐level files reveal layers and functional modules:
- PHP pages for CRUD on various product types: add*/edit*/delete*.php, plus display pages (products.php, labtests.php, healthcare.php, tablets.php, medicine.php)
- Core app logic: database.php (handles DB connection), script.js & signup-validation.js (client‐side scripting)
- Authentication & user flows: login.php (+ login-styles.css), signup.php (+ signup-styles.css), customer.php, admin.php
- Checkout & contact: checkout.php, contact.html
- Static assets: *.css in various modules, plus a single script.js
- Database schema: medical.sql

##### README for additional insights
- Confirms a single‐folder drop‑in under XAMPP (htdocs), using phpMyAdmin to import the medical.sql schema. No extra services or external APIs are mentioned.

##### Detail without overthinking
- Break out each feature area as its own component (even if it’s just a group of PHP files).
- Don’t omit the shared database.php or the import step (medical.sql).
- Static‐asset serving as part of the Web Server component.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["Browser (HTML/CSS/JS)"]:::client

    subgraph "Web Server & Application"
      direction TB
      AP["Apache + PHP Runtime"]:::server

      subgraph "Core Infrastructure"
        DBCON["database.php"]:::server
        SQL["medical.sql"]:::server
        INDEX["index.php"]:::server
        SCRIPT["script.js"]:::client
        STYLES["styles.css"]:::client
        STF["stf.css"]:::client
      end

      subgraph "Auth Module"
        LOGIN["login.php"]:::server
        LCSS["login-styles.css"]:::client
        SIGNUP["signup.php"]:::server
        SCSS["signup-styles.css"]:::client
        SVJS["signup-validation.js"]:::client
        ADDSU["addsignup.php"]:::server
        CUSTOMER["customer.php"]:::server
        ADMIN["admin.php"]:::server
      end

      subgraph "Product Module"
        ADDP["addproduct.php"]:::server
        EDITP["editproduct.php"]:::server
        DELP["deleteproduct.php"]:::server
        PRODSL["products.php"]:::server
        PROD["product.php"]:::server
        PCSS["products.css"]:::client
      end

      subgraph "Lab Tests Module"
        ADDL["addlabtest.php"]:::server
        EDITL["editlabtest.php"]:::server
        DELL["deletelabtest.php"]:::server
        LABS["labtests.php"]:::server
        LAB["labtest.php"]:::server
        LCSS2["labtests.css"]:::client
      end

      subgraph "Healthcare Module"
        ADDH["addhealthcare.php"]:::server
        EDITH["edithealthcare.php"]:::server
        DELH["deletehealthcare.php"]:::server
        HC["healthcare.php"]:::server
        H["health.php"]:::server
        HCSS["healthcare.css"]:::client
      end

      subgraph "Tablets Module"
        ADDT["addtablet.php"]:::server
        EDITT["edittablet.php"]:::server
        DELT["deletetablet.php"]:::server
        TAB["tablets.php"]:::server
        TCSS["tablets.css"]:::client
      end

      subgraph "Checkout & Contact"
        CO["checkout.php"]:::server
        CT["contact.html"]:::client
      end
    end

    subgraph "Database"
      MySQL["MySQL Database"]:::db
    end

    Browser -->|HTTP/HTTPS| AP
    AP -->|uses| DBCON
    AP -->|serves| SCRIPT
    AP -->|serves| STYLES
    AP -->|serves| STF
    AP -->|executes| LOGIN
    AP -->|executes| SIGNUP
    AP -->|executes| ADDP
    AP -->|executes| ADDL
    AP -->|executes| ADDH
    AP -->|executes| ADDT
    AP -->|executes| PRODSL
    AP -->|executes| LABS
    AP -->|executes| HC
    AP -->|executes| TAB
    AP -->|executes| CO
    AP -->|serves| CT
    AP -->|reads/writes| MySQL
    MySQL -->|responses| AP

    click LOGIN "https://github.com/sivasainikhil/local-medical-shop/blob/main/login.php"
    click LCSS "https://github.com/sivasainikhil/local-medical-shop/blob/main/login-styles.css"
    click SIGNUP "https://github.com/sivasainikhil/local-medical-shop/blob/main/signup.php"
    click SCSS "https://github.com/sivasainikhil/local-medical-shop/blob/main/signup-styles.css"
    click SVJS "https://github.com/sivasainikhil/local-medical-shop/blob/main/signup-validation.js"
    click ADDSU "https://github.com/sivasainikhil/local-medical-shop/blob/main/addsignup.php"
    click CUSTOMER "https://github.com/sivasainikhil/local-medical-shop/blob/main/customer.php"
    click ADMIN "https://github.com/sivasainikhil/local-medical-shop/blob/main/admin.php"
    click ADDP "https://github.com/sivasainikhil/local-medical-shop/blob/main/addproduct.php"
    click EDITP "https://github.com/sivasainikhil/local-medical-shop/blob/main/editproduct.php"
    click DELP "https://github.com/sivasainikhil/local-medical-shop/blob/main/deleteproduct.php"
    click PRODSL "https://github.com/sivasainikhil/local-medical-shop/blob/main/products.php"
    click PROD "https://github.com/sivasainikhil/local-medical-shop/blob/main/product.php"
    click PCSS "https://github.com/sivasainikhil/local-medical-shop/blob/main/products.css"
    click ADDL "https://github.com/sivasainikhil/local-medical-shop/blob/main/addlabtest.php"
    click EDITL "https://github.com/sivasainikhil/local-medical-shop/blob/main/editlabtest.php"
    click DELL "https://github.com/sivasainikhil/local-medical-shop/blob/main/deletelabtest.php"
    click LABS "https://github.com/sivasainikhil/local-medical-shop/blob/main/labtests.php"
    click LAB "https://github.com/sivasainikhil/local-medical-shop/blob/main/labtest.php"
    click LCSS2 "https://github.com/sivasainikhil/local-medical-shop/blob/main/labtests.css"
    click ADDH "https://github.com/sivasainikhil/local-medical-shop/blob/main/addhealthcare.php"
    click EDITH "https://github.com/sivasainikhil/local-medical-shop/blob/main/edithealthcare.php"
    click DELH "https://github.com/sivasainikhil/local-medical-shop/blob/main/deletehealthcare.php"
    click HC "https://github.com/sivasainikhil/local-medical-shop/blob/main/healthcare.php"
    click H "https://github.com/sivasainikhil/local-medical-shop/blob/main/health.php"
    click HCSS "https://github.com/sivasainikhil/local-medical-shop/blob/main/healthcare.css"
    click ADDT "https://github.com/sivasainikhil/local-medical-shop/blob/main/addtablet.php"
    click EDITT "https://github.com/sivasainikhil/local-medical-shop/blob/main/edittablet.php"
    click DELT "https://github.com/sivasainikhil/local-medical-shop/blob/main/deletetablet.php"
    click TAB "https://github.com/sivasainikhil/local-medical-shop/blob/main/tablets.php"
    click TCSS "https://github.com/sivasainikhil/local-medical-shop/blob/main/tablets.css"
    click CO "https://github.com/sivasainikhil/local-medical-shop/blob/main/checkout.php"
    click CT "https://github.com/sivasainikhil/local-medical-shop/blob/main/contact.html"
    click DBCON "https://github.com/sivasainikhil/local-medical-shop/blob/main/database.php"
    click SQL "https://github.com/sivasainikhil/local-medical-shop/blob/main/medical.sql"
    click INDEX "https://github.com/sivasainikhil/local-medical-shop/blob/main/index.php"
    click SCRIPT "https://github.com/sivasainikhil/local-medical-shop/blob/main/script.js"
    click STYLES "https://github.com/sivasainikhil/local-medical-shop/blob/main/styles.css"
    click STF "https://github.com/sivasainikhil/local-medical-shop/blob/main/stf.css"

    classDef client fill:#add8e6,stroke:#000,stroke-width:1px
    classDef server fill:#90ee90,stroke:#000,stroke-width:1px
    classDef db fill:#ffa500,stroke:#000,stroke-width:1px
```
