# yashn555/faceguard_pro architecture

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

- Interactive diagram: https://gitdiagram.com/yashn555/faceguard_pro
- Repository: https://github.com/yashn555/faceguard_pro

## Overview

FaceGuard Pro is an offline Windows security application. Its main workflow responds to workstation events by presenting a fullscreen lock, verifying a registered face or fallback password, and recording access attempts; failed attempts can trigger photo alerts and the configured shutdown policy. A separate Flask dashboard exposes logs, photos, settings, and friend management. The excerpts show daemon-to-dashboard startup and some database behavior; several feature-level links below are documented in the README rather than verified in unsampled implementation.

Main entry points: [`FaceGuard_Pro.py`](https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py) (Access Verification), [`admin_dashboard.py`](https://github.com/yashn555/faceguard_pro/blob/main/admin_dashboard.py) (Dashboard Features), [`templates/dashboard.html`](https://github.com/yashn555/faceguard_pro/blob/main/templates/dashboard.html) (Dashboard UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_protection["Workstation Protection"]
  node_daemon["Security Daemon<br/>[FaceGuard_Pro.py]"]
  node_event_listener["Event Listener<br/>[FaceGuard_Pro.py]"]
  node_lock_screen["Fullscreen Lock<br/>[FaceGuard_Pro.py]"]
  node_verification["Access Verification<br/>[FaceGuard_Pro.py]"]
  node_policy["Attempt Policy<br/>[FaceGuard_Pro.py]"]
end

subgraph group_identity["Identity and Alerts"]
  node_camera["Webcam Capture<br/>[FaceGuard_Pro.py]"]
  node_face_registry["Face Registration<br/>[FaceGuard_Pro.py]"]
  node_encryption["Encrypted Face Storage<br/>[FaceGuard_Pro.py]"]
  node_email_alerts["Email Alerts<br/>[FaceGuard_Pro.py]"]
end

subgraph group_storage["Local Data"]
  node_photo_storage[("Photo Backup<br/>[FaceGuard_Pro.py]")]
  node_access_db[("Access Database<br/>[FaceGuard_Pro.py]")]
end

subgraph group_dashboard["Administration"]
  node_dashboard_server["Dashboard Server<br/>[admin_dashboard.py]"]
  node_dashboard_ui["Dashboard UI<br/>[dashboard.html]"]
  node_dashboard_api["Dashboard Features<br/>[admin_dashboard.py]"]
end

node_windows(("Windows Events"))
node_gmail["Gmail"]
node_admin(("Administrator"))

node_windows -->|"signals events"| node_event_listener
node_event_listener -->|"notifies"| node_daemon
node_daemon -->|"triggers lock"| node_lock_screen
node_daemon -->|"starts server"| node_dashboard_server
node_lock_screen -.->|"requests verification"| node_verification
node_verification -.->|"checks registered faces"| node_face_registry
node_verification -.->|"captures face"| node_camera
node_verification -->|"counts failures"| node_policy
node_verification -->|"logs attempts"| node_access_db
node_policy -.->|"captures failures"| node_camera
node_camera -->|"saves photos"| node_photo_storage
node_policy -->|"sends failure alert"| node_email_alerts
node_email_alerts -->|"sends email"| node_gmail
node_face_registry -->|"encrypts encodings"| node_encryption
node_dashboard_server -->|"renders page"| node_dashboard_ui
node_admin -->|"opens dashboard"| node_dashboard_server
node_dashboard_server -->|"routes requests"| node_dashboard_api
node_dashboard_api -->|"reads and updates"| node_access_db
node_dashboard_api -->|"serves photos"| node_photo_storage
node_dashboard_api -->|"manages friends"| node_face_registry

click node_daemon "https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py"
click node_event_listener "https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py"
click node_lock_screen "https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py"
click node_verification "https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py"
click node_policy "https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py"
click node_camera "https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py"
click node_face_registry "https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py"
click node_encryption "https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py"
click node_photo_storage "https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py"
click node_access_db "https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py"
click node_email_alerts "https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py"
click node_dashboard_server "https://github.com/yashn555/faceguard_pro/blob/main/admin_dashboard.py"
click node_dashboard_ui "https://github.com/yashn555/faceguard_pro/blob/main/templates/dashboard.html"
click node_dashboard_api "https://github.com/yashn555/faceguard_pro/blob/main/admin_dashboard.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_daemon,node_event_listener,node_lock_screen,node_verification,node_policy toneBlue
class node_camera,node_face_registry,node_encryption,node_email_alerts toneAmber
class node_photo_storage,node_access_db toneMint
class node_dashboard_server,node_dashboard_ui,node_dashboard_api toneRose
class node_windows,node_gmail,node_admin toneIndigo
```

## Components

### Workstation Protection

- [Security Daemon](https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py): `FaceGuard_Pro.py`
- [Event Listener](https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py): `FaceGuard_Pro.py`
- [Fullscreen Lock](https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py): `FaceGuard_Pro.py`
- [Access Verification](https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py): `FaceGuard_Pro.py`
- [Attempt Policy](https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py): `FaceGuard_Pro.py`

### Identity and Alerts

- [Webcam Capture](https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py): `FaceGuard_Pro.py`
- [Face Registration](https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py): `FaceGuard_Pro.py`
- [Encrypted Face Storage](https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py): `FaceGuard_Pro.py`
- [Email Alerts](https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py): `FaceGuard_Pro.py`

### Local Data

- [Photo Backup](https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py): `FaceGuard_Pro.py`
- [Access Database](https://github.com/yashn555/faceguard_pro/blob/main/FaceGuard_Pro.py): `FaceGuard_Pro.py`

### Administration

- [Dashboard Server](https://github.com/yashn555/faceguard_pro/blob/main/admin_dashboard.py): `admin_dashboard.py`
- [Dashboard UI](https://github.com/yashn555/faceguard_pro/blob/main/templates/dashboard.html): `templates/dashboard.html`
- [Dashboard Features](https://github.com/yashn555/faceguard_pro/blob/main/admin_dashboard.py): `admin_dashboard.py`

### Other components

- **Windows Events**
- **Gmail**
- **Administrator**

## Connections

- Windows Events → Event Listener: signals events (evidence: `README.md`)
- Event Listener → Security Daemon: notifies (evidence: `README.md`)
- Security Daemon → Fullscreen Lock: triggers lock (evidence: `FaceGuard_Pro.py`)
- Security Daemon → Dashboard Server: starts server (evidence: `FaceGuard_Pro.py`)
- Fullscreen Lock → Access Verification: requests verification (evidence: `FaceGuard_Pro.py`)
- Access Verification → Face Registration: checks registered faces (evidence: `FaceGuard_Pro.py`)
- Access Verification → Webcam Capture: captures face (evidence: `FaceGuard_Pro.py`)
- Access Verification → Attempt Policy: counts failures (evidence: `README.md`)
- Access Verification → Access Database: logs attempts (evidence: `FaceGuard_Pro.py`)
- Attempt Policy → Webcam Capture: captures failures (evidence: `FaceGuard_Pro.py`)
- Webcam Capture → Photo Backup: saves photos (evidence: `README.md`)
- Attempt Policy → Email Alerts: sends failure alert (evidence: `README.md`)
- Email Alerts → Gmail: sends email (evidence: `README.md`)
- Face Registration → Encrypted Face Storage: encrypts encodings (evidence: `README.md`)
- Dashboard Server → Dashboard UI: renders page (evidence: `admin_dashboard.py`)
- Administrator → Dashboard Server: opens dashboard (evidence: `README.md`)
- Dashboard Server → Dashboard Features: routes requests (evidence: `admin_dashboard.py`)
- Dashboard Features → Access Database: reads and updates (evidence: `admin_dashboard.py`)
- Dashboard Features → Photo Backup: serves photos (evidence: `admin_dashboard.py`)
- Dashboard Features → Face Registration: manages friends (evidence: `admin_dashboard.py`)
