# sachinguptaa056-gif/echolytix architecture

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

- Interactive diagram: https://gitdiagram.com/sachinguptaa056-gif/echolytix
- Repository: https://github.com/sachinguptaa056-gif/echolytix

## Overview

EcholytiX is a browser-based assistive communication app. Patients sign in and choose a communication mode: blinks, hand signs, manual Morse, or a remote phone camera input are translated into text that can be spoken aloud or saved as phrase history. The React app routes between these features; its Express backend provides authentication, history, SOS, and remote-camera APIs backed by SQLite. The README documents the major modes and optional AI phrase completion, but sampled source does not show every component’s internal wiring, so uncertain links are omitted.

Main entry points: [`src/App.tsx`](https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/App.tsx) (App Router), [`server.ts`](https://github.com/sachinguptaa056-gif/echolytix/blob/main/server.ts) (Express API), [`src/components/BlinkToText.tsx`](https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/BlinkToText.tsx) (Blink to Text), [`src/components/RemoteReceiver.tsx`](https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/RemoteReceiver.tsx) (Remote Receiver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Patient App"]
  node_app["App Router<br/>[App.tsx]"]
  node_auth["Sign-in<br/>[AuthPortal.tsx]"]
  node_dashboard["Caregiver Dashboard<br/>[Dashboard.tsx]"]
  node_sos["Emergency SOS<br/>[SosModal.tsx]"]
end

subgraph group_communication["Communication Modes"]
  node_blink["Blink to Text<br/>[BlinkToText.tsx]"]
  node_sign["Sign Recognition<br/>[SignLanguage.tsx]"]
  node_gesture["Gesture Classifier<br/>[gesture.ts]"]
  node_morse["Manual Morse"]
  node_remote_sender["Remote Sender<br/>[RemoteSender.tsx]"]
  node_remote_receiver["Remote Receiver<br/>[RemoteReceiver.tsx]"]
  node_remote_utils["Remote Helpers<br/>[remote.ts]"]
  node_tts["Text to Speech<br/>[TextToSpeech.tsx]"]
  node_sound["Audio Helpers<br/>[sound.ts]"]
end

subgraph group_backend["Backend Services"]
  node_server["Express API<br/>[server.ts]"]
end

subgraph group_state["Persistent State"]
  node_db_layer["Database Access<br/>[database.ts]"]
  node_sqlite[("SQLite<br/>[database.ts]")]
end

node_patient(("Patient"))
node_gemini["Gemini API"]
node_browser["Browser Camera"]

node_patient -->|"uses"| node_app
node_app -->|"routes to"| node_auth
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_blink
node_app -->|"routes to"| node_sign
node_app -->|"routes to"| node_morse
node_app -->|"routes to"| node_remote_receiver
node_app -->|"routes to"| node_remote_sender
node_app -->|"routes to"| node_tts
node_app -->|"opens"| node_sos
node_sign -->|"classifies"| node_gesture
node_blink -->|"plays and speaks"| node_sound
node_blink -->|"sends events"| node_remote_utils
node_patient -->|"provides camera"| node_browser
node_browser -->|"captures blinks"| node_blink
node_browser -->|"captures signs"| node_sign
node_remote_sender -->|"sends camera data"| node_server
node_remote_receiver -->|"connects for stream"| node_server
node_remote_receiver -->|"uses"| node_remote_utils
node_server -->|"reads and writes"| node_db_layer
node_db_layer -->|"queries"| node_sqlite
node_app -->|"calls API"| node_server
node_server -.->|"requests completion"| node_gemini
node_tts -->|"uses speech"| node_sound

click node_app "https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/App.tsx"
click node_auth "https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/AuthPortal.tsx"
click node_dashboard "https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/Dashboard.tsx"
click node_sos "https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/SosModal.tsx"
click node_blink "https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/BlinkToText.tsx"
click node_sign "https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/SignLanguage.tsx"
click node_gesture "https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/utils/gesture.ts"
click node_morse "https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/MorseTranslator.tsx"
click node_remote_sender "https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/RemoteSender.tsx"
click node_remote_receiver "https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/RemoteReceiver.tsx"
click node_remote_utils "https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/utils/remote.ts"
click node_tts "https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/TextToSpeech.tsx"
click node_sound "https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/utils/sound.ts"
click node_server "https://github.com/sachinguptaa056-gif/echolytix/blob/main/server.ts"
click node_db_layer "https://github.com/sachinguptaa056-gif/echolytix/blob/main/database.ts"
click node_sqlite "https://github.com/sachinguptaa056-gif/echolytix/blob/main/database.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_auth,node_dashboard,node_sos,node_browser toneBlue
class node_blink,node_sign,node_gesture,node_morse,node_remote_sender,node_remote_receiver,node_remote_utils,node_tts,node_sound toneAmber
class node_server,node_gemini toneMint
class node_db_layer,node_sqlite toneRose
class node_patient toneIndigo
```

## Components

### Patient App

- [App Router](https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/App.tsx): `src/App.tsx`
- [Sign-in](https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/AuthPortal.tsx): `src/components/AuthPortal.tsx`
- [Caregiver Dashboard](https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/Dashboard.tsx): `src/components/Dashboard.tsx`
- [Emergency SOS](https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/SosModal.tsx): `src/components/SosModal.tsx`

### Communication Modes

- [Blink to Text](https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/BlinkToText.tsx): `src/components/BlinkToText.tsx`
- [Sign Recognition](https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/SignLanguage.tsx): `src/components/SignLanguage.tsx`
- [Gesture Classifier](https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/utils/gesture.ts): `src/utils/gesture.ts`
- [Manual Morse](https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/MorseTranslator.tsx): `src/components/MorseTranslator.tsx`
- [Remote Sender](https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/RemoteSender.tsx): `src/components/RemoteSender.tsx`
- [Remote Receiver](https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/RemoteReceiver.tsx): `src/components/RemoteReceiver.tsx`
- [Remote Helpers](https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/utils/remote.ts): `src/utils/remote.ts`
- [Text to Speech](https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/components/TextToSpeech.tsx): `src/components/TextToSpeech.tsx`
- [Audio Helpers](https://github.com/sachinguptaa056-gif/echolytix/blob/main/src/utils/sound.ts): `src/utils/sound.ts`

### Backend Services

- [Express API](https://github.com/sachinguptaa056-gif/echolytix/blob/main/server.ts): `server.ts`

### Persistent State

- [Database Access](https://github.com/sachinguptaa056-gif/echolytix/blob/main/database.ts): `database.ts`
- [SQLite](https://github.com/sachinguptaa056-gif/echolytix/blob/main/database.ts): `database.ts`

### Other components

- **Patient**
- **Gemini API**
- **Browser Camera**

## Connections

- Patient → App Router: uses
- App Router → Sign-in: routes to
- App Router → Caregiver Dashboard: routes to
- App Router → Blink to Text: routes to
- App Router → Sign Recognition: routes to
- App Router → Manual Morse: routes to
- App Router → Remote Receiver: routes to
- App Router → Remote Sender: routes to
- App Router → Text to Speech: routes to
- App Router → Emergency SOS: opens
- Sign Recognition → Gesture Classifier: classifies
- Blink to Text → Audio Helpers: plays and speaks
- Blink to Text → Remote Helpers: sends events
- Patient → Browser Camera: provides camera
- Browser Camera → Blink to Text: captures blinks
- Browser Camera → Sign Recognition: captures signs
- Remote Sender → Express API: sends camera data
- Remote Receiver → Express API: connects for stream
- Remote Receiver → Remote Helpers: uses
- Express API → Database Access: reads and writes
- Database Access → SQLite: queries
- App Router → Express API: calls API
- Express API → Gemini API: requests completion
- Text to Speech → Audio Helpers: uses speech
