# sumit12c/notesnap architecture

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

- Interactive diagram: https://gitdiagram.com/sumit12c/notesnap
- Repository: https://github.com/sumit12c/notesnap

## Overview

NoteSnap turns study-session screen captures into editable OCR text, Gemini-organized revision notes, and downloadable documents. The principal workflow is coordinated by the React application; settings, live capture management, progress, statistics, and export are presented through dedicated UI components. The Express backend handles Gemini processing, and the DOCX utility formats the generated notes. The README documents capture, OCR, notifications, auto-pause, and session recovery; sampled excerpts do not expose all corresponding implementation details, so those links are documented rather than inferred from unsampled code.

Main entry points: [`src/App.tsx`](https://github.com/sumit12c/notesnap/blob/main/src/App.tsx) (Session coordinator), [`server.ts`](https://github.com/sumit12c/notesnap/blob/main/server.ts) (Session processing API), [`src/types.ts`](https://github.com/sumit12c/notesnap/blob/main/src/types.ts) (Session data), [`src/components/DownloadsModal.tsx`](https://github.com/sumit12c/notesnap/blob/main/src/components/DownloadsModal.tsx) (Export options)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Study workflow"]
  node_app["Session coordinator<br/>[App.tsx]"]
  node_capture["Screen capture<br/>[App.tsx]"]
  node_ocr["OCR extraction<br/>[App.tsx]"]
  node_session["Session data<br/>[types.ts]"]
end

subgraph group_interface["Session interface"]
  node_settings["Session settings<br/>[SettingsModal.tsx]"]
  node_status["Capture status"]
  node_stats["Session analytics"]
  node_capturelist["Live captures"]
  node_processing["Processing progress"]
  node_downloads["Export options<br/>[DownloadsModal.tsx]"]
end

subgraph group_services["AI and export"]
  node_api["Session processing API<br/>[server.ts]"]
  node_gemini{{"Google Gemini"}}
  node_notes["Structured notes<br/>[server.ts]"]
  node_docx["DOCX generation<br/>[docxExporter.ts]"]
end

subgraph group_runtime["Application runtime"]
  node_browser(("Browser runtime"))
  node_entry["React entry point<br/>[main.tsx]"]
end

node_user(("Study user"))

node_user -->|"starts session"| node_app
node_entry -->|"renders"| node_app
node_browser -.->|"provides screen"| node_capture
node_app -->|"coordinates"| node_capture
node_capture -->|"extracts text"| node_ocr
node_ocr -.->|"records captures"| node_session
node_app -->|"manages"| node_session
node_app -->|"renders"| node_settings
node_app -->|"renders"| node_status
node_app -->|"renders"| node_stats
node_app -->|"renders"| node_capturelist
node_app -->|"renders"| node_processing
node_app -->|"renders"| node_downloads
node_app -.->|"submits session"| node_api
node_api -->|"generates notes"| node_gemini
node_gemini -->|"returns markdown"| node_notes
node_app -->|"generates document"| node_docx
node_notes -.->|"formats notes"| node_docx
node_app -->|"offers exports"| node_downloads

click node_app "https://github.com/sumit12c/notesnap/blob/main/src/App.tsx"
click node_capture "https://github.com/sumit12c/notesnap/blob/main/src/App.tsx"
click node_ocr "https://github.com/sumit12c/notesnap/blob/main/src/App.tsx"
click node_session "https://github.com/sumit12c/notesnap/blob/main/src/types.ts"
click node_settings "https://github.com/sumit12c/notesnap/blob/main/src/components/SettingsModal.tsx"
click node_status "https://github.com/sumit12c/notesnap/blob/main/src/components/CaptureStatusIndicator.tsx"
click node_stats "https://github.com/sumit12c/notesnap/blob/main/src/components/SessionStatsPanel.tsx"
click node_capturelist "https://github.com/sumit12c/notesnap/blob/main/src/components/LiveCapturesList.tsx"
click node_processing "https://github.com/sumit12c/notesnap/blob/main/src/components/ProcessingOverlay.tsx"
click node_downloads "https://github.com/sumit12c/notesnap/blob/main/src/components/DownloadsModal.tsx"
click node_api "https://github.com/sumit12c/notesnap/blob/main/server.ts"
click node_notes "https://github.com/sumit12c/notesnap/blob/main/server.ts"
click node_docx "https://github.com/sumit12c/notesnap/blob/main/src/utils/docxExporter.ts"
click node_entry "https://github.com/sumit12c/notesnap/blob/main/src/main.tsx"

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_capture,node_ocr,node_session,node_user toneBlue
class node_settings,node_status,node_stats,node_capturelist,node_processing,node_downloads toneAmber
class node_api,node_gemini,node_notes,node_docx toneMint
class node_browser,node_entry toneRose
```

## Components

### Study workflow

- [Session coordinator](https://github.com/sumit12c/notesnap/blob/main/src/App.tsx): `src/App.tsx`
- [Screen capture](https://github.com/sumit12c/notesnap/blob/main/src/App.tsx): `src/App.tsx`
- [OCR extraction](https://github.com/sumit12c/notesnap/blob/main/src/App.tsx): `src/App.tsx`
- [Session data](https://github.com/sumit12c/notesnap/blob/main/src/types.ts): `src/types.ts`

### Session interface

- [Session settings](https://github.com/sumit12c/notesnap/blob/main/src/components/SettingsModal.tsx): `src/components/SettingsModal.tsx`
- [Capture status](https://github.com/sumit12c/notesnap/blob/main/src/components/CaptureStatusIndicator.tsx): `src/components/CaptureStatusIndicator.tsx`
- [Session analytics](https://github.com/sumit12c/notesnap/blob/main/src/components/SessionStatsPanel.tsx): `src/components/SessionStatsPanel.tsx`
- [Live captures](https://github.com/sumit12c/notesnap/blob/main/src/components/LiveCapturesList.tsx): `src/components/LiveCapturesList.tsx`
- [Processing progress](https://github.com/sumit12c/notesnap/blob/main/src/components/ProcessingOverlay.tsx): `src/components/ProcessingOverlay.tsx`
- [Export options](https://github.com/sumit12c/notesnap/blob/main/src/components/DownloadsModal.tsx): `src/components/DownloadsModal.tsx`

### AI and export

- [Session processing API](https://github.com/sumit12c/notesnap/blob/main/server.ts): `server.ts`
- **Google Gemini**
- [Structured notes](https://github.com/sumit12c/notesnap/blob/main/server.ts): `server.ts`
- [DOCX generation](https://github.com/sumit12c/notesnap/blob/main/src/utils/docxExporter.ts): `src/utils/docxExporter.ts`

### Application runtime

- **Browser runtime**
- [React entry point](https://github.com/sumit12c/notesnap/blob/main/src/main.tsx): `src/main.tsx`

### Other components

- **Study user**

## Connections

- Study user → Session coordinator: starts session (evidence: `README.md`)
- React entry point → Session coordinator: renders (evidence: `src/main.tsx`)
- Browser runtime → Screen capture: provides screen (evidence: `README.md`)
- Session coordinator → Screen capture: coordinates (evidence: `README.md`)
- Screen capture → OCR extraction: extracts text (evidence: `README.md`)
- OCR extraction → Session data: records captures (evidence: `README.md`)
- Session coordinator → Session data: manages (evidence: `src/App.tsx`)
- Session coordinator → Session settings: renders (evidence: `src/App.tsx`)
- Session coordinator → Capture status: renders (evidence: `src/App.tsx`)
- Session coordinator → Session analytics: renders (evidence: `src/App.tsx`)
- Session coordinator → Live captures: renders (evidence: `src/App.tsx`)
- Session coordinator → Processing progress: renders (evidence: `src/App.tsx`)
- Session coordinator → Export options: renders (evidence: `src/App.tsx`)
- Session coordinator → Session processing API: submits session (evidence: `README.md`)
- Session processing API → Google Gemini: generates notes (evidence: `server.ts`)
- Google Gemini → Structured notes: returns markdown (evidence: `server.ts`)
- Session coordinator → DOCX generation: generates document (evidence: `src/App.tsx`)
- Structured notes → DOCX generation: formats notes (evidence: `README.md`)
- Session coordinator → Export options: offers exports (evidence: `README.md`)
