# bharathram125/injectiondetector architecture

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

- Interactive diagram: https://gitdiagram.com/bharathram125/injectiondetector
- Repository: https://github.com/bharathram125/injectiondetector

## Overview

This is a research-oriented web injection detector with a Flask demo and a character-level GCN classifier. The user workflow accepts login fields or a greeting name, converts each payload into a character graph, classifies it, and then blocks flagged input or continues the route’s response. The README also describes dataset preparation and model training, represented here as documented capabilities; their notebook implementation was not sampled. Runtime relationships are grounded in app.py, while the training flow is documented in the README.

Main entry points: [`app.py`](https://github.com/bharathram125/injectiondetector/blob/main/app.py) (Prediction), [`Datasets`](https://github.com/bharathram125/injectiondetector/tree/main/Datasets) (Dataset files), [`Notebook/Injection_detection_GCN_Classifier.ipynb`](https://github.com/bharathram125/injectiondetector/blob/main/Notebook/Injection_detection_GCN_Classifier.ipynb) (Model training notebook), [`Models/gcn_model_v3.pth`](https://github.com/bharathram125/injectiondetector/blob/main/Models/gcn_model_v3.pth) (Trained weights)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_home_route["Home route<br/>[app.py]"]
  node_login_route["Login route<br/>[app.py]"]
  node_greet_route["Greeting route<br/>[app.py]"]
  node_home_view["Home page<br/>[home.html]"]
  node_login_view["Login form<br/>[login.html]"]
end

subgraph group_detection["Detection runtime"]
  node_payload_graph["Payload graphing<br/>[app.py]"]
  node_predictor["Prediction<br/>[app.py]"]
  node_gcn["GCN classifier<br/>[app.py]"]
  node_vocabulary["Character vocabulary<br/>[char_vocab.json]"]
  node_weights["Trained weights<br/>[gcn_model_v3.pth]"]
end

subgraph group_training["Data and training"]
  node_dataset[("Dataset files")]
  node_dataset_merge["Dataset merge<br/>[merge.py]"]
  node_training_notebook["Model training notebook"]
end

node_user(("Web user"))

node_user -->|"requests"| node_home_route
node_user -->|"submits credentials"| node_login_route
node_user -->|"sends name"| node_greet_route
node_home_route -->|"renders"| node_home_view
node_login_route -->|"renders"| node_login_view
node_login_route -->|"classifies fields"| node_predictor
node_greet_route -->|"classifies name"| node_predictor
node_predictor -->|"builds graph"| node_payload_graph
node_predictor -->|"runs inference"| node_gcn
node_gcn -->|"embeds characters"| node_vocabulary
node_gcn -->|"loads weights"| node_weights
node_dataset -->|"merges parts"| node_dataset_merge
node_dataset -.->|"supports training"| node_training_notebook
node_training_notebook -.->|"produces model"| node_weights

click node_home_route "https://github.com/bharathram125/injectiondetector/blob/main/app.py"
click node_login_route "https://github.com/bharathram125/injectiondetector/blob/main/app.py"
click node_greet_route "https://github.com/bharathram125/injectiondetector/blob/main/app.py"
click node_home_view "https://github.com/bharathram125/injectiondetector/blob/main/templates/home.html"
click node_login_view "https://github.com/bharathram125/injectiondetector/blob/main/templates/login.html"
click node_payload_graph "https://github.com/bharathram125/injectiondetector/blob/main/app.py"
click node_predictor "https://github.com/bharathram125/injectiondetector/blob/main/app.py"
click node_gcn "https://github.com/bharathram125/injectiondetector/blob/main/app.py"
click node_vocabulary "https://github.com/bharathram125/injectiondetector/blob/main/Models/char_vocab.json"
click node_weights "https://github.com/bharathram125/injectiondetector/blob/main/Models/gcn_model_v3.pth"
click node_dataset "https://github.com/bharathram125/injectiondetector/tree/main/Datasets"
click node_dataset_merge "https://github.com/bharathram125/injectiondetector/blob/main/Datasets/merge.py"
click node_training_notebook "https://github.com/bharathram125/injectiondetector/blob/main/Notebook/Injection_detection_GCN_Classifier.ipynb"

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_home_route,node_login_route,node_greet_route,node_home_view,node_login_view,node_user toneBlue
class node_payload_graph,node_predictor,node_gcn,node_vocabulary,node_weights toneAmber
class node_dataset,node_dataset_merge,node_training_notebook toneMint
```

## Components

### Web application

- [Home route](https://github.com/bharathram125/injectiondetector/blob/main/app.py): `app.py`
- [Login route](https://github.com/bharathram125/injectiondetector/blob/main/app.py): `app.py`
- [Greeting route](https://github.com/bharathram125/injectiondetector/blob/main/app.py): `app.py`
- [Home page](https://github.com/bharathram125/injectiondetector/blob/main/templates/home.html): `templates/home.html`
- [Login form](https://github.com/bharathram125/injectiondetector/blob/main/templates/login.html): `templates/login.html`

### Detection runtime

- [Payload graphing](https://github.com/bharathram125/injectiondetector/blob/main/app.py): `app.py`
- [Prediction](https://github.com/bharathram125/injectiondetector/blob/main/app.py): `app.py`
- [GCN classifier](https://github.com/bharathram125/injectiondetector/blob/main/app.py): `app.py`
- [Character vocabulary](https://github.com/bharathram125/injectiondetector/blob/main/Models/char_vocab.json): `Models/char_vocab.json`
- [Trained weights](https://github.com/bharathram125/injectiondetector/blob/main/Models/gcn_model_v3.pth): `Models/gcn_model_v3.pth`

### Data and training

- [Dataset files](https://github.com/bharathram125/injectiondetector/tree/main/Datasets): `Datasets`
- [Dataset merge](https://github.com/bharathram125/injectiondetector/blob/main/Datasets/merge.py): `Datasets/merge.py`
- [Model training notebook](https://github.com/bharathram125/injectiondetector/blob/main/Notebook/Injection_detection_GCN_Classifier.ipynb): `Notebook/Injection_detection_GCN_Classifier.ipynb`

### Other components

- **Web user**

## Connections

- Web user → Home route: requests (evidence: `app.py`)
- Web user → Login route: submits credentials (evidence: `app.py`)
- Web user → Greeting route: sends name (evidence: `app.py`)
- Home route → Home page: renders (evidence: `app.py`)
- Login route → Login form: renders (evidence: `app.py`)
- Login route → Prediction: classifies fields (evidence: `app.py`)
- Greeting route → Prediction: classifies name (evidence: `app.py`)
- Prediction → Payload graphing: builds graph (evidence: `app.py`)
- Prediction → GCN classifier: runs inference (evidence: `app.py`)
- GCN classifier → Character vocabulary: embeds characters (evidence: `app.py`)
- GCN classifier → Trained weights: loads weights (evidence: `app.py`)
- Dataset files → Dataset merge: merges parts (evidence: `Datasets/merge.py`)
- Dataset files → Model training notebook: supports training (evidence: `README.md`)
- Model training notebook → Trained weights: produces model (evidence: `README.md`)
