# gautam23145032/englishdictionary architecture

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

- Interactive diagram: https://gitdiagram.com/gautam23145032/englishdictionary
- Repository: https://github.com/gautam23145032/englishdictionary

## Overview

##### Project type and purpose
- This is a single-page, full-stackless web application (frontend only) that runs entirely in the browser.
- Purpose: Let users search English words, view definitions/synonyms/pronunciations, get suggestions, random words, and daily notifications by calling external dictionary and suggestion APIs.

##### File structure
- Top level:
- index.html – main entry point and UI skeleton
- style.css – all styling and responsive layout
- script.js – core logic: DOM manipulation, API calls, localStorage, Notification API
- No backend folder; all network calls go directly from script.js to external services.

##### README for additional insights
- Tech stack: HTML5, CSS3, Vanilla JS
- External dependencies:
- dictionaryapi.dev – definitions, phonetics, audio
- Datamuse API – live suggestions
- Random Word API – random/daily words
- Uses browser Web Notification API and localStorage for daily alerts.

##### Detail
- Sequence: user types → suggestion API → UI update → user selects word → dictionary API → UI update
- Daily notification flow: On load → check localStorage → call Random Word API → Notification API → store date
- External dependencies and browser APIs.

## Diagram (Mermaid)

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

    %% Client Browser Container
    subgraph "Client Browser"
        UI_HTML["index.html<br/>(UI HTML)"]:::client
        UI_CSS["style.css<br/>(UI CSS)"]:::client
        Logic["script.js<br/>(App Logic)"]:::client
    end

    %% External Services
    DictionaryAPI["Dictionary API Service<br/>(dictionaryapi.dev)"]:::external
    DatamuseAPI["Datamuse API Service<br/>(api.datamuse.com)"]:::external
    RandomWordAPI["Random Word API Service<br/>(random-word-api.vercel.app)"]:::external

    %% Browser Storage & APIs
    LocalStorage["localStorage"]:::storage
    NotificationAPI["Notification API"]:::storage

    %% Documentation
    README["README.md<br/>(Documentation)"]:::client

    %% Connections
    User -->|interacts with| UI_HTML
    User -->|interacts with| Logic

    Logic -->|fetch definitions| DictionaryAPI
    Logic -->|fetch suggestions| DatamuseAPI
    Logic -->|fetch random words| RandomWordAPI

    Logic <-->|"read/write"| LocalStorage
    Logic -->|"send alerts"| NotificationAPI

    %% Optional flow for daily notification
    LocalStorage -->|if not sent today| Logic
    NotificationAPI -->|store date| LocalStorage

    %% Documentation link
    User -->|views docs| README

    %% Click Events
    click UI_HTML "https://github.com/gautam23145032/englishdictionary/blob/main/index.html"
    click UI_CSS "https://github.com/gautam23145032/englishdictionary/blob/main/style.css"
    click Logic "https://github.com/gautam23145032/englishdictionary/blob/main/script.js"
    click README "https://github.com/gautam23145032/englishdictionary/blob/main/README.md"

    %% Styles
    classDef client fill:#cce5ff,stroke:#004085,color:#004085
    classDef external fill:#d4edda,stroke:#155724,color:#155724
    classDef storage fill:#fff3cd,stroke:#856404,color:#856404
```
