# krushang004/intelliboard architecture

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

- Interactive diagram: https://gitdiagram.com/krushang004/intelliboard
- Repository: https://github.com/krushang004/intelliboard

## Overview

This is an interactive whiteboard prototype: users draw and operate tools with webcam-tracked hand gestures, keyboard fallbacks, or ESP32 buttons, then use OCR, arithmetic solving, speech, and PDF export on the canvas. The main loop coordinates the runtime, with tracking, gesture classification, canvas operations, and feature modules as distinct layers. README documents shape recognition, but the available tree and excerpts do not show an implementation, so it is omitted. Edges reflect explicit README flows and calls visible in excerpts; unsampled internals are not inferred.

Main entry points: [`main.py`](https://github.com/krushang004/intelliboard/blob/main/main.py) (App loop), [`esp32_controller.py`](https://github.com/krushang004/intelliboard/blob/main/esp32_controller.py) (Serial controller), [`hand_tracker.py`](https://github.com/krushang004/intelliboard/blob/main/hand_tracker.py) (Hand tracker), [`pdf_export.py`](https://github.com/krushang004/intelliboard/blob/main/pdf_export.py) (PDF export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App control"]
  node_main["App loop<br/>[main.py]"]
  node_config["Runtime settings<br/>[config.py]"]
end

subgraph group_vision["Hand interaction"]
  node_tracker["Hand tracker<br/>[hand_tracker.py]"]
  node_gestures["Gesture classifier<br/>[gestures.py]"]
end

subgraph group_board["Whiteboard"]
  node_canvas["Air canvas<br/>[air_canvas.py]"]
end

subgraph group_features["Note features"]
  node_ocr["OCR engine<br/>[ocr_engine.py]"]
  node_solver["Math solver<br/>[math_solver.py]"]
  node_speech["Speech output<br/>[speech.py]"]
  node_pdf["PDF export<br/>[pdf_export.py]"]
  node_notes[("Saved notes")]
end

subgraph group_device["ESP32 controls"]
  node_esp["Serial controller"]
end

node_user(("Whiteboard user"))
node_webcam(("Webcam"))
node_controller["ESP32 board"]
node_keyboard(("Keyboard"))

node_user -->|"gestures"| node_webcam
node_webcam -->|"video frames"| node_main
node_main -->|"processes frames"| node_tracker
node_tracker -.->|"landmarks"| node_gestures
node_main -->|"classifies hand"| node_gestures
node_main -->|"updates strokes"| node_canvas
node_main -->|"reads settings"| node_config
node_user -->|"fallback commands"| node_keyboard
node_keyboard -->|"commands"| node_main
node_user -->|"button input"| node_controller
node_controller -->|"serial commands"| node_esp
node_esp -.->|"reads commands"| node_main
node_main -->|"sends status"| node_esp
node_main -->|"recognizes canvas"| node_ocr
node_main -->|"solves expression"| node_solver
node_main -->|"speaks result"| node_speech
node_main -->|"exports canvas"| node_pdf
node_pdf -.->|"writes PDF"| node_notes
node_main -->|"math input OCR"| node_ocr

click node_main "https://github.com/krushang004/intelliboard/blob/main/main.py"
click node_config "https://github.com/krushang004/intelliboard/blob/main/config.py"
click node_tracker "https://github.com/krushang004/intelliboard/blob/main/hand_tracker.py"
click node_gestures "https://github.com/krushang004/intelliboard/blob/main/gestures.py"
click node_canvas "https://github.com/krushang004/intelliboard/blob/main/air_canvas.py"
click node_ocr "https://github.com/krushang004/intelliboard/blob/main/ocr_engine.py"
click node_solver "https://github.com/krushang004/intelliboard/blob/main/math_solver.py"
click node_speech "https://github.com/krushang004/intelliboard/blob/main/speech.py"
click node_pdf "https://github.com/krushang004/intelliboard/blob/main/pdf_export.py"
click node_notes "https://github.com/krushang004/intelliboard/tree/main/saved_notes"
click node_esp "https://github.com/krushang004/intelliboard/blob/main/esp32_controller.py"
click node_controller "https://github.com/krushang004/intelliboard/blob/main/esp32/whiteboard_controller/whiteboard_controller.ino"

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_main,node_config,node_user toneBlue
class node_tracker,node_gestures toneAmber
class node_canvas toneMint
class node_ocr,node_solver,node_speech,node_pdf,node_notes toneRose
class node_esp,node_webcam,node_keyboard toneIndigo
class node_controller toneTeal
```

## Components

### App control

- [App loop](https://github.com/krushang004/intelliboard/blob/main/main.py): `main.py`
- [Runtime settings](https://github.com/krushang004/intelliboard/blob/main/config.py): `config.py`

### Hand interaction

- [Hand tracker](https://github.com/krushang004/intelliboard/blob/main/hand_tracker.py): `hand_tracker.py`
- [Gesture classifier](https://github.com/krushang004/intelliboard/blob/main/gestures.py): `gestures.py`

### Whiteboard

- [Air canvas](https://github.com/krushang004/intelliboard/blob/main/air_canvas.py): `air_canvas.py`

### Note features

- [OCR engine](https://github.com/krushang004/intelliboard/blob/main/ocr_engine.py): `ocr_engine.py`
- [Math solver](https://github.com/krushang004/intelliboard/blob/main/math_solver.py): `math_solver.py`
- [Speech output](https://github.com/krushang004/intelliboard/blob/main/speech.py): `speech.py`
- [PDF export](https://github.com/krushang004/intelliboard/blob/main/pdf_export.py): `pdf_export.py`
- [Saved notes](https://github.com/krushang004/intelliboard/tree/main/saved_notes): `saved_notes`

### ESP32 controls

- [Serial controller](https://github.com/krushang004/intelliboard/blob/main/esp32_controller.py): `esp32_controller.py`

### Other components

- **Whiteboard user**
- **Webcam**
- [ESP32 board](https://github.com/krushang004/intelliboard/blob/main/esp32/whiteboard_controller/whiteboard_controller.ino): `esp32/whiteboard_controller/whiteboard_controller.ino`
- **Keyboard**

## Connections

- Whiteboard user → Webcam: gestures (evidence: `README.md`)
- Webcam → App loop: video frames (evidence: `main.py`)
- App loop → Hand tracker: processes frames (evidence: `main.py`)
- Hand tracker → Gesture classifier: landmarks
- App loop → Gesture classifier: classifies hand (evidence: `main.py`)
- App loop → Air canvas: updates strokes (evidence: `main.py`)
- App loop → Runtime settings: reads settings (evidence: `main.py`)
- Whiteboard user → Keyboard: fallback commands (evidence: `README.md`)
- Keyboard → App loop: commands (evidence: `main.py`)
- Whiteboard user → ESP32 board: button input (evidence: `README.md`)
- ESP32 board → Serial controller: serial commands (evidence: `README.md`)
- Serial controller → App loop: reads commands (evidence: `main.py`)
- App loop → Serial controller: sends status (evidence: `main.py`)
- App loop → OCR engine: recognizes canvas (evidence: `main.py`)
- App loop → Math solver: solves expression (evidence: `main.py`)
- App loop → Speech output: speaks result (evidence: `main.py`)
- App loop → PDF export: exports canvas (evidence: `main.py`)
- PDF export → Saved notes: writes PDF
- App loop → OCR engine: math input OCR (evidence: `main.py`)
