# santhoshkumars08430-afk/cloudsecurityproject architecture

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

- Interactive diagram: https://gitdiagram.com/santhoshkumars08430-afk/cloudsecurityproject
- Repository: https://github.com/santhoshkumars08430-afk/cloudsecurityproject

## Overview

This Flask application lets an operator log in, upload network-event CSV data, and inspect AI-classified traffic through dashboard, network, detection, alert, and report views; reports can also be downloaded as CSV. The runtime reads uploaded events from a CSV file and applies a pre-trained model. A separate SQLite helper and model-training script exist, but the sampled application does not connect to the database helper. Relationships below are limited to those shown in the sampled source; templates were not inspected.

Main entry points: [`app.py`](https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/app.py) (Event reader), [`data/network_data.csv`](https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/data/network_data.csv) (Network events CSV), [`models/threat_model.pkl`](https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/models/threat_model.pkl) (Threat classifier), [`models/train_model.py`](https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/models/train_model.py) (Model training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and ingestion"]
  node_login["Login<br/>[app.py]"]
  node_csv_upload["CSV upload<br/>[app.py]"]
  node_event_csv[("Network events CSV<br/>[network_data.csv]")]
end

subgraph group_analysis["Traffic analysis"]
  node_event_reader["Event reader<br/>[app.py]"]
  node_classifier["Threat classifier<br/>[threat_model.pkl]"]
end

subgraph group_views["Security views and reports"]
  node_dashboard["Dashboard<br/>[dashboard.html]"]
  node_network_view["Network view<br/>[network.html]"]
  node_ai_view["AI detection view<br/>[ai_detection.html]"]
  node_alerts["Alerts view<br/>[alerts.html]"]
  node_reports["Reports view<br/>[reports.html]"]
  node_report_download["Report download<br/>[app.py]"]
end

subgraph group_support["Supporting components"]
  node_model_training["Model training<br/>[train_model.py]"]
  node_sqlite_helper[("SQLite event helper<br/>[database.py]")]
end

node_operator(("Operator"))

node_operator -->|"submits credentials"| node_login
node_login -->|"redirects on success"| node_operator
node_operator -->|"uploads CSV"| node_csv_upload
node_csv_upload -->|"saves and validates"| node_event_csv
node_event_reader -->|"reads events"| node_event_csv
node_event_reader -->|"predicts threats"| node_classifier
node_model_training -->|"saves trained model"| node_classifier
node_operator -->|"requests dashboard"| node_dashboard
node_operator -->|"requests network"| node_network_view
node_operator -->|"requests detection"| node_ai_view
node_operator -->|"requests alerts"| node_alerts
node_operator -->|"requests reports"| node_reports
node_operator -->|"requests download"| node_report_download

click node_login "https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/app.py"
click node_csv_upload "https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/app.py"
click node_event_csv "https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/data/network_data.csv"
click node_event_reader "https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/app.py"
click node_classifier "https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/models/threat_model.pkl"
click node_model_training "https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/models/train_model.py"
click node_dashboard "https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/templates/dashboard.html"
click node_network_view "https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/templates/network.html"
click node_ai_view "https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/templates/ai_detection.html"
click node_alerts "https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/templates/alerts.html"
click node_reports "https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/templates/reports.html"
click node_report_download "https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/app.py"
click node_sqlite_helper "https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/database/database.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_login,node_csv_upload,node_event_csv toneBlue
class node_event_reader,node_classifier toneAmber
class node_dashboard,node_network_view,node_ai_view,node_alerts,node_reports,node_report_download toneMint
class node_model_training,node_sqlite_helper toneRose
class node_operator toneIndigo
```

## Components

### Access and ingestion

- [Login](https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/app.py): `app.py`
- [CSV upload](https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/app.py): `app.py`
- [Network events CSV](https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/data/network_data.csv): `data/network_data.csv`

### Traffic analysis

- [Event reader](https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/app.py): `app.py`
- [Threat classifier](https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/models/threat_model.pkl): `models/threat_model.pkl`

### Security views and reports

- [Dashboard](https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/templates/dashboard.html): `templates/dashboard.html`
- [Network view](https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/templates/network.html): `templates/network.html`
- [AI detection view](https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/templates/ai_detection.html): `templates/ai_detection.html`
- [Alerts view](https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/templates/alerts.html): `templates/alerts.html`
- [Reports view](https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/templates/reports.html): `templates/reports.html`
- [Report download](https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/app.py): `app.py`

### Supporting components

- [Model training](https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/models/train_model.py): `models/train_model.py`
- [SQLite event helper](https://github.com/santhoshkumars08430-afk/cloudsecurityproject/blob/main/database/database.py): `database/database.py`

### Other components

- **Operator**

## Connections

- Operator → Login: submits credentials (evidence: `app.py`)
- Login → Operator: redirects on success (evidence: `app.py`)
- Operator → CSV upload: uploads CSV (evidence: `app.py`)
- CSV upload → Network events CSV: saves and validates (evidence: `app.py`)
- Event reader → Network events CSV: reads events (evidence: `app.py`)
- Event reader → Threat classifier: predicts threats (evidence: `app.py`)
- Model training → Threat classifier: saves trained model (evidence: `models/train_model.py`)
- Operator → Dashboard: requests dashboard
- Operator → Network view: requests network
- Operator → AI detection view: requests detection
- Operator → Alerts view: requests alerts
- Operator → Reports view: requests reports
- Operator → Report download: requests download (evidence: `app.py`)
