# myabyss000/vigiledge-collage-project architecture

> Architecture diagram of the GitHub repository myabyss000/vigiledge-collage-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/myabyss000/vigiledge-collage-project
- Repository: https://github.com/myabyss000/vigiledge-collage-project

## Overview

##### Project type and purpose
- By examining the file tree and README, this is a full-stack Python web application (“VigilEdge”) that provides a web application firewall (WAF) layer, vulnerability testing harnesses, dashboards, and logging. It bundles a Flask-style web server (templates/, static/, api/routes.py), a core engine (core/waf_engine.py, core/security_manager.py), middleware (security_middleware.py), and both SQLite and MongoDB back-ends.

##### File structure
- Top level:
- VigilEdge/
– templates/ & static/ → UI layer
– api/routes.py → HTTP API layer
– middleware/ → request interception (WAF enforcement)
– core/ → business logic (security rules, WAF engine)
– config/waf_rules.yaml → WAF policy definitions
– vulnerable_app*.py → demo vulnerable web apps for testing
– setup, launch scripts → deployment automation (Windows/.ps1)
– requirements.txt → Python dependencies
– vulnerable.db / vulnerable_backup.db → SQLite storage
– scripts to spin up MongoDB variant (launch_mongodb.*)
– tests/ → automated unit and integration tests
- logs/ → central log file
- Patterns: layered MVC (templates UI, Flask routes, core engine), middleware pipeline, pluggable WAF engine, dual-DB support for testing vs production.

##### README for additional insights
- README is minimal (“my Collage project”) but other docs under VigilEdge/ (WAF_INTEGRATION_GUIDE.md, TESTING_README.md) indicate:
- It integrates with external WAF appliances/services
- Provides testing harnesses to validate WAF rules
- Supports analytics dashboards for event_logs, blocked_ips, threat_detection, etc.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client and Test Harness
    subgraph "Client"
        Browser["Client Browser"]:::client
        TestHarness["Test Harness"]:::test
    end

    %% WAF Protection Layer
    subgraph "WAF Protection Layer"
        ExternalWAF("External WAF Appliance"):::external
        InternalMW["Internal Middleware"]:::middleware
    end

    %% Flask Application Stack
    subgraph "Flask Application"
        Entry["Application Entry Point\n(main.py)"]:::entry
        subgraph "API Layer"
            Routes["API Layer\n(routes.py)"]:::api
        end
        subgraph "Middleware Layer"
            MWComp["Security Middleware\n(security_middleware.py)"]:::middleware
        end
        subgraph "Core Layer"
            Engine["Core WAF Engine\n(waf_engine.py)"]:::core
            SecMgr["Security Manager\n(security_manager.py)"]:::core
        end
        Util["Logging Utility\n(logger.py)"]:::util
        Config["Config Store\n(waf_rules.yaml)"]:::config
    end

    %% Datastores
    subgraph "Datastores"
        SQLite["SQLite Database\n(vulnerable.db)"]:::db
        Mongo["MongoDB Instance"]:::db
    end

    %% Logging & Dashboard
    subgraph "Logging & Monitoring"
        LogFile["Log File\n(vigiledge.log)"]:::log
        Dashboard["Dashboard UI\n(templates/static)"]:::ui
    end

    %% Connections
    Browser -->|"HTTP Request"| ExternalWAF
    Browser -->|"HTTP Request"| MWComp
    TestHarness -->|"Attack Traffic"| Routes
    ExternalWAF -->|"Forward Safe Traffic"| Entry
    MWComp -->|"Forward Safe Traffic"| Entry
    Entry -->|"Initialize"| MWComp
    Entry -->|"Route Request"| Routes
    Routes -->|"Invoke Engine"| Engine
    Engine -->|"Enforce Rules"| SecMgr
    Engine -->|"Read/Write"| SQLite
    Engine -->|"Read/Write"| Mongo
    Engine -->|"Log Events"| Util
    Util -->|"Write Logs"| LogFile
    LogFile -->|"Display Logs"| Dashboard
    Routes -->|"Response (HTML/JSON)"| Browser

    %% Click Events
    click Entry "https://github.com/myabyss000/vigiledge-collage-project/blob/main/VigilEdge/main.py"
    click Routes "https://github.com/myabyss000/vigiledge-collage-project/blob/main/VigilEdge/vigiledge/api/routes.py"
    click MWComp "https://github.com/myabyss000/vigiledge-collage-project/blob/main/VigilEdge/vigiledge/middleware/security_middleware.py"
    click Engine "https://github.com/myabyss000/vigiledge-collage-project/blob/main/VigilEdge/vigiledge/core/waf_engine.py"
    click SecMgr "https://github.com/myabyss000/vigiledge-collage-project/blob/main/VigilEdge/vigiledge/core/security_manager.py"
    click Util "https://github.com/myabyss000/vigiledge-collage-project/blob/main/VigilEdge/vigiledge/utils/logger.py"
    click Config "https://github.com/myabyss000/vigiledge-collage-project/blob/main/VigilEdge/config/waf_rules.yaml"
    click Browser "https://github.com/myabyss000/vigiledge-collage-project/tree/main/VigilEdge/templates"
    click Dashboard "https://github.com/myabyss000/vigiledge-collage-project/blob/main/VigilEdge/static/css/enhanced-dashboard.css"
    click Dashboard "https://github.com/myabyss000/vigiledge-collage-project/blob/main/VigilEdge/static/js/enhanced-dashboard.js"
    click SQLite "https://github.com/myabyss000/vigiledge-collage-project/blob/main/VigilEdge/vulnerable.db"
    click TestHarness "https://github.com/myabyss000/vigiledge-collage-project/blob/main/VigilEdge/vulnerable_app.py"
    click LogFile "https://github.com/myabyss000/vigiledge-collage-project/blob/main/VigilEdge/logs/vigiledge.log"

    %% Styles
    classDef client fill:#B3E5FC,stroke:#0288D1,color:#000
    classDef test fill:#E1BEE7,stroke:#8E24AA,color:#000
    classDef external fill:#FFE0B2,stroke:#FB8C00,color:#000
    classDef middleware fill:#BBDEFB,stroke:#1976D2,color:#000
    classDef entry fill:#BBDEFB,stroke:#1976D2,color:#000
    classDef api fill:#C5CAE9,stroke:#303F9F,color:#000
    classDef core fill:#B2DFDB,stroke:#00796B,color:#000
    classDef util fill:#B2DFDB,stroke:#00796B,color:#000
    classDef config fill:#ECEFF1,stroke:#546E7A,color:#000
    classDef db fill:#C8E6C9,stroke:#388E3C,color:#000
    classDef log fill:#CFD8DC,stroke:#455A64,color:#000
    classDef ui fill:#DCEDC8,stroke:#558B2F,color:#000
```
