# siddu-0111/accessible-captcha architecture

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

- Interactive diagram: https://gitdiagram.com/siddu-0111/accessible-captcha
- Repository: https://github.com/siddu-0111/accessible-captcha

## Overview

This is a web-based, haptic-only CAPTCHA for blind, low-vision, and deaf-blind users. The user starts the browser experience, feels a server-generated short/long vibration pattern, enters it by tapping/holding or keyboard, and submits it for one-time verification. The server handles challenge generation, expiry, rate limits, and outcome logging; a separate evaluation script summarizes those logs and optional questionnaire data. The browser’s speech and vibration integrations are documented or indicated in the client excerpt, but their exact implementation is only partially sampled.

Main entry points: [`app.py`](https://github.com/siddu-0111/accessible-captcha/blob/main/app.py) (HTTP endpoints), [`static/script.js`](https://github.com/siddu-0111/accessible-captcha/blob/main/static/script.js) (CAPTCHA interface), [`static/index.html`](https://github.com/siddu-0111/accessible-captcha/blob/main/static/index.html) (Web page), [`generator.py`](https://github.com/siddu-0111/accessible-captcha/blob/main/generator.py) (Pattern generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Accessible client"]
  node_client["CAPTCHA interface<br/>[script.js]"]
  node_page["Web page<br/>[index.html]"]
  node_speech["Browser speech"]
  node_vibration["Device vibration"]
end

subgraph group_server["Challenge service"]
  node_routes["HTTP endpoints<br/>[app.py]"]
  node_generator["Pattern generator<br/>[generator.py]"]
  node_verification["Answer verification<br/>[app.py]"]
end

subgraph group_state["Security and records"]
  node_challenge_state[("Challenge state<br/>[app.py]")]
  node_rate_limits["Rate limits<br/>[app.py]"]
  node_event_logs["Event log<br/>[app.py]"]
end

subgraph group_evaluation["Usability evaluation"]
  node_analysis["Usability analysis"]
end

node_user(("CAPTCHA user"))

node_user -->|"interacts"| node_client
node_client -.->|"loads"| node_page
node_routes -->|"serves"| node_page
node_client -->|"requests challenge"| node_routes
node_client -->|"submits answer"| node_routes
node_routes -->|"generates challenge"| node_generator
node_routes -->|"stores and consumes"| node_challenge_state
node_routes -->|"checks limits"| node_rate_limits
node_routes -->|"dispatches verification"| node_verification
node_verification -->|"normalizes answer"| node_generator
node_routes -->|"writes events"| node_event_logs
node_analysis -->|"reads outcomes"| node_event_logs
node_client -.->|"announces instructions"| node_speech
node_client -.->|"plays patterns"| node_vibration

click node_client "https://github.com/siddu-0111/accessible-captcha/blob/main/static/script.js"
click node_page "https://github.com/siddu-0111/accessible-captcha/blob/main/static/index.html"
click node_routes "https://github.com/siddu-0111/accessible-captcha/blob/main/app.py"
click node_generator "https://github.com/siddu-0111/accessible-captcha/blob/main/generator.py"
click node_verification "https://github.com/siddu-0111/accessible-captcha/blob/main/app.py"
click node_challenge_state "https://github.com/siddu-0111/accessible-captcha/blob/main/app.py"
click node_rate_limits "https://github.com/siddu-0111/accessible-captcha/blob/main/app.py"
click node_event_logs "https://github.com/siddu-0111/accessible-captcha/blob/main/app.py"
click node_analysis "https://github.com/siddu-0111/accessible-captcha/blob/main/eval/usability_analysis.py"

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_client,node_page,node_speech,node_vibration,node_user toneBlue
class node_routes,node_generator,node_verification toneAmber
class node_challenge_state,node_rate_limits,node_event_logs toneMint
class node_analysis toneRose
```

## Components

### Accessible client

- [CAPTCHA interface](https://github.com/siddu-0111/accessible-captcha/blob/main/static/script.js): `static/script.js`
- [Web page](https://github.com/siddu-0111/accessible-captcha/blob/main/static/index.html): `static/index.html`
- **Browser speech**
- **Device vibration**

### Challenge service

- [HTTP endpoints](https://github.com/siddu-0111/accessible-captcha/blob/main/app.py): `app.py`
- [Pattern generator](https://github.com/siddu-0111/accessible-captcha/blob/main/generator.py): `generator.py`
- [Answer verification](https://github.com/siddu-0111/accessible-captcha/blob/main/app.py): `app.py`

### Security and records

- [Challenge state](https://github.com/siddu-0111/accessible-captcha/blob/main/app.py): `app.py`
- [Rate limits](https://github.com/siddu-0111/accessible-captcha/blob/main/app.py): `app.py`
- [Event log](https://github.com/siddu-0111/accessible-captcha/blob/main/app.py): `app.py`

### Usability evaluation

- [Usability analysis](https://github.com/siddu-0111/accessible-captcha/blob/main/eval/usability_analysis.py): `eval/usability_analysis.py`

### Other components

- **CAPTCHA user**

## Connections

- CAPTCHA user → CAPTCHA interface: interacts (evidence: `Readme.md`)
- CAPTCHA interface → Web page: loads
- HTTP endpoints → Web page: serves (evidence: `app.py`)
- CAPTCHA interface → HTTP endpoints: requests challenge (evidence: `static/script.js`)
- CAPTCHA interface → HTTP endpoints: submits answer (evidence: `static/script.js`)
- HTTP endpoints → Pattern generator: generates challenge (evidence: `app.py`)
- HTTP endpoints → Challenge state: stores and consumes (evidence: `app.py`)
- HTTP endpoints → Rate limits: checks limits (evidence: `app.py`)
- HTTP endpoints → Answer verification: dispatches verification (evidence: `app.py`)
- Answer verification → Pattern generator: normalizes answer (evidence: `app.py`)
- HTTP endpoints → Event log: writes events (evidence: `app.py`)
- Usability analysis → Event log: reads outcomes (evidence: `eval/usability_analysis.py`)
- CAPTCHA interface → Browser speech: announces instructions
- CAPTCHA interface → Device vibration: plays patterns
