# antirahat/aac_sohayok architecture

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

- Interactive diagram: https://gitdiagram.com/antirahat/aac_sohayok
- Repository: https://github.com/antirahat/aac_sohayok

## Overview

##### File structure
- Top-level HTML pages (index.html, mainapp.html, test.html, userLogin.html) – these are the various entry points and UI screens.
- assets/css – styling for landing page and general UI.
- assets/js – client-side logic for hover detection, timer, audio playback, and alert button.
- assets/py – Python scripts (data.py, t2s.py, test.py) that presumably act as a lightweight HTTP/TTS service.

##### README for additional insights
- Core features:
3) A button that triggers a high-pitch alert sound.

##### Detail without over-partitioning
- Of the four logical components (UI, Assets, TTS Service, Hardware).
- Pre-recorded vs. dynamically generated audio paths.

## Diagram (Mermaid)

```mermaid
flowchart TD
    BrowserUI["Browser UI Layer"]:::ui

    subgraph "HTML Entry Points"
        index["index.html"]:::uiEntry
        mainapp["mainapp.html"]:::uiEntry
        testhtml["test.html"]:::uiEntry
        login["userLogin.html"]:::uiEntry
    end

    subgraph "UI Interaction Modules"
        Timer["Hover Timer Module"]:::ui
        AudioPlayer["Audio Player Module"]:::ui
        AlertHandler["Alert Button Handler"]:::ui
    end

    subgraph "Static Asset Server"
        CSS1["styles.css"]:::asset
        CSS2["landpage.css"]:::asset
        JS1["script.js"]:::asset
        JS2["landpage.js"]:::asset
        Media["Pre-recorded Audio Assets"]:::asset
    end

    subgraph "Python TTS/Data Service"
        TTS["t2s.py (TTS Endpoint)"]:::services
        DataAPI["data.py (Data API)"]:::services
        TestService["test.py (Service Tests)"]:::services
    end

    subgraph "Hardware Layer"
        Sensor["Proximity Sensor"]:::hardware
        Arduino["mouse_basic.ino"]:::hardware
    end

    BrowserUI --> index
    BrowserUI --> mainapp
    BrowserUI --> testhtml
    BrowserUI --> login

    BrowserUI --> Timer
    Timer --> AudioPlayer
    BrowserUI --> AlertHandler

    BrowserUI -->|"GET CSS"| CSS1
    BrowserUI -->|"GET CSS"| CSS2
    BrowserUI -->|"GET JS"| JS1
    BrowserUI -->|"GET JS"| JS2
    BrowserUI -->|"GET Media"| Media

    BrowserUI -->|"REST/WebSocket"| TTS
    BrowserUI -->|"REST/WebSocket"| DataAPI
    TTS <--> DataAPI
    TestService -.-> TTS

    Sensor --> Arduino
    Arduino -->|"Serial/WebUSB Events"| BrowserUI

    click index "https://github.com/antirahat/aac_sohayok/blob/main/index.html"
    click mainapp "https://github.com/antirahat/aac_sohayok/blob/main/mainapp.html"
    click testhtml "https://github.com/antirahat/aac_sohayok/blob/main/test.html"
    click login "https://github.com/antirahat/aac_sohayok/blob/main/userLogin.html"
    click JS1 "https://github.com/antirahat/aac_sohayok/blob/main/assets/js/script.js"
    click JS2 "https://github.com/antirahat/aac_sohayok/blob/main/assets/js/landpage.js"
    click CSS1 "https://github.com/antirahat/aac_sohayok/blob/main/assets/css/styles.css"
    click CSS2 "https://github.com/antirahat/aac_sohayok/blob/main/assets/css/landpage.css"
    click Media "https://github.com/antirahat/aac_sohayok/tree/main/assets/media"
    click TTS "https://github.com/antirahat/aac_sohayok/blob/main/assets/py/t2s.py"
    click DataAPI "https://github.com/antirahat/aac_sohayok/blob/main/assets/py/data.py"
    click TestService "https://github.com/antirahat/aac_sohayok/blob/main/assets/py/test.py"
    click Arduino "https://github.com/antirahat/aac_sohayok/blob/main/mouse_basic.ino"

    classDef ui fill:#D0E6FF,stroke:#333,stroke-width:1px
    classDef uiEntry fill:#B3D4FC,stroke:#333,stroke-width:1px
    classDef asset fill:#F0F0F0,stroke:#333,stroke-width:1px
    classDef services fill:#DFF2DD,stroke:#333,stroke-width:1px
    classDef hardware fill:#FFE4B5,stroke:#333,stroke-width:1px
```
