# sanjaynesan-05/maildesginer architecture

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

- Interactive diagram: https://gitdiagram.com/sanjaynesan-05/maildesginer
- Repository: https://github.com/sanjaynesan-05/maildesginer

## Overview

JSN Mail Studio is a manual browser-based HTML email builder with an Express API and Gmail SMTP delivery. The user edits recipient and message fields, builds rich sections and tables, reviews responsive or HTML previews, then sends a test or final message with optional attachments. The graph follows the evidenced UI-to-render and API-to-delivery calls; README-described features are retained where implementation excerpts are incomplete. Some editor actions and browser interactions are documented but not individually sampled.

Main entry points: [`src/App.tsx`](https://github.com/sanjaynesan-05/maildesginer/blob/main/src/App.tsx) (Mail Studio editor), [`server/routes/email.routes.ts`](https://github.com/sanjaynesan-05/maildesginer/blob/main/server/routes/email.routes.ts) (Email routes), [`src/services/html.service.ts`](https://github.com/sanjaynesan-05/maildesginer/blob/main/src/services/html.service.ts) (Email HTML generator), [`src/types/email.ts`](https://github.com/sanjaynesan-05/maildesginer/blob/main/src/types/email.ts) (Draft data model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_editor["Email authoring"]
  node_author["Mail Studio editor<br/>[App.tsx]"]
  node_table["Table editor"]
  node_draft["Draft data model<br/>[email.ts]"]
  node_browser_store[("Local draft storage")]
end

subgraph group_render["Preview and HTML"]
  node_html["Email HTML generator<br/>[html.service.ts]"]
  node_preview["Live preview and HTML view<br/>[App.tsx]"]
end

subgraph group_api["Email API"]
  node_express["Express API server<br/>[index.ts]"]
  node_email_routes["Email routes<br/>[email.routes.ts]"]
  node_attachment["Temporary attachments<br/>[email.routes.ts]"]
  node_server_html["Shared HTML export<br/>[html.service.ts]"]
end

subgraph group_delivery["Gmail delivery"]
  node_mail["SMTP mail service<br/>[mail.service.ts]"]
  node_gmail["Gmail SMTP"]
end

node_user(("Email author"))
node_browser["Web browser"]

node_user -->|"edits draft"| node_author
node_author -->|"updates"| node_draft
node_author -->|"uses editor"| node_table
node_table -->|"updates table data"| node_draft
node_author -->|"autosaves draft"| node_browser_store
node_author -->|"generates markup"| node_html
node_html -->|"reads draft types"| node_draft
node_author -->|"shows preview"| node_preview
node_preview -->|"renders email"| node_browser
node_author -->|"requests email API"| node_browser
node_browser -->|"sends API requests"| node_express
node_express -->|"routes email API"| node_email_routes
node_email_routes -->|"parses uploads"| node_attachment
node_email_routes -->|"generates message HTML"| node_server_html
node_server_html -->|"re-exports generator"| node_html
node_email_routes -->|"sends message"| node_mail
node_mail -->|"delivers via SMTP"| node_gmail

click node_author "https://github.com/sanjaynesan-05/maildesginer/blob/main/src/App.tsx"
click node_table "https://github.com/sanjaynesan-05/maildesginer/blob/main/src/components/SpreadsheetTableEditor.tsx"
click node_draft "https://github.com/sanjaynesan-05/maildesginer/blob/main/src/types/email.ts"
click node_html "https://github.com/sanjaynesan-05/maildesginer/blob/main/src/services/html.service.ts"
click node_preview "https://github.com/sanjaynesan-05/maildesginer/blob/main/src/App.tsx"
click node_express "https://github.com/sanjaynesan-05/maildesginer/blob/main/server/index.ts"
click node_email_routes "https://github.com/sanjaynesan-05/maildesginer/blob/main/server/routes/email.routes.ts"
click node_attachment "https://github.com/sanjaynesan-05/maildesginer/blob/main/server/routes/email.routes.ts"
click node_server_html "https://github.com/sanjaynesan-05/maildesginer/blob/main/server/services/html.service.ts"
click node_mail "https://github.com/sanjaynesan-05/maildesginer/blob/main/server/services/mail.service.ts"

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_author,node_table,node_draft,node_browser_store,node_browser toneBlue
class node_html,node_preview toneAmber
class node_express,node_email_routes,node_attachment,node_server_html toneMint
class node_mail,node_gmail toneRose
class node_user toneIndigo
```

## Components

### Email authoring

- [Mail Studio editor](https://github.com/sanjaynesan-05/maildesginer/blob/main/src/App.tsx): `src/App.tsx`
- [Table editor](https://github.com/sanjaynesan-05/maildesginer/blob/main/src/components/SpreadsheetTableEditor.tsx): `src/components/SpreadsheetTableEditor.tsx`
- [Draft data model](https://github.com/sanjaynesan-05/maildesginer/blob/main/src/types/email.ts): `src/types/email.ts`
- **Local draft storage**

### Preview and HTML

- [Email HTML generator](https://github.com/sanjaynesan-05/maildesginer/blob/main/src/services/html.service.ts): `src/services/html.service.ts`
- [Live preview and HTML view](https://github.com/sanjaynesan-05/maildesginer/blob/main/src/App.tsx): `src/App.tsx`

### Email API

- [Express API server](https://github.com/sanjaynesan-05/maildesginer/blob/main/server/index.ts): `server/index.ts`
- [Email routes](https://github.com/sanjaynesan-05/maildesginer/blob/main/server/routes/email.routes.ts): `server/routes/email.routes.ts`
- [Temporary attachments](https://github.com/sanjaynesan-05/maildesginer/blob/main/server/routes/email.routes.ts): `server/routes/email.routes.ts`
- [Shared HTML export](https://github.com/sanjaynesan-05/maildesginer/blob/main/server/services/html.service.ts): `server/services/html.service.ts`

### Gmail delivery

- [SMTP mail service](https://github.com/sanjaynesan-05/maildesginer/blob/main/server/services/mail.service.ts): `server/services/mail.service.ts`
- **Gmail SMTP**

### Other components

- **Email author**
- **Web browser**

## Connections

- Email author → Mail Studio editor: edits draft (evidence: `README.md`)
- Mail Studio editor → Draft data model: updates (evidence: `src/App.tsx`)
- Mail Studio editor → Table editor: uses editor (evidence: `src/App.tsx`)
- Table editor → Draft data model: updates table data (evidence: `src/components/SpreadsheetTableEditor.tsx`)
- Mail Studio editor → Local draft storage: autosaves draft (evidence: `src/App.tsx`)
- Mail Studio editor → Email HTML generator: generates markup (evidence: `src/App.tsx`)
- Email HTML generator → Draft data model: reads draft types (evidence: `src/services/html.service.ts`)
- Mail Studio editor → Live preview and HTML view: shows preview (evidence: `README.md`)
- Live preview and HTML view → Web browser: renders email (evidence: `README.md`)
- Mail Studio editor → Web browser: requests email API (evidence: `src/App.tsx`)
- Web browser → Express API server: sends API requests (evidence: `README.md`)
- Express API server → Email routes: routes email API (evidence: `server/index.ts`)
- Email routes → Temporary attachments: parses uploads (evidence: `server/routes/email.routes.ts`)
- Email routes → Shared HTML export: generates message HTML (evidence: `server/routes/email.routes.ts`)
- Shared HTML export → Email HTML generator: re-exports generator (evidence: `server/services/html.service.ts`)
- Email routes → SMTP mail service: sends message (evidence: `server/routes/email.routes.ts`)
- SMTP mail service → Gmail SMTP: delivers via SMTP (evidence: `server/services/mail.service.ts`)
