# vruddhi18/quality-inspection architecture

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

- Interactive diagram: https://gitdiagram.com/vruddhi18/quality-inspection
- Repository: https://github.com/vruddhi18/quality-inspection

## Overview

##### Project type and purpose
- This is a small‐scale ML prototype + web UI for “quality inspection” of casting products.
- It includes a Jupyter notebook (data exploration + model training) and a Streamlit app (app.py) that loads the trained model and serves predictions via a simple user interface.

##### File structure
- Top‐level files only:
- Quality_inspection.ipynb – end‐to‐end data analysis & model training pipeline
- app.py – Streamlit web application for inference
- requirements.txt – Python dependencies (tensorflow, streamlit, streamlit-option-menu, etc.)
- README.md – project overview, instructions and external dataset link
- No multi‐service folders (e.g., no separate “backend” or “frontend” directories) → monolithic codebase

##### Key insights from the README
- Uses TensorFlow for model building
- Uses Streamlit + streamlit-option-menu to build the UI
- Uses localtunnel (via npx) to expose the local Streamlit server
- Data comes from an external Kaggle link

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Data Layer"
        ExtDataset(("Kaggle Dataset")):::external
        LocalData["Local Data Storage\n(CSV/Parquet)"]:::data
        ExtDataset -->|"downloadCSV/Parquet"| LocalData
    end

    subgraph "Model Layer"
        Notebook["Quality_inspection.ipynb"]:::model
        Training["Model Training\n(TensorFlow)"]:::model
        Artifact["Model Artifact\n(SavedModel/.h5)"]:::model
        LocalData -->|"readData"| Notebook
        Notebook -->|"runTraining"| Training
        Training -->|"saveModel"| Artifact
    end

    subgraph "Application Layer"
        UI["UI Components\n(streamlit-option-menu)"]:::app
        Inference["Inference Logic\n(TensorFlow)"]:::app
        App["Streamlit App\n(app.py)"]:::app
        Artifact -->|"loadModel"| Inference
        UI -->|"userInteraction"| Inference
        Inference -->|"renderOutput"| App
    end

    subgraph "Deployment Layer"
        Env["Python Environment\n(requirements.txt,\nvenv)"]:::deploy
        Server["Streamlit Server\n(port 8501)"]:::deploy
        Tunnel(("Localtunnel Service\n(npx)")):::external
        Env -->|"installDeps"| Server
        Server -->|"serveApp"| App
        Tunnel -->|"proxyHTTP"| Server
    end

    User["User (Browser)"]:::external
    User -->|"HTTPRequest"| Tunnel

    Doc["README.md"]:::doc
    Doc -->|"projectOverview"| Notebook

    click Notebook "https://github.com/vruddhi18/quality-inspection/blob/main/Quality_inspection.ipynb"
    click App "https://github.com/vruddhi18/quality-inspection/blob/main/app.py"
    click Env "https://github.com/vruddhi18/quality-inspection/blob/main/requirements.txt"
    click Doc "https://github.com/vruddhi18/quality-inspection/blob/main/README.md"

    classDef external fill:#fef,stroke:#333,stroke-width:1px
    classDef data fill:#bbf,stroke:#333,stroke-width:1px
    classDef model fill:#bfb,stroke:#333,stroke-width:1px
    classDef app fill:#fbf,stroke:#333,stroke-width:1px
    classDef deploy fill:#ffb,stroke:#333,stroke-width:1px
    classDef doc fill:#ddd,stroke:#333,stroke-width:1px
```
