# darrassi1/smtp_send_ui architecture

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

- Interactive diagram: https://gitdiagram.com/darrassi1/smtp_send_ui
- Repository: https://github.com/darrassi1/smtp_send_ui

## Overview

##### Project type and purpose
- This is a single-page web application (SPA) built with Angular CLI (v15) that provides a user interface for composing, sending, previewing, and managing emails via SMTP.
- Key features: admin login, compose email (with HTML editor and preview), draft management, SMTP configuration, toast notifications, file attachments.

##### File structure
- Top level:
- angular.json, tsconfig*.json, package.json: Angular build & config
- src/ : all application code
- src/app/ modules and components:
- app-routing.module.ts: client-side routes
- components/: UI building blocks (admin-login, compose, drafts, html-editor, html-preview-modal, navbar, settings, toast)
- services/: singleton services handling HTTP and business logic (auth, email, drafts & SMTP config CRUD, attachments, toast notifications)
- models/: TypeScript interfaces/models (Draft, SmtpConfig)
- config files: proxy.conf.json/​-prod.json for API proxying, postcss.config.js & tailwind.config.js for styling, vercel.json for deployment.

##### Extract insights from the README
- Standard Angular dev/build/test commands; no backend code here, so the UI expects a separate API server to handle authentication, SMTP delivery, and data storage.

## Diagram (Mermaid)

```mermaid
flowchart TB
    Browser["User's Browser"]:::external
    Browser --> AngularSPA

    subgraph "Angular SPA"
        direction TB
        AppModule["AppModule"]:::frontend
        Router["AppRoutingModule"]:::frontend
        AdminLogin["AdminLoginComponent"]:::frontend
        ComposeComp["ComposeComponent"]:::frontend
        DraftsComp["DraftsComponent"]:::frontend
        HTMLEditor["HTMLEditorComponent"]:::frontend
        PreviewModal["HTMLPreviewModalComponent"]:::frontend
        Navbar["NavbarComponent"]:::frontend
        SettingsComp["SettingsComponent"]:::frontend
        ToastComp["ToastComponent"]:::frontend

        AuthService["AuthService"]:::frontend
        AuthInterceptor["AuthInterceptor"]:::frontend
        EmailService["EmailService"]:::frontend
        SmtpConfigService["SmtpConfigService"]:::frontend
        AttachmentService["AttachmentService"]:::frontend
        ToastService["ToastService"]:::frontend

        Browser -->|loads| AppModule
        AppModule --> Router
        Router -->|"/login"| AdminLogin
        Router -->|"/compose"| ComposeComp
        Router -->|"/drafts"| DraftsComp
        Router -->|"/settings"| SettingsComp

        ComposeComp --> HTMLEditor
        ComposeComp --> PreviewModal

        AdminLogin --> AuthService
        ComposeComp --> EmailService
        ComposeComp --> AttachmentService
        DraftsComp --> SmtpConfigService
        SettingsComp --> SmtpConfigService

        AuthService -->|HTTP Request| AuthInterceptor
        EmailService -->|HTTP Request| AuthInterceptor
        SmtpConfigService -->|HTTP Request| AuthInterceptor
        AttachmentService -->|HTTP Request| AuthInterceptor

        AuthInterceptor -->|forwards| APIGateway
        AuthInterceptor -.->|on error| ToastService
        EmailService -->|notifications| ToastService
        SmtpConfigService -->|notifications| ToastService
        AttachmentService -->|notifications| ToastService
    end

    APIGateway["HTTP API Gateway"]:::backend

    subgraph "Backend Services"
        direction TB
        BE_Auth["Auth Service"]:::backend
        BE_Email["Email Service"]:::backend
        BE_Draft["Drafts Service"]:::backend
        BE_SMTPConfig["SMTP-Config Service"]:::backend
        BE_Attachment["Attachment Service"]:::backend
    end

    Database["Database"]:::external
    SMTP["SMTP Server"]:::external
    FileStorage["File Storage"]:::external

    APIGateway --> BE_Auth
    APIGateway --> BE_Email
    APIGateway --> BE_Draft
    APIGateway --> BE_SMTPConfig
    APIGateway --> BE_Attachment

    BE_Auth --> Database
    BE_Draft --> Database
    BE_SMTPConfig --> Database
    BE_Email --> SMTP
    BE_Attachment --> FileStorage

    classDef frontend fill:#E3F2FD,stroke:#1976D2,stroke-width:1px
    classDef backend fill:#E8F5E9,stroke:#388E3C,stroke-width:1px
    classDef external fill:#ECEFF1,stroke:#607D8B,stroke-width:1px

    click AngularSPA "https://github.com/darrassi1/smtp_send_ui/tree/master/src/app/"
    click Router "https://github.com/darrassi1/smtp_send_ui/blob/master/src/app/app-routing.module.ts"
    click AppModule "https://github.com/darrassi1/smtp_send_ui/blob/master/src/app/app.module.ts"
    click AdminLogin "https://github.com/darrassi1/smtp_send_ui/blob/master/src/app/components/admin-login/admin-login.component.ts"
    click ComposeComp "https://github.com/darrassi1/smtp_send_ui/blob/master/src/app/components/compose/compose.component.ts"
    click DraftsComp "https://github.com/darrassi1/smtp_send_ui/blob/master/src/app/components/drafts/drafts.component.ts"
    click HTMLEditor "https://github.com/darrassi1/smtp_send_ui/blob/master/src/app/components/html-editor/html-editor.component.ts"
    click PreviewModal "https://github.com/darrassi1/smtp_send_ui/blob/master/src/app/components/html-preview-modal/html-preview-modal.component.ts"
    click Navbar "https://github.com/darrassi1/smtp_send_ui/blob/master/src/app/components/navbar/navbar.component.ts"
    click SettingsComp "https://github.com/darrassi1/smtp_send_ui/blob/master/src/app/components/settings/settings.component.ts"
    click ToastComp "https://github.com/darrassi1/smtp_send_ui/blob/master/src/app/components/toast/toast.component.ts"
    click AuthService "https://github.com/darrassi1/smtp_send_ui/blob/master/src/app/services/auth.service.ts"
    click AuthInterceptor "https://github.com/darrassi1/smtp_send_ui/blob/master/src/app/services/auth.interceptor.ts"
    click EmailService "https://github.com/darrassi1/smtp_send_ui/blob/master/src/app/services/email.service.ts"
    click SmtpConfigService "https://github.com/darrassi1/smtp_send_ui/blob/master/src/app/services/smtp-config.service.ts"
    click AttachmentService "https://github.com/darrassi1/smtp_send_ui/blob/master/src/app/services/attachment.service.ts"
    click ToastService "https://github.com/darrassi1/smtp_send_ui/blob/master/src/app/services/toast.service.ts"
    click AppComponent "https://github.com/darrassi1/smtp_send_ui/blob/master/src/app/app.component.ts"
```
