How kayo2970/mailer works
Mailer is a local-first mail-merge and email dispatch app. The user configures an account, composes a message and recipient list, previews and schedules or queues individualized messages, then monitors delivery and history. Images and attachments are embedded or stored locally; a background worker sends through configured SMTP or direct delivery. The graph reflects documented workflows and indexed imports; some implementation details are unsampled, so uncertain connections are omitted.
Main entry points: email-service.ts Mail engine and worker · compose-tab.tsx Compose screen · page.tsx App shell · route.ts Send endpoint
Components 23
User interface
- App shell
src/app/page.tsx - Terms gate
src/components/terms-gate.tsx - Settings screen
src/components/settings-tab.tsx - Queue and history
src/components/log-list.tsx
Composition
- Compose screen
src/components/compose-tab.tsx - Message editor
src/components/rich-editor.tsx - Recipient parsing
src/lib/mail-merge.ts - Compose helpers
src/lib/compose-editor.ts - Attachment handling
src/lib/email-attachments.ts - Image library UI
src/components/image-library.tsx - Inline image refs
src/lib/inline-images.ts
API and dispatch
- Browser API client
src/lib/client.ts - Local request guard
src/lib/api.ts - Send endpoint
src/app/api/send/route.ts - Other API routes
src/app/api
Local data
- Image library service
src/lib/images.ts - Upload file storage
src/lib/file-storage.ts - JSON collections
src/lib/store.ts
Delivery
- Mail engine and worker
src/lib/email-service.ts - Direct SMTP transport
src/lib/direct-smtp-transport.ts - Social image generation
src/lib/social-png.ts
Other components
- Local user
- SMTP mail server
Connections 34
- Local user → App shell: uses
- App shell → Compose screen: renders
src/app/page.tsx - App shell → Settings screen: renders
src/app/page.tsx - App shell → Queue and history: renders
src/app/page.tsx - App shell → Terms gate: shows
src/app/page.tsx - Compose screen → Recipient parsing: parses recipients
src/components/compose-tab.tsx - Compose screen → Message editor: uses
src/components/compose-tab.tsx - Compose screen → Compose helpers: uses
src/components/compose-tab.tsx - Compose screen → Attachment handling: checks attachments
src/components/compose-tab.tsx - Compose screen → Image library UI: opens picker
src/components/compose-tab.tsx - Message editor → Inline image refs: formats image refs
src/components/rich-editor.tsx - Image library UI → Inline image refs: inserts image refs
src/components/image-library.tsx - Compose screen → Browser API client: submits requests
src/components/compose-tab.tsx - Settings screen → Browser API client: saves settings
src/components/settings-tab.tsx - Queue and history → Browser API client: loads queue
src/components/log-list.tsx - Browser API client → Send endpoint: calls API
- Browser API client → Other API routes: calls API
src/lib/client.ts - Send endpoint → Local request guard: guards request
src/app/api/send/route.ts - Other API routes → Local request guard: guards requests
src/app/api/settings/route.ts - Send endpoint → Recipient parsing: validates addresses
src/app/api/send/route.ts - Send endpoint → Attachment handling: checks size limit
src/app/api/send/route.ts - Send endpoint → Mail engine and worker: enqueues batch
src/app/api/send/route.ts - Other API routes → Mail engine and worker: handles settings and logs
src/app/api/settings/route.ts - Other API routes → Image library service: handles images
src/app/api/images/route.ts - Mail engine and worker → JSON collections: reads and writes
src/lib/email-service.ts - Image library service → JSON collections: stores metadata
src/lib/images.ts - Image library service → Upload file storage: reads and writes files
src/lib/images.ts - Mail engine and worker → Direct SMTP transport: uses when selected
src/lib/email-service.ts - Mail engine and worker → SMTP mail server: delivers messages
- Direct SMTP transport → SMTP mail server: delivers directly
- Mail engine and worker → Image library service: loads inline images
src/lib/email-service.ts - Mail engine and worker → Inline image refs: builds image refs
src/lib/email-service.ts - Mail engine and worker → Social image generation: adds social images
src/lib/email-service.ts - Mail engine and worker → Queue and history: updates queue and history