# mehmetkahya0/temp-mail architecture

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

- Interactive diagram: https://gitdiagram.com/mehmetkahya0/temp-mail
- Repository: https://github.com/mehmetkahya0/temp-mail

## Overview

##### Project type and purpose
- This is a static, client-side web application (a “single-page-app” style) that runs entirely in the browser.
- It provides disposable email addresses by calling an external email-service API (Guerrilla Mail).
- It uses HTML5/CSS3/ES6 modules, persists user preferences in localStorage, and is hosted as a Progressive Web App (via manifest.json, GitHub Pages, or any static server).

##### File structure
- Top-level assets:
- index.html – main entry point
- manifest.json – PWA metadata
- robots.txt, sitemap.xml – SEO & crawler instructions
- Directories:
- css/style.css – theming & responsive styles (dark/light via CSS variables)
- js/api.js – encapsulates all HTTP calls to the Guerrilla Mail API
- js/config.js – constants (API_BASE, DOMAINS, refresh intervals)
- js/theme.js – toggles theme, reads/writes localStorage
- images/ – static UI assets
- privacy/ – static privacy-policy page
- No backend code or database—everything runs in the browser; external services are used for email operations.

##### README for additional insights
- Confirms Tech Stack: HTML5, CSS3, JavaScript ES6 modules, localStorage, Font Awesome
- Core components described:
- Email Generation System (pseudorandom + Guerrilla Mail API)
- Theme Engine (CSS variables + JS + localStorage)
- Inbox Management (auto-refresh, search, view/delete, attachments)
- Deployment: PWA via GitHub Pages / live-server

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User
    User["User"]:::external

    %% Browser & UI Layer
    subgraph "Browser & UI Layer"
        UI["index.html"]:::frontend
        CSS["css/style.css"]:::frontend
        Assets["images/"]:::frontend
        Manifest["manifest.json"]:::frontend
        subgraph "Privacy Page"
            PrivacyHTML["privacy/privacy.html"]:::frontend
            PrivacyCSS["privacy/privacy.css"]:::frontend
        end
    end

    %% JS Modules
    subgraph "JS Modules"
        API["js/api.js"]:::modules
        Config["js/config.js"]:::modules
        Theme["js/theme.js"]:::modules
    end

    %% Client-side Storage
    LS[(localStorage)]:::infra

    %% External Services
    subgraph "External Services"
        EmailAPI["Guerrilla Mail API"]:::external
    end

    %% Static Hosting / CDN
    subgraph "Static Hosting/CDN"
        CDN(("CDN")):::infra
        Robots["robots.txt"]:::infra
        Sitemap["sitemap.xml"]:::infra
    end

    %% Relationships
    User -->|"interacts with"| UI
    CDN -->|"GET index.html"| UI
    CDN -->|"GET CSS"| CSS
    CDN -->|"GET images"| Assets
    CDN -->|"GET manifest.json"| Manifest
    CDN -->|"GET privacy page"| PrivacyHTML
    CDN -->|"GET privacy CSS"| PrivacyCSS
    CDN -->|"GET robots.txt"| Robots
    CDN -->|"GET sitemap.xml"| Sitemap

    UI -->|"loads module"| API
    UI -->|"loads module"| Config
    UI -->|"loads module"| Theme

    API -->|"HTTP requests"| EmailAPI
    Theme -->|"read/write"| LS
    Config -->|"provides constants"| API
    Config -->|"provides constants"| Theme

    EmailAPI -->|"returns data"| API
    API -->|"provides data"| UI
    Theme -->|"applies styles"| UI

    %% Click Events
    click UI "https://github.com/mehmetkahya0/temp-mail/blob/main/index.html"
    click Manifest "https://github.com/mehmetkahya0/temp-mail/blob/main/manifest.json"
    click CSS "https://github.com/mehmetkahya0/temp-mail/blob/main/css/style.css"
    click Assets "https://github.com/mehmetkahya0/temp-mail/tree/main/images/"
    click API "https://github.com/mehmetkahya0/temp-mail/blob/main/js/api.js"
    click Config "https://github.com/mehmetkahya0/temp-mail/blob/main/js/config.js"
    click Theme "https://github.com/mehmetkahya0/temp-mail/blob/main/js/theme.js"
    click PrivacyHTML "https://github.com/mehmetkahya0/temp-mail/blob/main/privacy/privacy.html"
    click PrivacyCSS "https://github.com/mehmetkahya0/temp-mail/blob/main/privacy/privacy.css"
    click Robots "https://github.com/mehmetkahya0/temp-mail/blob/main/robots.txt"
    click Sitemap "https://github.com/mehmetkahya0/temp-mail/blob/main/sitemap.xml"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#004080,color:#004080
    classDef modules fill:#DFF2BF,stroke:#4F8A10,color:#4F8A10
    classDef external fill:#FFF2CC,stroke:#A67C00,color:#A67C00
    classDef infra fill:#EEEEEE,stroke:#666666,color:#333333
```
