# shahidsamadov/wordle-azerbaycan-dilinde-web architecture

> Architecture diagram of the GitHub repository shahidsamadov/wordle-azerbaycan-dilinde-web, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shahidsamadov/wordle-azerbaycan-dilinde-web
- Repository: https://github.com/shahidsamadov/wordle-azerbaycan-dilinde-web

## Overview

##### Project type and purpose
- This is a static, client‐side web application (a Progressive Web App) that implements “Wordle” in Azerbaijani.
- There is no custom backend or database—everything runs in the user’s browser against static text files.

##### File structure
- Top level:
- index.html – entry point and UI skeleton
- main.js – game logic, word‐matching, state management
- manifest.json – PWA metadata for install and offline support
- assets/ – images used in the UI
- wordbase/ – three `.txt` files containing the word lists (daily vs. less common vs. complete)
- No server‐side code, no build scripts, no tests—this is purely static content.

##### README
- Confirms the game rules and explains that the word lists reside in `wordbase/`.
- Mentions the three categories of words (1469 common, 3404 uncommon, total 4873).

##### Main components
a. Web Server (static host)
- Serves `index.html`, `main.js`, `manifest.json`, `assets/*`, `wordbase/*.txt`
b. Browser / Client
- UI Layer (HTML + CSS + images)
- Game Engine (JavaScript in `main.js`)
- Local Storage (browser’s localStorage for persisting game state)
- PWA Layer (manifest.json for “Install” / offline capability)
c. Wordbase Storage
- Static `.txt` files served as resources

##### Relationships and interactions
- User opens the PWA → Browser requests `index.html` from the Web Server.
- `index.html` loads `main.js` and CSS/images.
- Game Engine (main.js) on startup issues fetch requests to `/wordbase/examination_words.txt`, `/main_words.txt`, `/words_base.txt`.
- Game Engine parses the word lists into in‐memory arrays.
- Game Engine reads/writes progress (current word, attempts left) to browser localStorage.
- Manifest.json enables “Add to Home Screen” and offline capability (if a service worker were added).

##### Architectural patterns and design principles
- Single‐Page Application (SPA) pattern: all logic in `main.js` operates on the DOM without full page reloads.
- Client‐Side Rendering (CSR): the browser does all rendering and logic.
- Separation of concerns: UI assets vs. game logic vs. word data vs. storage.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Web Server (Static Host)"
        direction TB
        A_index["index.html"]:::static
        A_main["main.js"]:::static
        A_manifest["manifest.json"]:::static
        A_assets["assets/"]:::static
        A_wordbaseDir["wordbase/"]:::static
    end

    subgraph "Browser"
        direction TB
        subgraph "UI Layer"
            direction TB
            B_UIHTML["index.html"]:::ui
            B_assets["assets/"]:::ui
        end
        C_engine["Game Engine (main.js)"]:::logic
        D_storage["Local Storage"]:::storage
        F_pwa["PWA Layer (manifest.json)"]:::pwa
        subgraph "Wordbase Files"
            direction TB
            E1["examination_words.txt"]:::storage
            E2["main_words.txt"]:::storage
            E3["words_base.txt"]:::storage
        end
    end

    A_index --> B_UIHTML
    A_assets --> B_assets
    A_main --> C_engine
    A_manifest --> F_pwa
    A_wordbaseDir --> E1
    A_wordbaseDir --> E2
    A_wordbaseDir --> E3

    B_UIHTML --> C_engine
    B_assets --> B_UIHTML
    C_engine --> E1
    C_engine --> E2
    C_engine --> E3
    C_engine --> D_storage
    D_storage --> C_engine
    F_pwa -.-> C_engine

    click A_index "https://github.com/shahidsamadov/wordle-azerbaycan-dilinde-web/blob/master/index.html"
    click A_main "https://github.com/shahidsamadov/wordle-azerbaycan-dilinde-web/blob/master/main.js"
    click A_manifest "https://github.com/shahidsamadov/wordle-azerbaycan-dilinde-web/blob/master/manifest.json"
    click A_assets "https://github.com/shahidsamadov/wordle-azerbaycan-dilinde-web/tree/master/assets/"
    click A_wordbaseDir "https://github.com/shahidsamadov/wordle-azerbaycan-dilinde-web/tree/master/wordbase/"
    click B_UIHTML "https://github.com/shahidsamadov/wordle-azerbaycan-dilinde-web/blob/master/index.html"
    click B_assets "https://github.com/shahidsamadov/wordle-azerbaycan-dilinde-web/tree/master/assets/"
    click C_engine "https://github.com/shahidsamadov/wordle-azerbaycan-dilinde-web/blob/master/main.js"
    click F_pwa "https://github.com/shahidsamadov/wordle-azerbaycan-dilinde-web/blob/master/manifest.json"
    click E1 "https://github.com/shahidsamadov/wordle-azerbaycan-dilinde-web/blob/master/wordbase/examination_words.txt"
    click E2 "https://github.com/shahidsamadov/wordle-azerbaycan-dilinde-web/blob/master/wordbase/main_words.txt"
    click E3 "https://github.com/shahidsamadov/wordle-azerbaycan-dilinde-web/blob/master/wordbase/words_base.txt"

    classDef static fill:#eef,stroke:#88c,stroke-width:2px
    classDef ui fill:#def,stroke:#69c,stroke-width:2px
    classDef logic fill:#fdb,stroke:#fa0,stroke-width:2px
    classDef storage fill:#dfd,stroke:#2c2,stroke-width:2px
    classDef pwa fill:#ffd,stroke:#fc0,stroke-width:2px
```
