# francisocol/signar architecture

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

- Interactive diagram: https://gitdiagram.com/francisocol/signar
- Repository: https://github.com/francisocol/signar

## Overview

SignAR is a browser-based Filipino Sign Language recognition and visualization prototype. Its main workflow starts a camera, sends frames to MediaPipe Hands, recognizes gestures, and presents feedback while confirmed signs build a sentence that can be spoken. Separate capabilities include searchable sign learning, 3D practice, camera controls, and installable/offline PWA behavior. Recognition and sentence integration details are only partly shown in the sampled source; dashed edges mark that uncertainty.

Main entry points: [`sw.js`](https://github.com/francisocol/signar/blob/main/sw.js) (Service Worker), [`script.js`](https://github.com/francisocol/signar/blob/main/script.js) (Gesture Recognition), [`manifest.webmanifest`](https://github.com/francisocol/signar/blob/main/manifest.webmanifest) (PWA Manifest), [`index.html`](https://github.com/francisocol/signar/blob/main/index.html) (App Assets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_recognition["Live Recognition"]
  node_camera["Camera Capture<br/>[script.js]"]
  node_mediapipe["MediaPipe Hands"]
  node_gesture["Gesture Recognition<br/>[script.js]"]
  node_ar["AR Feedback<br/>[script.js]"]
  node_camera_controls["Camera Controls<br/>[script.js]"]
end

subgraph group_interaction["Learning and Output"]
  node_sentence["Sentence Builder<br/>[script.js]"]
  node_translation["Sentence Translation<br/>[script.js]"]
  node_speech["Browser Speech<br/>[script.js]"]
  node_sign_learning["Sign Learning<br/>[script.js]"]
  node_practice["3D Practice<br/>[script.js]"]
end

subgraph group_pwa["PWA Support"]
  node_service_worker["Service Worker<br/>[sw.js]"]
  node_cache[("Asset Cache<br/>[sw.js]")]
  node_manifest["PWA Manifest"]
  node_static_assets["App Assets<br/>[index.html]"]
end

node_user(("User"))
node_browser_speech["Speech Synthesis"]

node_user -->|"starts or switches"| node_camera_controls
node_camera_controls -->|"starts capture"| node_camera
node_camera -->|"sends frames"| node_mediapipe
node_mediapipe -.->|"provides landmarks"| node_gesture
node_gesture -.->|"shows recognition"| node_ar
node_gesture -.->|"adds confirmed signs"| node_sentence
node_sentence -.->|"formats output"| node_translation
node_user -->|"edits sentence"| node_sentence
node_user -->|"requests speech"| node_speech
node_speech -.->|"speaks text"| node_browser_speech
node_user -->|"searches signs"| node_sign_learning
node_user -.->|"practices signs"| node_practice
node_service_worker -->|"stores assets"| node_cache
node_service_worker -->|"reads on failure"| node_cache
node_service_worker -->|"caches app files"| node_static_assets
node_user -.->|"installs app"| node_manifest

click node_camera "https://github.com/francisocol/signar/blob/main/script.js"
click node_gesture "https://github.com/francisocol/signar/blob/main/script.js"
click node_ar "https://github.com/francisocol/signar/blob/main/script.js"
click node_camera_controls "https://github.com/francisocol/signar/blob/main/script.js"
click node_sentence "https://github.com/francisocol/signar/blob/main/script.js"
click node_translation "https://github.com/francisocol/signar/blob/main/script.js"
click node_speech "https://github.com/francisocol/signar/blob/main/script.js"
click node_sign_learning "https://github.com/francisocol/signar/blob/main/script.js"
click node_practice "https://github.com/francisocol/signar/blob/main/script.js"
click node_service_worker "https://github.com/francisocol/signar/blob/main/sw.js"
click node_cache "https://github.com/francisocol/signar/blob/main/sw.js"
click node_manifest "https://github.com/francisocol/signar/blob/main/manifest.webmanifest"
click node_static_assets "https://github.com/francisocol/signar/blob/main/index.html"

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_camera,node_mediapipe,node_gesture,node_ar,node_camera_controls,node_user toneBlue
class node_sentence,node_translation,node_speech,node_sign_learning,node_practice toneAmber
class node_service_worker,node_cache,node_manifest,node_static_assets toneMint
class node_browser_speech toneIndigo
```

## Components

### Live Recognition

- [Camera Capture](https://github.com/francisocol/signar/blob/main/script.js): `script.js`
- **MediaPipe Hands**
- [Gesture Recognition](https://github.com/francisocol/signar/blob/main/script.js): `script.js`
- [AR Feedback](https://github.com/francisocol/signar/blob/main/script.js): `script.js`
- [Camera Controls](https://github.com/francisocol/signar/blob/main/script.js): `script.js`

### Learning and Output

- [Sentence Builder](https://github.com/francisocol/signar/blob/main/script.js): `script.js`
- [Sentence Translation](https://github.com/francisocol/signar/blob/main/script.js): `script.js`
- [Browser Speech](https://github.com/francisocol/signar/blob/main/script.js): `script.js`
- [Sign Learning](https://github.com/francisocol/signar/blob/main/script.js): `script.js`
- [3D Practice](https://github.com/francisocol/signar/blob/main/script.js): `script.js`

### PWA Support

- [Service Worker](https://github.com/francisocol/signar/blob/main/sw.js): `sw.js`
- [Asset Cache](https://github.com/francisocol/signar/blob/main/sw.js): `sw.js`
- [PWA Manifest](https://github.com/francisocol/signar/blob/main/manifest.webmanifest): `manifest.webmanifest`
- [App Assets](https://github.com/francisocol/signar/blob/main/index.html): `index.html`

### Other components

- **User**
- **Speech Synthesis**

## Connections

- User → Camera Controls: starts or switches (evidence: `script.js`)
- Camera Controls → Camera Capture: starts capture (evidence: `script.js`)
- Camera Capture → MediaPipe Hands: sends frames (evidence: `script.js`)
- MediaPipe Hands → Gesture Recognition: provides landmarks
- Gesture Recognition → AR Feedback: shows recognition (evidence: `script.js`)
- Gesture Recognition → Sentence Builder: adds confirmed signs (evidence: `script.js`)
- Sentence Builder → Sentence Translation: formats output (evidence: `script.js`)
- User → Sentence Builder: edits sentence (evidence: `script.js`)
- User → Browser Speech: requests speech (evidence: `script.js`)
- Browser Speech → Speech Synthesis: speaks text
- User → Sign Learning: searches signs (evidence: `script.js`)
- User → 3D Practice: practices signs
- Service Worker → Asset Cache: stores assets (evidence: `sw.js`)
- Service Worker → Asset Cache: reads on failure (evidence: `sw.js`)
- Service Worker → App Assets: caches app files (evidence: `sw.js`)
- User → PWA Manifest: installs app
