# vedanshprakash/ai_malware_college_project architecture

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

- Interactive diagram: https://gitdiagram.com/vedanshprakash/ai_malware_college_project
- Repository: https://github.com/vedanshprakash/ai_malware_college_project

## Overview

This is a malware-scanning web application: users authenticate, submit PE/APK files, receive a model-based assessment with optional VirusTotal intelligence, and view scan history and analytics. Flask routes own backend processing and persistence; the React client presents upload, dashboard, history, and analytics workflows through an API service. The README documents Gemini explanations, though the excerpt does not show the call site. Some backend routes and feature extractors were not sampled, so uncertain connections are omitted.

Main entry points: [`frontend/src/services/api.js`](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/frontend/src/services/api.js) (API client), [`backend/routes/scan.py`](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/routes/scan.py) (Scan endpoint), [`frontend/src/components/AppView.jsx`](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/frontend/src/components/AppView.jsx) (Authenticated app view), [`backend/routes/auth.py`](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/routes/auth.py) (Auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_frontend_app["App and routing<br/>[App.jsx]"]
  node_app_view["Authenticated app view<br/>[AppView.jsx]"]
  node_upload_page["File upload<br/>[Upload.jsx]"]
  node_dashboard_page["Dashboard<br/>[Dashboard.jsx]"]
  node_history_page["Scan history<br/>[History.jsx]"]
  node_analytics_page["Analytics<br/>[Analytics.jsx]"]
  node_auth_pages["Login and register"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["Backend API"]
  node_app_server["Flask app<br/>[app.py]"]
  node_auth_routes["Auth routes<br/>[auth.py]"]
  node_scan_routes["Scan endpoint<br/>[scan.py]"]
  node_dashboard_routes["Dashboard routes<br/>[dashboard.py]"]
  node_scan_model["Scan result schema<br/>[scan.py]"]
end

subgraph group_analysis["Threat analysis"]
  node_ml_predict["ML prediction<br/>[ml_predict.py]"]
  node_pe_features["PE feature extraction<br/>[file_features.py]"]
  node_apk_features["APK feature extraction"]
  node_vt_analysis["VirusTotal analysis<br/>[virus_total.py]"]
  node_gemini["Gemini explanations"]
end

subgraph group_persistence["Identity and storage"]
  node_config_storage[("Config and storage<br/>[config.py]")]
  node_user_model["User model<br/>[user.py]"]
end

node_user(("User"))
node_mongodb[("MongoDB")]

node_user -->|"uses"| node_frontend_app
node_frontend_app -->|"routes to"| node_auth_pages
node_frontend_app -->|"renders"| node_app_view
node_app_view -->|"renders"| node_upload_page
node_app_view -->|"renders"| node_dashboard_page
node_app_view -->|"renders"| node_history_page
node_app_view -->|"renders"| node_analytics_page
node_auth_pages -->|"calls"| node_api_client
node_upload_page -->|"submits scan"| node_api_client
node_dashboard_page -->|"requests data"| node_api_client
node_history_page -->|"requests history"| node_api_client
node_analytics_page -->|"requests data"| node_api_client
node_api_client -->|"sends auth requests"| node_auth_routes
node_api_client -->|"sends scan request"| node_scan_routes
node_api_client -->|"requests history"| node_dashboard_routes
node_app_server -->|"registers"| node_auth_routes
node_app_server -->|"registers"| node_scan_routes
node_app_server -->|"registers"| node_dashboard_routes
node_auth_routes -->|"reads and writes users"| node_config_storage
node_auth_routes -->|"imports"| node_user_model
node_dashboard_routes -->|"reads scans"| node_config_storage
node_dashboard_routes -->|"uses schema"| node_scan_model
node_scan_routes -->|"predicts threat"| node_ml_predict
node_scan_routes -->|"requests analysis"| node_vt_analysis
node_ml_predict -->|"extracts PE features"| node_pe_features
node_ml_predict -->|"extracts APK features"| node_apk_features
node_scan_routes -->|"stores scan"| node_config_storage
node_scan_routes -->|"constructs result"| node_scan_model
node_config_storage -->|"connects to"| node_mongodb
node_scan_routes -.->|"requests explanation"| node_gemini
node_vt_analysis --> node_gemini

click node_frontend_app "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/frontend/src/App.jsx"
click node_app_view "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/frontend/src/components/AppView.jsx"
click node_upload_page "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/frontend/src/pages/Upload.jsx"
click node_dashboard_page "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/frontend/src/pages/Dashboard.jsx"
click node_history_page "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/frontend/src/pages/History.jsx"
click node_analytics_page "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/frontend/src/pages/Analytics.jsx"
click node_auth_pages "https://github.com/vedanshprakash/ai_malware_college_project/tree/main/frontend/src/pages"
click node_api_client "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/frontend/src/services/api.js"
click node_app_server "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/app.py"
click node_auth_routes "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/routes/auth.py"
click node_scan_routes "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/routes/scan.py"
click node_dashboard_routes "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/routes/dashboard.py"
click node_scan_model "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/models/scan.py"
click node_ml_predict "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/utils/ml_predict.py"
click node_pe_features "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/utils/file_features.py"
click node_apk_features "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/utils/android_features.py"
click node_vt_analysis "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/utils/virus_total.py"
click node_config_storage "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/config.py"
click node_user_model "https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/models/user.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_frontend_app,node_app_view,node_upload_page,node_dashboard_page,node_history_page,node_analytics_page,node_auth_pages,node_api_client,node_user toneBlue
class node_app_server,node_auth_routes,node_scan_routes,node_dashboard_routes,node_scan_model,node_mongodb toneAmber
class node_ml_predict,node_pe_features,node_apk_features,node_vt_analysis,node_gemini toneMint
class node_config_storage,node_user_model toneRose
```

## Components

### Web client

- [App and routing](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Authenticated app view](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/frontend/src/components/AppView.jsx): `frontend/src/components/AppView.jsx`
- [File upload](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/frontend/src/pages/Upload.jsx): `frontend/src/pages/Upload.jsx`
- [Dashboard](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Scan history](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/frontend/src/pages/History.jsx): `frontend/src/pages/History.jsx`
- [Analytics](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/frontend/src/pages/Analytics.jsx): `frontend/src/pages/Analytics.jsx`
- [Login and register](https://github.com/vedanshprakash/ai_malware_college_project/tree/main/frontend/src/pages): `frontend/src/pages`
- [API client](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Backend API

- [Flask app](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/app.py): `backend/app.py`
- [Auth routes](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/routes/auth.py): `backend/routes/auth.py`
- [Scan endpoint](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/routes/scan.py): `backend/routes/scan.py`
- [Dashboard routes](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/routes/dashboard.py): `backend/routes/dashboard.py`
- [Scan result schema](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/models/scan.py): `backend/models/scan.py`

### Threat analysis

- [ML prediction](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/utils/ml_predict.py): `backend/utils/ml_predict.py`
- [PE feature extraction](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/utils/file_features.py): `backend/utils/file_features.py`
- [APK feature extraction](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/utils/android_features.py): `backend/utils/android_features.py`
- [VirusTotal analysis](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/utils/virus_total.py): `backend/utils/virus_total.py`
- **Gemini explanations**

### Identity and storage

- [Config and storage](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/config.py): `backend/config.py`
- [User model](https://github.com/vedanshprakash/ai_malware_college_project/blob/main/backend/models/user.py): `backend/models/user.py`

### Other components

- **User**
- **MongoDB**

## Connections

- User → App and routing: uses
- App and routing → Login and register: routes to (evidence: `frontend/src/App.jsx`)
- App and routing → Authenticated app view: renders (evidence: `frontend/src/App.jsx`)
- Authenticated app view → File upload: renders (evidence: `frontend/src/components/AppView.jsx`)
- Authenticated app view → Dashboard: renders (evidence: `frontend/src/components/AppView.jsx`)
- Authenticated app view → Scan history: renders (evidence: `frontend/src/components/AppView.jsx`)
- Authenticated app view → Analytics: renders (evidence: `frontend/src/components/AppView.jsx`)
- Login and register → API client: calls (evidence: `frontend/src/services/api.js`)
- File upload → API client: submits scan (evidence: `frontend/src/services/api.js`)
- Dashboard → API client: requests data (evidence: `frontend/src/pages/Dashboard.jsx`)
- Scan history → API client: requests history (evidence: `frontend/src/pages/History.jsx`)
- Analytics → API client: requests data (evidence: `frontend/src/pages/Analytics.jsx`)
- API client → Auth routes: sends auth requests (evidence: `frontend/src/services/api.js`)
- API client → Scan endpoint: sends scan request (evidence: `frontend/src/services/api.js`)
- API client → Dashboard routes: requests history (evidence: `frontend/src/services/api.js`)
- Flask app → Auth routes: registers (evidence: `backend/app.py`)
- Flask app → Scan endpoint: registers (evidence: `backend/app.py`)
- Flask app → Dashboard routes: registers (evidence: `backend/app.py`)
- Auth routes → Config and storage: reads and writes users (evidence: `backend/routes/auth.py`)
- Auth routes → User model: imports (evidence: `backend/routes/auth.py`)
- Dashboard routes → Config and storage: reads scans (evidence: `backend/routes/dashboard.py`)
- Dashboard routes → Scan result schema: uses schema (evidence: `backend/routes/dashboard.py`)
- Scan endpoint → ML prediction: predicts threat (evidence: `backend/routes/scan.py`)
- Scan endpoint → VirusTotal analysis: requests analysis (evidence: `backend/routes/scan.py`)
- ML prediction → PE feature extraction: extracts PE features (evidence: `backend/utils/ml_predict.py`)
- ML prediction → APK feature extraction: extracts APK features (evidence: `backend/utils/ml_predict.py`)
- Scan endpoint → Config and storage: stores scan (evidence: `backend/routes/scan.py`)
- Scan endpoint → Scan result schema: constructs result (evidence: `backend/routes/scan.py`)
- Config and storage → MongoDB: connects to (evidence: `backend/config.py`)
- Scan endpoint → Gemini explanations: requests explanation (evidence: `README.md`)
- VirusTotal analysis → Gemini explanations
