# mshknov/dipspam architecture

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

- Interactive diagram: https://gitdiagram.com/mshknov/dipspam
- Repository: https://github.com/mshknov/dipspam

## Overview

Spam Detector Pro offers multilingual single-message and CSV spam analysis through a Streamlit UI, plus a FastAPI prediction endpoint. Users provide text or a file, choose sensitivity in the UI or supply an API threshold, and receive a spam verdict; CSV users can download results. CatBoost is the classifier. The README documents capabilities not fully visible in the sampled UI excerpt; utility modules and configuration are shown separately where their wiring is evidenced. API prediction is directly evidenced; UI-to-model details beyond model loading are limited by the partial excerpt.

Main entry points: [`App.py`](https://github.com/mshknov/dipspam/blob/main/App.py) (Streamlit UI), [`api.py`](https://github.com/mshknov/dipspam/blob/main/api.py) (Prediction API), [`catboost_spam_model.cbm`](https://github.com/mshknov/dipspam/blob/main/catboost_spam_model.cbm) (CatBoost Model), [`utils/validators.py`](https://github.com/mshknov/dipspam/blob/main/utils/validators.py) (Input Validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_streamlit["Streamlit UI<br/>[App.py]"]
  node_single["Single Analysis<br/>[App.py]"]
  node_csv["CSV Processing<br/>[App.py]"]
  node_metrics["Metrics View<br/>[App.py]"]
  node_api_guide["API Integration View<br/>[App.py]"]
  node_rest_api["Prediction API<br/>[api.py]"]
end

subgraph group_classification["Classification"]
  node_catboost["CatBoost Model"]
end

subgraph group_text_tools["Text Utilities"]
  node_features["Feature Extraction"]
  node_preprocessing["Text Preprocessing<br/>[preprocessing.py]"]
  node_validators["Input Validation<br/>[validators.py]"]
end

subgraph group_settings["Configuration"]
  node_config["Project Settings<br/>[config.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_streamlit
node_streamlit -->|"offers"| node_single
node_streamlit -->|"offers"| node_csv
node_streamlit -->|"offers"| node_metrics
node_streamlit -->|"offers"| node_api_guide
node_user -->|"submits text"| node_rest_api
node_rest_api -->|"loads and predicts"| node_catboost
node_streamlit -.->|"loads model"| node_catboost
node_validators -->|"reads limits"| node_config

click node_streamlit "https://github.com/mshknov/dipspam/blob/main/App.py"
click node_single "https://github.com/mshknov/dipspam/blob/main/App.py"
click node_csv "https://github.com/mshknov/dipspam/blob/main/App.py"
click node_metrics "https://github.com/mshknov/dipspam/blob/main/App.py"
click node_api_guide "https://github.com/mshknov/dipspam/blob/main/App.py"
click node_rest_api "https://github.com/mshknov/dipspam/blob/main/api.py"
click node_catboost "https://github.com/mshknov/dipspam/blob/main/catboost_spam_model.cbm"
click node_features "https://github.com/mshknov/dipspam/blob/main/utils/feature_extraction.py"
click node_preprocessing "https://github.com/mshknov/dipspam/blob/main/utils/preprocessing.py"
click node_validators "https://github.com/mshknov/dipspam/blob/main/utils/validators.py"
click node_config "https://github.com/mshknov/dipspam/blob/main/config.py"

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_streamlit,node_single,node_csv,node_metrics,node_api_guide,node_rest_api,node_user toneBlue
class node_catboost toneAmber
class node_features,node_preprocessing,node_validators toneMint
class node_config toneRose
```

## Components

### User Interfaces

- [Streamlit UI](https://github.com/mshknov/dipspam/blob/main/App.py): `App.py`
- [Single Analysis](https://github.com/mshknov/dipspam/blob/main/App.py): `App.py`
- [CSV Processing](https://github.com/mshknov/dipspam/blob/main/App.py): `App.py`
- [Metrics View](https://github.com/mshknov/dipspam/blob/main/App.py): `App.py`
- [API Integration View](https://github.com/mshknov/dipspam/blob/main/App.py): `App.py`
- [Prediction API](https://github.com/mshknov/dipspam/blob/main/api.py): `api.py`

### Classification

- [CatBoost Model](https://github.com/mshknov/dipspam/blob/main/catboost_spam_model.cbm): `catboost_spam_model.cbm`

### Text Utilities

- [Feature Extraction](https://github.com/mshknov/dipspam/blob/main/utils/feature_extraction.py): `utils/feature_extraction.py`
- [Text Preprocessing](https://github.com/mshknov/dipspam/blob/main/utils/preprocessing.py): `utils/preprocessing.py`
- [Input Validation](https://github.com/mshknov/dipspam/blob/main/utils/validators.py): `utils/validators.py`

### Configuration

- [Project Settings](https://github.com/mshknov/dipspam/blob/main/config.py): `config.py`

### Other components

- **User**

## Connections

- User → Streamlit UI: uses (evidence: `README.md`)
- Streamlit UI → Single Analysis: offers (evidence: `App.py`)
- Streamlit UI → CSV Processing: offers (evidence: `App.py`)
- Streamlit UI → Metrics View: offers (evidence: `App.py`)
- Streamlit UI → API Integration View: offers (evidence: `App.py`)
- User → Prediction API: submits text (evidence: `README.md`)
- Prediction API → CatBoost Model: loads and predicts (evidence: `api.py`)
- Streamlit UI → CatBoost Model: loads model
- Input Validation → Project Settings: reads limits (evidence: `utils/validators.py`)
