# mwasifanwar/neuroscan-ai architecture

> Architecture diagram of the GitHub repository mwasifanwar/neuroscan-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mwasifanwar/neuroscan-ai
- Repository: https://github.com/mwasifanwar/neuroscan-ai

## Overview

##### Project type and purpose
- NeuroScan-AI is a standalone data-processing application with an interactive Streamlit front end. Its core is a set of image-processing “pipelines” (scan, OCR, enhance), plus utility modules for geometry, I/O, and PDF handling. It’s packaged as a Docker container for consistent deployment.

##### File structure
- Top level
- Dockerfile, requirements.txt – define the runtime environment
- README.md – project title (“NeuroScan-AI”)
- app/ – the back-end processing library
- web/ – the Streamlit UI script
- tests/ – unit tests for key modules
- app/
- main.py – orchestrates pipeline execution
- config.py – configuration loader
- schemas.py – data models or typing definitions
- pipelines/ – individual pipeline modules (scan.py, ocr.py, enhance.py)
- utils/ – shared low-level helpers (geometry, image I/O, PDF)
- web/
- streamlit_app.py – user interface entry point that imports and invokes app/ components

##### README for additional insights
- Although minimal, the name “NeuroScan-AI” suggests AI-driven image scanning and OCR. No external services or databases are mentioned, so it is self-contained.

##### Detail without overcomplicating
- Modules under their logical layer
- Config.py feeding parameters into the orchestrator
- Dockerfile at the top-level, pointing to the container boundary
- Do not omit the local filesystem/volume – it’s the only persistent store

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Container Boundary
    subgraph "Docker Container"
        direction TB
        DC["Docker Container"]:::container

        %% Frontend Layer
        subgraph "Frontend (Streamlit UI)"
            direction TB
            UI["Streamlit UI"]:::ui
        end

        %% Backend Layer
        subgraph "Backend (App Library)"
            direction TB
            Orch["Orchestrator"]:::backend
            Config["Configuration Loader"]:::backend
            Schemas["Data Models / Schemas"]:::backend

            subgraph "Pipelines"
                direction TB
                Scan["Scan Pipeline"]:::backend
                OCR["OCR Pipeline"]:::backend
                Enhance["Enhance Pipeline"]:::backend
            end

            subgraph "Utils"
                direction TB
                Geo["Geometry Utilities"]:::utils
                IO["Image I/O Utilities"]:::utils
                PDF["PDF Handling Utilities"]:::utils
            end
        end

        %% Storage
        Storage["File Storage (Local Disk)"]:::storage
    end

    %% External Actor and Tests
    User["User (Browser)"]:::external
    Tests["Unit Tests"]:::tests

    %% Relationships
    User -->|submit scan request| UI
    UI -->|invoke pipeline| Orch
    Orch -->|load config| Config
    Orch -->|use schemas| Schemas
    Orch -->|dispatch to Scan| Scan
    Orch -->|dispatch to OCR| OCR
    Orch -->|dispatch to Enhance| Enhance
    Scan -->|use| Geo
    Scan -->|use| IO
    Scan -->|use| PDF
    OCR -->|use| Geo
    OCR -->|use| IO
    OCR -->|use| PDF
    Enhance -->|use| Geo
    Enhance -->|use| IO
    Enhance -->|use| PDF
    Scan -->|read/write| Storage
    OCR -->|read/write| Storage
    Enhance -->|read/write| Storage
    Orch -->|return results| UI

    %% Click Events
    click DC "https://github.com/mwasifanwar/neuroscan-ai/tree/main/Dockerfile"
    click UI "https://github.com/mwasifanwar/neuroscan-ai/blob/main/web/streamlit_app.py"
    click Orch "https://github.com/mwasifanwar/neuroscan-ai/blob/main/app/main.py"
    click Config "https://github.com/mwasifanwar/neuroscan-ai/blob/main/app/config.py"
    click Schemas "https://github.com/mwasifanwar/neuroscan-ai/blob/main/app/schemas.py"
    click Scan "https://github.com/mwasifanwar/neuroscan-ai/blob/main/app/pipelines/scan.py"
    click OCR "https://github.com/mwasifanwar/neuroscan-ai/blob/main/app/pipelines/ocr.py"
    click Enhance "https://github.com/mwasifanwar/neuroscan-ai/blob/main/app/pipelines/enhance.py"
    click Geo "https://github.com/mwasifanwar/neuroscan-ai/blob/main/app/utils/geometry.py"
    click IO "https://github.com/mwasifanwar/neuroscan-ai/blob/main/app/utils/image_io.py"
    click PDF "https://github.com/mwasifanwar/neuroscan-ai/blob/main/app/utils/pdf.py"
    click Tests "https://github.com/mwasifanwar/neuroscan-ai/tree/main/tests/"

    %% Styles
    classDef container fill:#f9f,stroke:#333,stroke-width:2px;
    classDef ui fill:#bbdefb,stroke:#1e88e5,stroke-width:2px;
    classDef backend fill:#c8e6c9,stroke:#43a047,stroke-width:2px;
    classDef utils fill:#e0e0e0,stroke:#9e9e9e,stroke-width:2px;
    classDef storage fill:#ffe0b2,stroke:#fb8c00,stroke-width:2px;
    classDef external fill:#ffffff,stroke:#000000,stroke-dasharray: 2 2;
    classDef tests fill:#ffebee,stroke:#e53935,stroke-width:2px,stroke-dasharray: 5 5;
```
