# prathameshsail72-hue/cyberguard architecture

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

- Interactive diagram: https://gitdiagram.com/prathameshsail72-hue/cyberguard
- Repository: https://github.com/prathameshsail72-hue/cyberguard

## Overview

#### Purpose and execution surface
CYBERGUARD is a Python 3 desktop cybersecurity assessment application. Its primary PyQt6 entry point is `main.py`; `cyberguard_v3.py` appears to be an alternate/versioned application entry path. The repository also contains a separate web-shaped surface in `app.py`, with HTML templates and static Chart.js assets, suggesting a parallel or legacy browser UI rather than the documented primary runtime.

#### Desktop application composition
The desktop shell organizes security tools, analytics, and awareness features into PyQt views and reusable widgets:
- Application startup/window orchestration: `main.py`, `cyberguard_v3.py`
- Feature-level screens: `ui/views/dashboard_view.py`, `ui/views/url_view.py`, `ui/views/phishing_view.py`
- Shared presentation primitives and styling: `ui/components/chart_widget.py`, `ui/components/terminal_log.py`, `ui/styles.py`

Views are the boundary between user interactions and analyzer/database calls; core modules should remain UI-independent.

#### Security analysis engines
Independent core modules implement the primary assessment stages:
- URL/domain inspection, including protocol, structure, and headers: `core/url_analyzer.py`
- Text-based phishing/social-engineering signal detection: `core/phishing_detector.py`
- Password strength, entropy, dictionary, and cracking-risk analysis: `core/password_analyzer.py`
- File hashing, extension, and signature/integrity inspection: `core/file_integrity.py`

These engines receive user-provided URLs, text, passwords, or local files and return findings/risk-oriented results for rendering and persistence.

#### Risk workflow and dashboard analytics
A typical control flow is: a user selects an assessment view, supplies an artifact, the corresponding core analyzer evaluates it, and the UI presents risk details and likely records the event. The dashboard consumes persisted scan history to aggregate total scans, health/risk metrics, critical findings, and distribution visualizations:
- Dashboard aggregation/display: `ui/views/dashboard_view.py`
- Risk display components: `ui/components/risk_badge.py`, `ui/components/circular_gauge.py`
- Browser-side chart rendering for the alternate web surface: `static/css/js/charts.js`

#### Persistence boundary
SQLite is the local system of record for audits and awareness data. Database access is centralized rather than embedded in analyzers:
- Database facade/queries: `database/db_manager.py`
- Additional database module surface: `database.py`, `database/__init__.py`
- Embedded operational database: `cyberguard_desktop.db`

This boundary supports durable scan history and dashboard reporting while keeping the assessment engines primarily deterministic and local.

#### Awareness and non-scan workflows
The application includes interactive education flows distinct from artifact analysis:
- Quiz interface: `ui/views/quiz_view.py`
- Survey/benchmarking interface: `ui/views/survey_view.py`
- Desktop screens for file and password workflows: `ui/views/file_view.py`, `ui/views/password_view.py`

#### Runtimes and external boundaries
The documented runtime is Python 3.9+ with PyQt6, SQLite3, and PyQtGraph-style visualization; dependencies are declared in `requirements.txt`. URL analysis crosses the local boundary through network/HTTP(S) and TLS/header inspection. File analysis accesses user-selected local files. The alternate web surface uses `templates/base.html`, `templates/index.html`, and `static/css/style.css`; deployment intent may be represented by `render.yaml`.

