# shenal01/gophismodified architecture

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

- Interactive diagram: https://gitdiagram.com/shenal01/gophismodified
- Repository: https://github.com/shenal01/gophismodified

## Overview

Gophish Enhanced is a phishing-simulation and security-awareness platform. An operator configures campaigns, targets, templates, landing pages, and sending profiles through the admin interface; the worker schedules and sends campaign mail, while the phishing server records recipient interactions and displays landing pages. IMAP monitoring supports reporting suspected campaign emails, and webhooks provide outbound event integrations. The excerpts show startup wiring, API route registration, worker dispatch, phishing handlers, and webhook validation; several feature handlers and browser-to-API calls were not sampled, so those connections are not asserted.

Main entry points: [`controllers/api/server.go`](https://github.com/shenal01/gophismodified/blob/master/controllers/api/server.go) (Admin API), [`gophish.go`](https://github.com/shenal01/gophismodified/blob/master/gophish.go) (Application Startup), [`worker/worker.go`](https://github.com/shenal01/gophismodified/blob/master/worker/worker.go) (Campaign Worker), [`controllers/api/webhook.go`](https://github.com/shenal01/gophismodified/blob/master/controllers/api/webhook.go) (Webhook Management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Administration"]
  node_runtime["Application Startup<br/>[gophish.go]"]
  node_configuration["Configuration<br/>[config.go]"]
  node_adminserver["Admin Server<br/>[route.go]"]
  node_api["Admin API<br/>[server.go]"]
  node_userapi["User Management<br/>[user.go]"]
  node_browserui["Admin Interface"]
  node_database[("Application Database<br/>[models.go]")]
end

subgraph group_campaign["Campaign Delivery"]
  node_campaignapi["Campaign Management<br/>[campaign.go]"]
  node_campaignmodel["Campaign State<br/>[campaign.go]"]
  node_targetapi["Groups and Imports"]
  node_contentapi["Templates and Pages"]
  node_sendingapi["Sending Profiles<br/>[smtp.go]"]
  node_worker["Campaign Worker<br/>[worker.go]"]
  node_maillogs["Mail Scheduling<br/>[maillog.go]"]
  node_mailer["Mail Delivery<br/>[mailer.go]"]
end

subgraph group_engagement["Recipient Engagement"]
  node_phishserver["Phishing Server<br/>[phish.go]"]
  node_results["Engagement Results<br/>[result.go]"]
  node_imapmonitor["IMAP Monitoring<br/>[monitor.go]"]
end

subgraph group_integrations["Integrations"]
  node_webhookapi["Webhook Management<br/>[webhook.go]"]
  node_webhookmodel["Webhook Settings<br/>[webhook.go]"]
  node_webhooksender["Webhook Sender<br/>[webhook.go]"]
end

node_operator(("Operator"))

node_operator -.->|"uses"| node_browserui
node_runtime -->|"loads"| node_configuration
node_runtime -->|"starts"| node_adminserver
node_runtime -->|"starts"| node_phishserver
node_adminserver -->|"routes to"| node_api
node_api -->|"registers"| node_userapi
node_api -->|"registers"| node_campaignapi
node_api -->|"registers"| node_targetapi
node_api -->|"registers"| node_contentapi
node_api -->|"registers"| node_sendingapi
node_api -->|"registers"| node_webhookapi
node_api -->|"creates"| node_worker
node_worker -->|"loads"| node_maillogs
node_worker -->|"loads context"| node_campaignmodel
node_worker -->|"queues mail"| node_mailer
node_imapmonitor -->|"looks up"| node_results
node_webhookapi -->|"reads and writes"| node_webhookmodel
node_webhookapi -->|"validates via"| node_webhooksender
node_runtime -->|"initializes"| node_database

click node_runtime "https://github.com/shenal01/gophismodified/blob/master/gophish.go"
click node_configuration "https://github.com/shenal01/gophismodified/blob/master/config/config.go"
click node_adminserver "https://github.com/shenal01/gophismodified/blob/master/controllers/route.go"
click node_api "https://github.com/shenal01/gophismodified/blob/master/controllers/api/server.go"
click node_userapi "https://github.com/shenal01/gophismodified/blob/master/controllers/api/user.go"
click node_browserui "https://github.com/shenal01/gophismodified/tree/master/static/js/src/app"
click node_database "https://github.com/shenal01/gophismodified/blob/master/models/models.go"
click node_campaignapi "https://github.com/shenal01/gophismodified/blob/master/controllers/api/campaign.go"
click node_campaignmodel "https://github.com/shenal01/gophismodified/blob/master/models/campaign.go"
click node_targetapi "https://github.com/shenal01/gophismodified/tree/master/controllers/api"
click node_contentapi "https://github.com/shenal01/gophismodified/tree/master/controllers/api"
click node_sendingapi "https://github.com/shenal01/gophismodified/blob/master/controllers/api/smtp.go"
click node_worker "https://github.com/shenal01/gophismodified/blob/master/worker/worker.go"
click node_maillogs "https://github.com/shenal01/gophismodified/blob/master/models/maillog.go"
click node_mailer "https://github.com/shenal01/gophismodified/blob/master/mailer/mailer.go"
click node_phishserver "https://github.com/shenal01/gophismodified/blob/master/controllers/phish.go"
click node_results "https://github.com/shenal01/gophismodified/blob/master/models/result.go"
click node_imapmonitor "https://github.com/shenal01/gophismodified/blob/master/imap/monitor.go"
click node_webhookapi "https://github.com/shenal01/gophismodified/blob/master/controllers/api/webhook.go"
click node_webhookmodel "https://github.com/shenal01/gophismodified/blob/master/models/webhook.go"
click node_webhooksender "https://github.com/shenal01/gophismodified/blob/master/webhook/webhook.go"

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_runtime,node_configuration,node_adminserver,node_api,node_userapi,node_browserui,node_database toneBlue
class node_campaignapi,node_campaignmodel,node_targetapi,node_contentapi,node_sendingapi,node_worker,node_maillogs,node_mailer toneAmber
class node_phishserver,node_results,node_imapmonitor toneMint
class node_webhookapi,node_webhookmodel,node_webhooksender toneRose
class node_operator toneIndigo
```

## Components

### Administration

- [Application Startup](https://github.com/shenal01/gophismodified/blob/master/gophish.go): `gophish.go`
- [Configuration](https://github.com/shenal01/gophismodified/blob/master/config/config.go): `config/config.go`
- [Admin Server](https://github.com/shenal01/gophismodified/blob/master/controllers/route.go): `controllers/route.go`
- [Admin API](https://github.com/shenal01/gophismodified/blob/master/controllers/api/server.go): `controllers/api/server.go`
- [User Management](https://github.com/shenal01/gophismodified/blob/master/controllers/api/user.go): `controllers/api/user.go`
- [Admin Interface](https://github.com/shenal01/gophismodified/tree/master/static/js/src/app): `static/js/src/app`
- [Application Database](https://github.com/shenal01/gophismodified/blob/master/models/models.go): `models/models.go`

### Campaign Delivery

- [Campaign Management](https://github.com/shenal01/gophismodified/blob/master/controllers/api/campaign.go): `controllers/api/campaign.go`
- [Campaign State](https://github.com/shenal01/gophismodified/blob/master/models/campaign.go): `models/campaign.go`
- [Groups and Imports](https://github.com/shenal01/gophismodified/tree/master/controllers/api): `controllers/api`
- [Templates and Pages](https://github.com/shenal01/gophismodified/tree/master/controllers/api): `controllers/api`
- [Sending Profiles](https://github.com/shenal01/gophismodified/blob/master/controllers/api/smtp.go): `controllers/api/smtp.go`
- [Campaign Worker](https://github.com/shenal01/gophismodified/blob/master/worker/worker.go): `worker/worker.go`
- [Mail Scheduling](https://github.com/shenal01/gophismodified/blob/master/models/maillog.go): `models/maillog.go`
- [Mail Delivery](https://github.com/shenal01/gophismodified/blob/master/mailer/mailer.go): `mailer/mailer.go`

### Recipient Engagement

- [Phishing Server](https://github.com/shenal01/gophismodified/blob/master/controllers/phish.go): `controllers/phish.go`
- [Engagement Results](https://github.com/shenal01/gophismodified/blob/master/models/result.go): `models/result.go`
- [IMAP Monitoring](https://github.com/shenal01/gophismodified/blob/master/imap/monitor.go): `imap/monitor.go`

### Integrations

- [Webhook Management](https://github.com/shenal01/gophismodified/blob/master/controllers/api/webhook.go): `controllers/api/webhook.go`
- [Webhook Settings](https://github.com/shenal01/gophismodified/blob/master/models/webhook.go): `models/webhook.go`
- [Webhook Sender](https://github.com/shenal01/gophismodified/blob/master/webhook/webhook.go): `webhook/webhook.go`

### Other components

- **Operator**

## Connections

- Operator → Admin Interface: uses (evidence: `README.md`)
- Application Startup → Configuration: loads (evidence: `gophish.go`)
- Application Startup → Admin Server: starts (evidence: `gophish.go`)
- Application Startup → Phishing Server: starts (evidence: `gophish.go`)
- Admin Server → Admin API: routes to (evidence: `controllers/route.go`)
- Admin API → User Management: registers (evidence: `controllers/api/server.go`)
- Admin API → Campaign Management: registers (evidence: `controllers/api/server.go`)
- Admin API → Groups and Imports: registers (evidence: `controllers/api/server.go`)
- Admin API → Templates and Pages: registers (evidence: `controllers/api/server.go`)
- Admin API → Sending Profiles: registers (evidence: `controllers/api/server.go`)
- Admin API → Webhook Management: registers (evidence: `controllers/api/server.go`)
- Admin API → Campaign Worker: creates (evidence: `controllers/api/server.go`)
- Campaign Worker → Mail Scheduling: loads (evidence: `worker/worker.go`)
- Campaign Worker → Campaign State: loads context (evidence: `worker/worker.go`)
- Campaign Worker → Mail Delivery: queues mail (evidence: `worker/worker.go`)
- IMAP Monitoring → Engagement Results: looks up (evidence: `imap/monitor.go`)
- Webhook Management → Webhook Settings: reads and writes (evidence: `controllers/api/webhook.go`)
- Webhook Management → Webhook Sender: validates via (evidence: `controllers/api/webhook.go`)
- Application Startup → Application Database: initializes (evidence: `gophish.go`)
