# professorlevesseur/mtssmaps architecture

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

- Interactive diagram: https://gitdiagram.com/professorlevesseur/mtssmaps
- Repository: https://github.com/professorlevesseur/mtssmaps

## Overview

##### Main components
- User Interface: The application uses Streamlit for its UI, with a dedicated .streamlit configuration directory and multiple page modules in the pages folder (e.g., “01_District_Code_Matchmaker.py”, “02_ISD_Map_Maker.py”, etc.).
- Data Processing and Code Matching: The tool processes and matches educational organization codes. There are spreadsheet examples and CSV files (found under codes and examples folders) that provide input data for the core logic (code matching and mapping).
- Generation: The geojson directory contains various geographical boundary files (e.g., Intermediate School Districts, School Districts, etc.) which feed data into the map visualization modules.
- Deployment & Configuration: Important deployment files include the Procfile, runtime.txt, setup.sh, and requirements.txt. These indicate the project’s deployment on platforms like Heroku or other cloud-hosted environments.

##### File structure and how components interact
- Frontend (Streamlit UI): The Streamlit framework handles page routing and interactivity. Each file in the pages directory represents a distinct page or function (code matching, map creation for ISDs, districts, PSAs, etc.).
- Data Input and Preparation: Users upload spreadsheets containing either educational organization names or codes. These spreadsheets are processed using scripts (for example, in District_Map_Maker.py) and example files are provided for reference.
- GeoJSON Integration: The geojson folder holds the boundary data used by the mapping functions. This ensures that the heat maps and pin-based overlays on the maps reflect the precise geographical boundaries.
- Code Matching Engine: Some scripts (in pages and District_Map_Maker.py) likely implement the logic to match uploaded data with corresponding educational codes.
- External Configuration: Files in .streamlit and scripts like Procfile setup the environment for running the Streamlit app in production.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "Streamlit UI"
        UI_Config("Streamlit Config (.streamlit)"):::ui
        UI_Pages("Streamlit Pages (pages)"):::ui
    end

    %% Data Processing & Code Matching Module
    subgraph "Data Processing & Code Matching"
        DP1("District_Map_Maker.py"):::dp
        DP2("Code Matching Pages"):::dp
    end

    %% Map Generation Module
    subgraph "Map Generation"
        MG("Map Renderer (geojson)"):::mg
    end

    %% External Data Resources
    subgraph "External Data Resources"
        ED1("CSV Data (codes)"):::ed
        ED2("Example Files (examples)"):::ed
    end

    %% Deployment & Configuration Module
    subgraph "Deployment & Config"
        DEP1("Procfile"):::dep
        DEP2("runtime.txt"):::dep
        DEP3("setup.sh"):::dep
        DEP4("requirements.txt"):::dep
        DEP5("Streamlit Config File"):::dep
    end

    %% Data Flow Connections
    UI_Pages -->|"uploads"| DP1
    UI_Pages -->|"navigates"| DP2
    ED1 ---|"feeds data"| DP2
    ED2 ---|"provides examples"| DP2
    DP1 ---|"processed data"| MG
    DP2 ---|"matched codes"| MG
    MG -->|"renders map"| UI_Pages

    %% Deployment influences every core component
    DEP1 ---|"supports"| UI_Pages
    DEP2 ---|"supports"| DP1
    DEP3 ---|"supports"| DP2
    DEP4 ---|"supports"| MG
    DEP5 ---|"supports"| UI_Config

    %% UI internal connection
    UI_Config --- UI_Pages

    %% Click Events
    click UI_Config "https://github.com/professorlevesseur/mtssmaps/blob/main/.streamlit"
    click UI_Pages "https://github.com/professorlevesseur/mtssmaps/tree/main/pages"
    click DP1 "https://github.com/professorlevesseur/mtssmaps/blob/main/District_Map_Maker.py"
    click DP2 "https://github.com/professorlevesseur/mtssmaps/blob/main/pages/03_ISD_Map_Code_Matchmaker.py"
    click MG "https://github.com/professorlevesseur/mtssmaps/tree/main/geojson"
    click ED1 "https://github.com/professorlevesseur/mtssmaps/tree/main/codes"
    click ED2 "https://github.com/professorlevesseur/mtssmaps/tree/main/examples"
    click DEP1 "https://github.com/professorlevesseur/mtssmaps/tree/main/Procfile"
    click DEP2 "https://github.com/professorlevesseur/mtssmaps/blob/main/runtime.txt"
    click DEP3 "https://github.com/professorlevesseur/mtssmaps/blob/main/setup.sh"
    click DEP4 "https://github.com/professorlevesseur/mtssmaps/blob/main/requirements.txt"
    click DEP5 "https://github.com/professorlevesseur/mtssmaps/blob/main/.streamlit/config.toml"

    %% Styles
    classDef ui fill:#d1e8ff,stroke:#1f77b4,stroke-width:2px;
    classDef dp fill:#ffe0b3,stroke:#ff7f0e,stroke-width:2px;
    classDef mg fill:#d5f5e3,stroke:#2ca02c,stroke-width:2px;
    classDef ed fill:#f7cac9,stroke:#e377c2,stroke-width:2px;
    classDef dep fill:#fcecc9,stroke:#8c564b,stroke-width:2px;
```
