# billionmail/billionmail architecture

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

- Interactive diagram: https://gitdiagram.com/billionmail/billionmail
- Repository: https://github.com/billionmail/billionmail
- Video tour (about a minute): https://gitdiagram.com/billionmail/billionmail/video

## Overview

BillionMail is a self-hosted mail server and email-marketing platform. Its documented user workflow is to connect a sending domain and verify DNS/SSL, manage subscribers and lists, build a campaign from reusable email content, schedule or send it, then review delivery and engagement analytics. The tree shows a Vue management UI and Go API domains for these capabilities. Sampled code confirms AI-provider administration and domain project-editing requests; other relationships below rely on README descriptions, not inspected implementation. Infrastructure internals and persistence are not established by the excerpts.

Main entry points: [`core/frontend/src/views/domain/index.vue`](https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/views/domain/index.vue) (Domain management), [`core/frontend/src/views/domain/pages/editDomain/controller/projectDetail.controller.ts`](https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/views/domain/pages/editDomain/controller/projectDetail.controller.ts) (Domain project editor), [`core/api/campaign/v1/subscription.go`](https://github.com/billionmail/billionmail/blob/dev/core/api/campaign/v1/subscription.go) (Campaign management), [`core/api/batch_mail/v1/batch_mail.go`](https://github.com/billionmail/billionmail/blob/dev/core/api/batch_mail/v1/batch_mail.go) (Batch mail tasks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_management["Management UI"]
  node_app["Admin application<br/>[App.vue]"]
  node_domainui["Domain management<br/>[index.vue]"]
  node_domainedit["Domain project editor"]
  node_stores["UI state stores<br/>[global.ts]"]
end

subgraph group_audience["Audience and content"]
  node_contacts["Subscriber management<br/>[index.vue]"]
  node_contactapi["Contact API<br/>[contact.go]"]
  node_templates["Email templates"]
  node_editor["Email editor<br/>[Canvas.vue]"]
end

subgraph group_delivery["Campaign delivery"]
  node_campaigns["Campaign management<br/>[subscription.go]"]
  node_batch["Batch mail tasks<br/>[batch_mail.go]"]
  node_analytics["Campaign analytics<br/>[stat_service.go]"]
end

subgraph group_mailops["Mail operations"]
  node_mailboxes["Mailboxes and services<br/>[mailboxes.go]"]
  node_relay["Mail relay<br/>[relay.go]"]
  node_queue["Postfix queue<br/>[postfix_queue.go]"]
end

subgraph group_assistance["AI assistance"]
  node_aiui["AI model settings<br/>[ModelManager.vue]"]
  node_aicontroller["AI provider controller<br/>[index.ts]"]
  node_aiapi["AI supplier API<br/>[supplier.go]"]
  node_projectapi["AI project API<br/>[project.go]"]
end

node_marketer(("Marketer"))

node_marketer -->|"connects domain"| node_domainui
node_marketer -->|"manages subscribers"| node_contacts
node_marketer -->|"builds campaign content"| node_templates
node_marketer -->|"schedules or sends"| node_campaigns
node_marketer -->|"reviews results"| node_analytics
node_domainui -.->|"edits project"| node_domainedit
node_domainedit -->|"requests project data"| node_projectapi
node_aiui -->|"invokes settings"| node_aicontroller
node_aicontroller -->|"calls supplier endpoints"| node_aiapi
node_editor -.->|"creates reusable content"| node_templates
node_campaigns -.->|"queues campaign sending"| node_batch
node_batch -.->|"records send statistics"| node_analytics
node_mailboxes -.->|"uses mail transport"| node_relay
node_relay -.->|"dispatches mail"| node_queue

click node_app "https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/App.vue"
click node_domainui "https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/views/domain/index.vue"
click node_domainedit "https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/views/domain/pages/editDomain/controller/projectDetail.controller.ts"
click node_stores "https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/store/modules/global.ts"
click node_contacts "https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/views/contacts/subscribers/index.vue"
click node_contactapi "https://github.com/billionmail/billionmail/blob/dev/core/api/contact/v1/contact.go"
click node_templates "https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/views/template/components/TemplatePreview.vue"
click node_editor "https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/features/EmailEditor/components/layout/Canvas.vue"
click node_campaigns "https://github.com/billionmail/billionmail/blob/dev/core/api/campaign/v1/subscription.go"
click node_batch "https://github.com/billionmail/billionmail/blob/dev/core/api/batch_mail/v1/batch_mail.go"
click node_analytics "https://github.com/billionmail/billionmail/blob/dev/core/internal/service/batch_mail/stat_service.go"
click node_mailboxes "https://github.com/billionmail/billionmail/blob/dev/core/api/mail_boxes/v1/mailboxes.go"
click node_relay "https://github.com/billionmail/billionmail/blob/dev/core/api/relay/v1/relay.go"
click node_queue "https://github.com/billionmail/billionmail/blob/dev/core/api/mail_services/v1/postfix_queue.go"
click node_aiui "https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/views/settings/ai-model/components/ModelManager.vue"
click node_aicontroller "https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/views/settings/ai-model/controller/index.ts"
click node_aiapi "https://github.com/billionmail/billionmail/blob/dev/core/api/askai/v1/supplier.go"
click node_projectapi "https://github.com/billionmail/billionmail/blob/dev/core/api/askai/v1/project.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_app,node_domainui,node_domainedit,node_stores toneBlue
class node_contacts,node_contactapi,node_templates,node_editor toneAmber
class node_campaigns,node_batch,node_analytics toneMint
class node_mailboxes,node_relay,node_queue toneRose
class node_aiui,node_aicontroller,node_aiapi,node_projectapi,node_marketer toneIndigo
```

## Components

### Management UI

- [Admin application](https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/App.vue): `core/frontend/src/App.vue`
- [Domain management](https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/views/domain/index.vue): `core/frontend/src/views/domain/index.vue`
- [Domain project editor](https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/views/domain/pages/editDomain/controller/projectDetail.controller.ts): `core/frontend/src/views/domain/pages/editDomain/controller/projectDetail.controller.ts`
- [UI state stores](https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/store/modules/global.ts): `core/frontend/src/store/modules/global.ts`

### Audience and content

- [Subscriber management](https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/views/contacts/subscribers/index.vue): `core/frontend/src/views/contacts/subscribers/index.vue`
- [Contact API](https://github.com/billionmail/billionmail/blob/dev/core/api/contact/v1/contact.go): `core/api/contact/v1/contact.go`
- [Email templates](https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/views/template/components/TemplatePreview.vue): `core/frontend/src/views/template/components/TemplatePreview.vue`
- [Email editor](https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/features/EmailEditor/components/layout/Canvas.vue): `core/frontend/src/features/EmailEditor/components/layout/Canvas.vue`

### Campaign delivery

- [Campaign management](https://github.com/billionmail/billionmail/blob/dev/core/api/campaign/v1/subscription.go): `core/api/campaign/v1/subscription.go`
- [Batch mail tasks](https://github.com/billionmail/billionmail/blob/dev/core/api/batch_mail/v1/batch_mail.go): `core/api/batch_mail/v1/batch_mail.go`
- [Campaign analytics](https://github.com/billionmail/billionmail/blob/dev/core/internal/service/batch_mail/stat_service.go): `core/internal/service/batch_mail/stat_service.go`

### Mail operations

- [Mailboxes and services](https://github.com/billionmail/billionmail/blob/dev/core/api/mail_boxes/v1/mailboxes.go): `core/api/mail_boxes/v1/mailboxes.go`
- [Mail relay](https://github.com/billionmail/billionmail/blob/dev/core/api/relay/v1/relay.go): `core/api/relay/v1/relay.go`
- [Postfix queue](https://github.com/billionmail/billionmail/blob/dev/core/api/mail_services/v1/postfix_queue.go): `core/api/mail_services/v1/postfix_queue.go`

### AI assistance

- [AI model settings](https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/views/settings/ai-model/components/ModelManager.vue): `core/frontend/src/views/settings/ai-model/components/ModelManager.vue`
- [AI provider controller](https://github.com/billionmail/billionmail/blob/dev/core/frontend/src/views/settings/ai-model/controller/index.ts): `core/frontend/src/views/settings/ai-model/controller/index.ts`
- [AI supplier API](https://github.com/billionmail/billionmail/blob/dev/core/api/askai/v1/supplier.go): `core/api/askai/v1/supplier.go`
- [AI project API](https://github.com/billionmail/billionmail/blob/dev/core/api/askai/v1/project.go): `core/api/askai/v1/project.go`

### Other components

- **Marketer**

## Connections

- Marketer → Domain management: connects domain (evidence: `README.md`)
- Marketer → Subscriber management: manages subscribers (evidence: `README.md`)
- Marketer → Email templates: builds campaign content (evidence: `README.md`)
- Marketer → Campaign management: schedules or sends (evidence: `README.md`)
- Marketer → Campaign analytics: reviews results (evidence: `README.md`)
- Domain management → Domain project editor: edits project
- Domain project editor → AI project API: requests project data (evidence: `core/frontend/src/views/domain/pages/editDomain/controller/projectDetail.controller.ts`)
- AI model settings → AI provider controller: invokes settings (evidence: `core/frontend/src/views/settings/ai-model/components/ModelManager.vue`)
- AI provider controller → AI supplier API: calls supplier endpoints (evidence: `core/frontend/src/views/settings/ai-model/controller/index.ts`)
- Email editor → Email templates: creates reusable content
- Campaign management → Batch mail tasks: queues campaign sending
- Batch mail tasks → Campaign analytics: records send statistics
- Mailboxes and services → Mail relay: uses mail transport
- Mail relay → Postfix queue: dispatches mail
