# zxithunf/email-app architecture

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

- Interactive diagram: https://gitdiagram.com/zxithunf/email-app
- Repository: https://github.com/zxithunf/email-app

## Overview

This is a web-based contact and campaign automation platform. Users sign in, manage or import contacts (including spreadsheet and Google Sheets workflows), create campaigns from templates, schedule delivery, and review campaign performance and message logs. The main runtime is a routed React application backed by Firebase services; campaign scheduling dispatches Gmail messages and records delivery logs. The source index documents many page-to-service references, but the README is empty and several integrations are not shown in excerpts, so uncertain external connections are omitted.

Main entry points: [`src/App.tsx`](https://github.com/zxithunf/email-app/blob/main/src/App.tsx) (App Router), [`src/services/contactService.ts`](https://github.com/zxithunf/email-app/blob/main/src/services/contactService.ts) (Contact Service), [`src/services/schedulerService.ts`](https://github.com/zxithunf/email-app/blob/main/src/services/schedulerService.ts) (Campaign Scheduler), [`src/pages/CampaignDetailsPage.tsx`](https://github.com/zxithunf/email-app/blob/main/src/pages/CampaignDetailsPage.tsx) (Campaign Details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app["App Router<br/>[App.tsx]"]
  node_auth["Authentication<br/>[AuthContext.tsx]"]
  node_layout["App Navigation<br/>[AppLayout.tsx]"]
  node_dashboard["Dashboard<br/>[DashboardPage.tsx]"]
end

subgraph group_audience["Contact Management"]
  node_contacts["Contacts<br/>[ContactsPage.tsx]"]
  node_import["Spreadsheet Import"]
  node_sheets["Google Sheets"]
  node_parser["Import Parser<br/>[excelParser.ts]"]
  node_contact_service["Contact Service<br/>[contactService.ts]"]
  node_google_sheets_service["Google Sheets Service"]
end

subgraph group_campaign["Campaign Operations"]
  node_campaigns["Campaign List<br/>[CampaignsPage.tsx]"]
  node_create_campaign["Campaign Builder"]
  node_details["Campaign Details"]
  node_templates["Templates<br/>[TemplatesPage.tsx]"]
  node_logs["Message Logs"]
  node_campaign_service["Campaign Service<br/>[campaignService.ts]"]
  node_scheduler["Campaign Scheduler"]
  node_gmail["Gmail Delivery<br/>[gmailService.ts]"]
  node_confirm["Send Confirmation"]
end

subgraph group_platform["Platform Services"]
  node_settings["Settings<br/>[SettingsPage.tsx]"]
  node_settings_service["Settings Service<br/>[settingsService.ts]"]
  node_template_service["Template Service<br/>[templateService.ts]"]
  node_firebase["Firebase Client<br/>[firebase.ts]"]
end

node_user(("User"))
node_firestore[("Firebase Services")]

node_user -->|"uses"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"renders"| node_layout
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_contacts
node_app -->|"routes to"| node_import
node_app -->|"routes to"| node_sheets
node_app -->|"routes to"| node_campaigns
node_app -->|"routes to"| node_create_campaign
node_app -->|"routes to"| node_details
node_app -->|"routes to"| node_templates
node_app -->|"routes to"| node_logs
node_app -->|"routes to"| node_settings
node_import -->|"parses files"| node_parser
node_import -->|"imports contacts"| node_contact_service
node_contacts -->|"manages contacts"| node_contact_service
node_sheets -->|"stores contacts"| node_contact_service
node_sheets -->|"uses integration"| node_google_sheets_service
node_campaigns -->|"loads campaigns"| node_campaign_service
node_campaigns -->|"loads contacts"| node_contact_service
node_campaigns -->|"uses scheduling"| node_scheduler
node_create_campaign -->|"creates campaigns"| node_campaign_service
node_create_campaign -->|"selects contacts"| node_contact_service
node_create_campaign -->|"loads templates"| node_template_service
node_details -->|"loads campaign"| node_campaign_service
node_details -->|"loads contacts"| node_contact_service
node_details -->|"dispatches campaign"| node_scheduler
node_details -->|"loads templates"| node_template_service
node_details -->|"shows confirmation"| node_confirm
node_details -->|"sends message"| node_gmail
node_scheduler -->|"sends Gmail"| node_gmail
node_scheduler -->|"updates schedule"| node_campaign_service
node_logs -->|"loads logs"| node_scheduler
node_dashboard -->|"loads campaigns"| node_campaign_service
node_dashboard -->|"loads contacts"| node_contact_service
node_dashboard -->|"loads performance"| node_scheduler
node_templates -->|"manages templates"| node_template_service
node_settings -->|"manages settings"| node_settings_service
node_settings -->|"manages campaigns"| node_campaign_service
node_settings -->|"manages contacts"| node_contact_service
node_settings -->|"uses scheduling"| node_scheduler
node_contact_service -->|"uses client"| node_firebase
node_campaign_service -->|"uses client"| node_firebase
node_template_service -->|"uses client"| node_firebase
node_settings_service -->|"uses client"| node_firebase
node_scheduler -->|"uses client"| node_firebase
node_firebase -->|"connects to"| node_firestore

click node_app "https://github.com/zxithunf/email-app/blob/main/src/App.tsx"
click node_auth "https://github.com/zxithunf/email-app/blob/main/src/contexts/AuthContext.tsx"
click node_layout "https://github.com/zxithunf/email-app/blob/main/src/components/layout/AppLayout.tsx"
click node_dashboard "https://github.com/zxithunf/email-app/blob/main/src/pages/DashboardPage.tsx"
click node_contacts "https://github.com/zxithunf/email-app/blob/main/src/pages/ContactsPage.tsx"
click node_import "https://github.com/zxithunf/email-app/blob/main/src/pages/ImportContactsPage.tsx"
click node_sheets "https://github.com/zxithunf/email-app/blob/main/src/pages/GoogleSheetsPage.tsx"
click node_parser "https://github.com/zxithunf/email-app/blob/main/src/utils/excelParser.ts"
click node_contact_service "https://github.com/zxithunf/email-app/blob/main/src/services/contactService.ts"
click node_google_sheets_service "https://github.com/zxithunf/email-app/blob/main/src/services/googleSheetsService.ts"
click node_campaigns "https://github.com/zxithunf/email-app/blob/main/src/pages/CampaignsPage.tsx"
click node_create_campaign "https://github.com/zxithunf/email-app/blob/main/src/pages/CreateCampaignPage.tsx"
click node_details "https://github.com/zxithunf/email-app/blob/main/src/pages/CampaignDetailsPage.tsx"
click node_templates "https://github.com/zxithunf/email-app/blob/main/src/pages/TemplatesPage.tsx"
click node_logs "https://github.com/zxithunf/email-app/blob/main/src/pages/MessageLogsPage.tsx"
click node_campaign_service "https://github.com/zxithunf/email-app/blob/main/src/services/campaignService.ts"
click node_scheduler "https://github.com/zxithunf/email-app/blob/main/src/services/schedulerService.ts"
click node_gmail "https://github.com/zxithunf/email-app/blob/main/src/services/gmailService.ts"
click node_confirm "https://github.com/zxithunf/email-app/blob/main/src/components/common/GmailSendConfirmModal.tsx"
click node_settings "https://github.com/zxithunf/email-app/blob/main/src/pages/SettingsPage.tsx"
click node_settings_service "https://github.com/zxithunf/email-app/blob/main/src/services/settingsService.ts"
click node_template_service "https://github.com/zxithunf/email-app/blob/main/src/services/templateService.ts"
click node_firebase "https://github.com/zxithunf/email-app/blob/main/src/services/firebase.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_app,node_auth,node_layout,node_dashboard,node_user toneBlue
class node_contacts,node_import,node_sheets,node_parser,node_contact_service,node_google_sheets_service,node_firestore toneAmber
class node_campaigns,node_create_campaign,node_details,node_templates,node_logs,node_campaign_service,node_scheduler,node_gmail,node_confirm toneMint
class node_settings,node_settings_service,node_template_service,node_firebase toneRose
```

## Components

### Application

- [App Router](https://github.com/zxithunf/email-app/blob/main/src/App.tsx): `src/App.tsx`
- [Authentication](https://github.com/zxithunf/email-app/blob/main/src/contexts/AuthContext.tsx): `src/contexts/AuthContext.tsx`
- [App Navigation](https://github.com/zxithunf/email-app/blob/main/src/components/layout/AppLayout.tsx): `src/components/layout/AppLayout.tsx`
- [Dashboard](https://github.com/zxithunf/email-app/blob/main/src/pages/DashboardPage.tsx): `src/pages/DashboardPage.tsx`

### Contact Management

- [Contacts](https://github.com/zxithunf/email-app/blob/main/src/pages/ContactsPage.tsx): `src/pages/ContactsPage.tsx`
- [Spreadsheet Import](https://github.com/zxithunf/email-app/blob/main/src/pages/ImportContactsPage.tsx): `src/pages/ImportContactsPage.tsx`
- [Google Sheets](https://github.com/zxithunf/email-app/blob/main/src/pages/GoogleSheetsPage.tsx): `src/pages/GoogleSheetsPage.tsx`
- [Import Parser](https://github.com/zxithunf/email-app/blob/main/src/utils/excelParser.ts): `src/utils/excelParser.ts`
- [Contact Service](https://github.com/zxithunf/email-app/blob/main/src/services/contactService.ts): `src/services/contactService.ts`
- [Google Sheets Service](https://github.com/zxithunf/email-app/blob/main/src/services/googleSheetsService.ts): `src/services/googleSheetsService.ts`

### Campaign Operations

- [Campaign List](https://github.com/zxithunf/email-app/blob/main/src/pages/CampaignsPage.tsx): `src/pages/CampaignsPage.tsx`
- [Campaign Builder](https://github.com/zxithunf/email-app/blob/main/src/pages/CreateCampaignPage.tsx): `src/pages/CreateCampaignPage.tsx`
- [Campaign Details](https://github.com/zxithunf/email-app/blob/main/src/pages/CampaignDetailsPage.tsx): `src/pages/CampaignDetailsPage.tsx`
- [Templates](https://github.com/zxithunf/email-app/blob/main/src/pages/TemplatesPage.tsx): `src/pages/TemplatesPage.tsx`
- [Message Logs](https://github.com/zxithunf/email-app/blob/main/src/pages/MessageLogsPage.tsx): `src/pages/MessageLogsPage.tsx`
- [Campaign Service](https://github.com/zxithunf/email-app/blob/main/src/services/campaignService.ts): `src/services/campaignService.ts`
- [Campaign Scheduler](https://github.com/zxithunf/email-app/blob/main/src/services/schedulerService.ts): `src/services/schedulerService.ts`
- [Gmail Delivery](https://github.com/zxithunf/email-app/blob/main/src/services/gmailService.ts): `src/services/gmailService.ts`
- [Send Confirmation](https://github.com/zxithunf/email-app/blob/main/src/components/common/GmailSendConfirmModal.tsx): `src/components/common/GmailSendConfirmModal.tsx`

### Platform Services

- [Settings](https://github.com/zxithunf/email-app/blob/main/src/pages/SettingsPage.tsx): `src/pages/SettingsPage.tsx`
- [Settings Service](https://github.com/zxithunf/email-app/blob/main/src/services/settingsService.ts): `src/services/settingsService.ts`
- [Template Service](https://github.com/zxithunf/email-app/blob/main/src/services/templateService.ts): `src/services/templateService.ts`
- [Firebase Client](https://github.com/zxithunf/email-app/blob/main/src/services/firebase.ts): `src/services/firebase.ts`

### Other components

- **User**
- **Firebase Services**

## Connections

- User → App Router: uses (evidence: `src/App.tsx`)
- App Router → Authentication: provides auth (evidence: `src/App.tsx`)
- App Router → App Navigation: renders (evidence: `src/App.tsx`)
- App Router → Dashboard: routes to (evidence: `src/App.tsx`)
- App Router → Contacts: routes to (evidence: `src/App.tsx`)
- App Router → Spreadsheet Import: routes to (evidence: `src/App.tsx`)
- App Router → Google Sheets: routes to (evidence: `src/App.tsx`)
- App Router → Campaign List: routes to (evidence: `src/App.tsx`)
- App Router → Campaign Builder: routes to (evidence: `src/App.tsx`)
- App Router → Campaign Details: routes to (evidence: `src/App.tsx`)
- App Router → Templates: routes to (evidence: `src/App.tsx`)
- App Router → Message Logs: routes to (evidence: `src/App.tsx`)
- App Router → Settings: routes to (evidence: `src/App.tsx`)
- Spreadsheet Import → Import Parser: parses files (evidence: `src/pages/ImportContactsPage.tsx`)
- Spreadsheet Import → Contact Service: imports contacts (evidence: `src/pages/ImportContactsPage.tsx`)
- Contacts → Contact Service: manages contacts (evidence: `src/pages/ContactsPage.tsx`)
- Google Sheets → Contact Service: stores contacts (evidence: `src/pages/GoogleSheetsPage.tsx`)
- Google Sheets → Google Sheets Service: uses integration (evidence: `src/pages/GoogleSheetsPage.tsx`)
- Campaign List → Campaign Service: loads campaigns (evidence: `src/pages/CampaignsPage.tsx`)
- Campaign List → Contact Service: loads contacts (evidence: `src/pages/CampaignsPage.tsx`)
- Campaign List → Campaign Scheduler: uses scheduling (evidence: `src/pages/CampaignsPage.tsx`)
- Campaign Builder → Campaign Service: creates campaigns (evidence: `src/pages/CreateCampaignPage.tsx`)
- Campaign Builder → Contact Service: selects contacts (evidence: `src/pages/CreateCampaignPage.tsx`)
- Campaign Builder → Template Service: loads templates (evidence: `src/pages/CreateCampaignPage.tsx`)
- Campaign Details → Campaign Service: loads campaign (evidence: `src/pages/CampaignDetailsPage.tsx`)
- Campaign Details → Contact Service: loads contacts (evidence: `src/pages/CampaignDetailsPage.tsx`)
- Campaign Details → Campaign Scheduler: dispatches campaign (evidence: `src/pages/CampaignDetailsPage.tsx`)
- Campaign Details → Template Service: loads templates (evidence: `src/pages/CampaignDetailsPage.tsx`)
- Campaign Details → Send Confirmation: shows confirmation (evidence: `src/pages/CampaignDetailsPage.tsx`)
- Campaign Details → Gmail Delivery: sends message (evidence: `src/pages/CampaignDetailsPage.tsx`)
- Campaign Scheduler → Gmail Delivery: sends Gmail (evidence: `src/services/schedulerService.ts`)
- Campaign Scheduler → Campaign Service: updates schedule (evidence: `src/services/schedulerService.ts`)
- Message Logs → Campaign Scheduler: loads logs (evidence: `src/pages/MessageLogsPage.tsx`)
- Dashboard → Campaign Service: loads campaigns (evidence: `src/pages/DashboardPage.tsx`)
- Dashboard → Contact Service: loads contacts (evidence: `src/pages/DashboardPage.tsx`)
- Dashboard → Campaign Scheduler: loads performance (evidence: `src/pages/DashboardPage.tsx`)
- Templates → Template Service: manages templates (evidence: `src/pages/TemplatesPage.tsx`)
- Settings → Settings Service: manages settings (evidence: `src/pages/SettingsPage.tsx`)
- Settings → Campaign Service: manages campaigns (evidence: `src/pages/SettingsPage.tsx`)
- Settings → Contact Service: manages contacts (evidence: `src/pages/SettingsPage.tsx`)
- Settings → Campaign Scheduler: uses scheduling (evidence: `src/pages/SettingsPage.tsx`)
- Contact Service → Firebase Client: uses client (evidence: `src/services/contactService.ts`)
- Campaign Service → Firebase Client: uses client (evidence: `src/services/campaignService.ts`)
- Template Service → Firebase Client: uses client (evidence: `src/services/templateService.ts`)
- Settings Service → Firebase Client: uses client (evidence: `src/services/settingsService.ts`)
- Campaign Scheduler → Firebase Client: uses client (evidence: `src/services/schedulerService.ts`)
- Firebase Client → Firebase Services: connects to (evidence: `src/services/firebase.ts`)
