# gemgeorge/sniperphish architecture

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

- Interactive diagram: https://gitdiagram.com/gemgeorge/sniperphish
- Repository: https://github.com/gemgeorge/sniperphish

## Overview

##### Architectural Layers (Top to bottom)

Layer 1: User Interface
- Web Dashboard (/spear directory)
- Campaign Management Interface
- Reporting Interface

Layer 2: Application Logic
- Campaign Manager
- Mail Campaign System
- Web Tracker System
- Quick Tracker Module
- Authentication System

Layer 3: Core Services
- Mail Service (Multiple mailer implementations)
- Tracking Service
- Report Generation Service
- File Hosting Service

Layer 4: Storage
- Database
- File Storage (uploads/, attachments/)

a. Primary Flows:
- User -> Web Interface -> Campaign Manager -> Mail System -> Target
- Target -> Tracking System -> Database -> Reporting System -> User

b. Secondary Flows:
- Web Tracker -> Tracking System
- Quick Tracker -> Tracking System
- File Uploads -> Storage System

a. Mail Campaign System:
- Template Management
- User Group Management
- Sender Configuration
- Campaign Scheduling
- QR/Barcode Support

b. Tracking System:
- Web Visit Tracking
- Form Submission Tracking
- Email Open Tracking
- Link Click Tracking
- Reply Tracking

##### Security Layer (Show as a surrounding border)
- Authentication
- Session Management
- Encryption Support
- Anti-flood Control

- External Mail Servers
- Web Trackers
- Landing Pages
- File Hosting

- → Data Flow
- ⇢ User Interaction
- ⬡ External Service
- □ Core Component
- ⬒ Security Layer

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "User Interface Layer"
        WD["Main Dashboard"]:::frontend
        CI["Campaign Interface"]:::frontend
        RI["Reporting Interface"]:::frontend
    end

    subgraph "Application Logic Layer"
        CM["Campaign Manager"]:::core
        MCS["Mail Campaign System"]:::core
        WTS["Web Tracker System"]:::core
        QTM["Quick Tracker Module"]:::core
        AUTH["Authentication System"]:::core
    end

    subgraph "Core Services Layer"
        MS["Mail Service"]:::service
        TS["Tracking Service"]:::service
        RGS["Report Generation"]:::service
        FHS["File Hosting Service"]:::service
    end

    subgraph "Storage Layer"
        DB[(Database)]:::storage
        FS["File Storage"]:::storage
    end

    subgraph "External Services"
        SMTP[("SMTP Servers")]:::external
        WS["Web Server\nPHP 8.1+"]:::external
    end

    subgraph "Security Layer"
        SM["Session Management"]:::security
        ENC["Encryption"]:::security
        AFC["Anti-flood Control"]:::security
    end

    %% Connections
    WD --> CM
    CI --> MCS
    RI --> RGS
    
    CM --> MS
    MCS --> MS
    WTS --> TS
    QTM --> TS
    
    MS --> SMTP
    TS --> DB
    RGS --> DB
    FHS --> FS
    
    MS -.-> SM
    TS -.-> SM
    RGS -.-> SM

    %% Click Events
    click WD "https://github.com/GemGeorge/SniperPhish/blob/main/spear/Home.php"
    click CI "https://github.com/GemGeorge/SniperPhish/blob/main/spear/MailCampaignList.php"
    click RI "https://github.com/GemGeorge/SniperPhish/blob/main/spear/MailCmpDashboard.php"
    click CM "https://github.com/GemGeorge/SniperPhish/blob/main/spear/manager/mail_campaign_manager.php"
    click MCS "https://github.com/GemGeorge/SniperPhish/blob/main/spear/core/mail_campaign_cron.php"
    click WTS "https://github.com/GemGeorge/SniperPhish/blob/main/spear/manager/web_tracker_generator_list_manager.php"
    click QTM "https://github.com/GemGeorge/SniperPhish/blob/main/spear/manager/quick_tracker_manager.php"
    click TS "https://github.com/GemGeorge/SniperPhish/blob/main/track.php"
    click MS "https://github.com/GemGeorge/SniperPhish/blob/main/spear/MailSender.php"
    click FHS "https://github.com/GemGeorge/SniperPhish/tree/main/spear/uploads"
    click SM "https://github.com/GemGeorge/SniperPhish/blob/main/spear/manager/session_manager.php"

    %% Styles
    classDef frontend fill:#e1f5fe,stroke:#01579b
    classDef core fill:#fff3e0,stroke:#e65100
    classDef service fill:#e8f5e9,stroke:#2e7d32
    classDef storage fill:#fce4ec,stroke:#880e4f
    classDef external fill:#f3e5f5,stroke:#4a148c
    classDef security fill:#ffebee,stroke:#b71c1c

    %% Legend
    subgraph Legend
        L1[Frontend]:::frontend
        L2[Core]:::core
        L3[Service]:::service
        L4[Storage]:::storage
        L5[External]:::external
        L6[Security]:::security
    end
```