Main entry points: [`ui/views/url_view.py`](https://github.com/prathameshsail72-hue/cyberguard/blob/main/ui/views/url_view.py) (Assessment views), [`database/db_manager.py`](https://github.com/prathameshsail72-hue/cyberguard/blob/main/database/db_manager.py) (Database manager), [`main.py`](https://github.com/prathameshsail72-hue/cyberguard/blob/main/main.py) (Desktop entry point), [`ui/views/file_view.py`](https://github.com/prathameshsail72-hue/cyberguard/blob/main/ui/views/file_view.py) (File and password views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop application"]
  node_main["Desktop entry point<br/>PyQt6 bootstrap<br/>[main.py]"]
  node_v3["Versioned entry path<br/>PyQt6 bootstrap<br/>[cyberguard_v3.py]"]
  node_assessment_views["Assessment views<br/>PyQt screens<br/>[url_view.py]"]
  node_file_password_views["File and password views<br/>PyQt screens<br/>[file_view.py]"]
  node_dashboard["Dashboard<br/>PyQt screen<br/>[dashboard_view.py]"]
  node_awareness_views["Quiz and survey<br/>PyQt screens<br/>[quiz_view.py]"]
  node_ui_components["Shared UI components<br/>PyQt widgets<br/>[chart_widget.py]"]
end

subgraph group_core["Assessment engines"]
  node_url_analyzer{{"URL analyzer<br/>security analyzer<br/>[url_analyzer.py]"}}
  node_phishing_detector{{"Phishing detector<br/>security analyzer"}}
  node_password_analyzer{{"Password analyzer<br/>security analyzer"}}
  node_file_integrity{{"File integrity analyzer<br/>security analyzer<br/>[file_integrity.py]"}}
  node_network(("HTTP&#40;S&#41; and TLS targets<br/>external network"))
  node_local_files["User-selected files<br/>local filesystem"]
end

subgraph group_data["Local persistence"]
  node_db_manager["Database manager<br/>database facade<br/>[db_manager.py]"]
  node_sqlite[("Operational SQLite DB<br/>SQLite database")]
end

subgraph group_web["Alternate web surface"]
  node_web_app["Web app<br/>web entry point<br/>[app.py]"]
  node_web_templates["Web templates<br/>HTML templates<br/>[index.html]"]
  node_web_charts["Browser charts<br/>Chart.js assets<br/>[charts.js]"]
end

node_main -->|"opens"| node_assessment_views
node_main -->|"opens"| node_file_password_views
node_main -->|"opens"| node_dashboard
node_main -->|"opens"| node_awareness_views
node_v3 -.->|"alternate runtime"| node_assessment_views
node_assessment_views -->|"analyzes URLs"| node_url_analyzer
node_assessment_views -->|"analyzes text"| node_phishing_detector
node_file_password_views -->|"inspects files"| node_file_integrity
node_file_password_views -->|"evaluates passwords"| node_password_analyzer
node_url_analyzer -->|"inspects"| node_network
node_file_integrity -->|"reads"| node_local_files
node_assessment_views -->|"records findings"| node_db_manager
node_file_password_views -->|"records findings"| node_db_manager
node_awareness_views -->|"stores responses"| node_db_manager
node_dashboard -->|"queries history"| node_db_manager
node_db_manager -->|"persists"| node_sqlite
node_dashboard -->|"renders metrics"| node_ui_components
node_web_app -->|"serves"| node_web_templates
node_web_templates -->|"loads"| node_web_charts

click node_main "https://github.com/prathameshsail72-hue/cyberguard/blob/main/main.py"
click node_v3 "https://github.com/prathameshsail72-hue/cyberguard/blob/main/cyberguard_v3.py"
click node_assessment_views "https://github.com/prathameshsail72-hue/cyberguard/blob/main/ui/views/url_view.py"
click node_file_password_views "https://github.com/prathameshsail72-hue/cyberguard/blob/main/ui/views/file_view.py"
click node_dashboard "https://github.com/prathameshsail72-hue/cyberguard/blob/main/ui/views/dashboard_view.py"
click node_awareness_views "https://github.com/prathameshsail72-hue/cyberguard/blob/main/ui/views/quiz_view.py"
click node_ui_components "https://github.com/prathameshsail72-hue/cyberguard/blob/main/ui/components/chart_widget.py"
click node_url_analyzer "https://github.com/prathameshsail72-hue/cyberguard/blob/main/core/url_analyzer.py"
click node_phishing_detector "https://github.com/prathameshsail72-hue/cyberguard/blob/main/core/phishing_detector.py"
click node_password_analyzer "https://github.com/prathameshsail72-hue/cyberguard/blob/main/core/password_analyzer.py"
click node_file_integrity "https://github.com/prathameshsail72-hue/cyberguard/blob/main/core/file_integrity.py"
click node_db_manager "https://github.com/prathameshsail72-hue/cyberguard/blob/main/database/db_manager.py"
click node_sqlite "https://github.com/prathameshsail72-hue/cyberguard/blob/main/cyberguard_desktop.db"
click node_web_app "https://github.com/prathameshsail72-hue/cyberguard/blob/main/app.py"
click node_web_templates "https://github.com/prathameshsail72-hue/cyberguard/blob/main/templates/index.html"
click node_web_charts "https://github.com/prathameshsail72-hue/cyberguard/blob/main/static/css/js/charts.js"

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_main,node_v3,node_assessment_views,node_file_password_views,node_dashboard,node_awareness_views,node_ui_components toneBlue
class node_url_analyzer,node_phishing_detector,node_password_analyzer,node_file_integrity,node_network,node_local_files toneAmber
class node_db_manager,node_sqlite toneMint
class node_web_app,node_web_templates,node_web_charts toneRose
```

## Components

### Desktop application

Primary PyQt6 runtime and user workflows.

- [Desktop entry point](https://github.com/prathameshsail72-hue/cyberguard/blob/main/main.py): PyQt6 bootstrap · Primary application startup and window orchestration. · `main.py`
- [Versioned entry path](https://github.com/prathameshsail72-hue/cyberguard/blob/main/cyberguard_v3.py): PyQt6 bootstrap · Alternate desktop application entry path. · `cyberguard_v3.py`
- [Assessment views](https://github.com/prathameshsail72-hue/cyberguard/blob/main/ui/views/url_view.py): PyQt screens · URL and phishing interaction boundaries. · `ui/views/url_view.py`
- [File and password views](https://github.com/prathameshsail72-hue/cyberguard/blob/main/ui/views/file_view.py): PyQt screens · Local-file and password assessment workflows. · `ui/views/file_view.py`
- [Dashboard](https://github.com/prathameshsail72-hue/cyberguard/blob/main/ui/views/dashboard_view.py): PyQt screen · Aggregates scan history into health and risk metrics. · `ui/views/dashboard_view.py`
- [Quiz and survey](https://github.com/prathameshsail72-hue/cyberguard/blob/main/ui/views/quiz_view.py): PyQt screens · Education and benchmarking workflows. · `ui/views/quiz_view.py`
- [Shared UI components](https://github.com/prathameshsail72-hue/cyberguard/blob/main/ui/components/chart_widget.py): PyQt widgets · Charts, terminal logging, and risk indicators. · `ui/components/chart_widget.py`

### Assessment engines

UI-independent local security analysis.

- [URL analyzer](https://github.com/prathameshsail72-hue/cyberguard/blob/main/core/url_analyzer.py): security analyzer · Inspects URL protocol, structure, headers, and TLS-related signals. · `core/url_analyzer.py`
- [Phishing detector](https://github.com/prathameshsail72-hue/cyberguard/blob/main/core/phishing_detector.py): security analyzer · Detects text-based social-engineering signals. · `core/phishing_detector.py`
- [Password analyzer](https://github.com/prathameshsail72-hue/cyberguard/blob/main/core/password_analyzer.py): security analyzer · Evaluates strength, entropy, dictionary exposure, and cracking risk. · `core/password_analyzer.py`
- [File integrity analyzer](https://github.com/prathameshsail72-hue/cyberguard/blob/main/core/file_integrity.py): security analyzer · Checks hashes, extensions, and signatures. · `core/file_integrity.py`
- **HTTP(S) and TLS targets**: external network · Remote boundary used for URL inspection.
- **User-selected files**: local filesystem · Local artifact boundary for integrity checks.

### Local persistence

SQLite audit and awareness storage.

- [Database manager](https://github.com/prathameshsail72-hue/cyberguard/blob/main/database/db_manager.py): database facade · Centralized queries and persistence access. · `database/db_manager.py`
- [Operational SQLite DB](https://github.com/prathameshsail72-hue/cyberguard/blob/main/cyberguard_desktop.db): SQLite database · Durable scan history and awareness data. · `cyberguard_desktop.db`

### Alternate web surface

Parallel or legacy browser-oriented interface.

- [Web app](https://github.com/prathameshsail72-hue/cyberguard/blob/main/app.py): web entry point · Separate browser-oriented application surface. · `app.py`
- [Web templates](https://github.com/prathameshsail72-hue/cyberguard/blob/main/templates/index.html): HTML templates · Base and index browser UI. · `templates/index.html`
- [Browser charts](https://github.com/prathameshsail72-hue/cyberguard/blob/main/static/css/js/charts.js): Chart.js assets · Client-side chart rendering for the web surface. · `static/css/js/charts.js`

## Connections

- Desktop entry point → Assessment views: opens
- Desktop entry point → File and password views: opens
- Desktop entry point → Dashboard: opens
- Desktop entry point → Quiz and survey: opens
- Versioned entry path → Assessment views: alternate runtime
- Assessment views → URL analyzer: analyzes URLs
- Assessment views → Phishing detector: analyzes text
- File and password views → File integrity analyzer: inspects files
- File and password views → Password analyzer: evaluates passwords
- URL analyzer → HTTP(S) and TLS targets: inspects
- File integrity analyzer → User-selected files: reads
- Assessment views → Database manager: records findings
- File and password views → Database manager: records findings
- Quiz and survey → Database manager: stores responses
- Dashboard → Database manager: queries history
- Database manager → Operational SQLite DB: persists
- Dashboard → Shared UI components: renders metrics
- Web app → Web templates: serves
- Web templates → Browser charts: loads
