# arunesh062/notecraft_generator architecture

> Architecture diagram of the GitHub repository arunesh062/notecraft_generator, 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/arunesh062/notecraft_generator
- Repository: https://github.com/arunesh062/notecraft_generator

## Overview

NoteCraft AI captures meeting or class audio in a Chrome extension, sends chunks to a FastAPI backend for transcription and mode-specific note generation, then exposes DOCX downloads and saves notes to per-user Firestore history. The extension also provides Firebase authentication and history review, including export of saved notes. Backend orchestration and the extension UI are shown as separate layers. Some capture and service wiring is documented only in the README; those relationships cite it rather than implying unsampled implementation details.

Main entry points: [`extension-react/src/App.jsx`](https://github.com/arunesh062/notecraft_generator/blob/main/extension-react/src/App.jsx) (Recording and notes UI), [`backend/routers/finalize.py`](https://github.com/arunesh062/notecraft_generator/blob/main/backend/routers/finalize.py) (Finalize pipeline), [`backend/main.py`](https://github.com/arunesh062/notecraft_generator/blob/main/backend/main.py) (FastAPI app), [`backend/routers/chunks.py`](https://github.com/arunesh062/notecraft_generator/blob/main/backend/routers/chunks.py) (Chunk ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Extension capture"]
  node_capture["Audio capture<br/>[offscreen.js]"]
  node_content["Meeting-page widget<br/>[content.jsx]"]
  node_worker["Extension worker<br/>[background.js]"]
end

subgraph group_backend["Note processing"]
  node_api["FastAPI app<br/>[main.py]"]
  node_chunks["Chunk ingestion<br/>[chunks.py]"]
  node_session[("Session and chunks<br/>[store.py]")]
  node_stt["Speech transcription<br/>[stt_client.py]"]
  node_finalize["Finalize pipeline<br/>[finalize.py]"]
  node_speaker["Speaker mapping<br/>[speaker_map.py]"]
  node_llm["Note generation<br/>[llm_client.py]"]
  node_metrics["Pipeline metrics<br/>[metrics_logger.py]"]
  node_status["Status and download<br/>[status.py]"]
  node_export["DOCX export<br/>[export.py]"]
end

subgraph group_identity["Identity and history"]
  node_auth["Auth state<br/>[AuthContext.jsx]"]
  node_firebase["Firebase services<br/>[firebase.js]"]
  node_history["Notes history service<br/>[notesHistory.js]"]
end

subgraph group_client["Extension interface"]
  node_app["Recording and notes UI<br/>[App.jsx]"]
  node_historyui["History and detail<br/>[HistoryList.jsx]"]
end

node_meeting(("Meeting or class"))
node_user(("Extension user"))

node_meeting -.->|"provides audio"| node_capture
node_capture -.->|"uploads chunks"| node_chunks
node_content -.->|"hosts widget"| node_app
node_app -.->|"controls capture"| node_worker
node_worker -.->|"proxies requests"| node_api
node_api -->|"registers routes"| node_chunks
node_api -->|"registers routes"| node_finalize
node_api -->|"registers routes"| node_status
node_chunks -->|"stores chunks"| node_session
node_chunks -->|"transcribes audio"| node_stt
node_finalize -->|"reads session"| node_session
node_finalize -->|"maps speakers"| node_speaker
node_finalize -->|"generates notes"| node_llm
node_finalize -->|"records metrics"| node_metrics
node_status -->|"reads status"| node_session
node_status -->|"exports DOCX"| node_export
node_user -.->|"uses extension"| node_app
node_app -->|"reads auth state"| node_auth
node_auth -->|"observes auth"| node_firebase
node_app -->|"saves generated notes"| node_history
node_history -->|"reads and writes"| node_firebase
node_app -->|"shows history"| node_historyui
node_historyui -->|"loads and deletes"| node_history
node_historyui -.->|"exports saved notes"| node_export
node_app -.->|"checks processing"| node_status
node_app -.->|"downloads document"| node_export

click node_capture "https://github.com/arunesh062/notecraft_generator/blob/main/extension-react/offscreen.js"
click node_content "https://github.com/arunesh062/notecraft_generator/blob/main/extension-react/content.jsx"
click node_worker "https://github.com/arunesh062/notecraft_generator/blob/main/extension-react/background.js"
click node_api "https://github.com/arunesh062/notecraft_generator/blob/main/backend/main.py"
click node_chunks "https://github.com/arunesh062/notecraft_generator/blob/main/backend/routers/chunks.py"
click node_session "https://github.com/arunesh062/notecraft_generator/blob/main/backend/session/store.py"
click node_stt "https://github.com/arunesh062/notecraft_generator/blob/main/backend/services/stt_client.py"
click node_finalize "https://github.com/arunesh062/notecraft_generator/blob/main/backend/routers/finalize.py"
click node_speaker "https://github.com/arunesh062/notecraft_generator/blob/main/backend/services/speaker_map.py"
click node_llm "https://github.com/arunesh062/notecraft_generator/blob/main/backend/services/llm_client.py"
click node_metrics "https://github.com/arunesh062/notecraft_generator/blob/main/backend/services/metrics_logger.py"
click node_status "https://github.com/arunesh062/notecraft_generator/blob/main/backend/routers/status.py"
click node_export "https://github.com/arunesh062/notecraft_generator/blob/main/backend/services/export.py"
click node_app "https://github.com/arunesh062/notecraft_generator/blob/main/extension-react/src/App.jsx"
click node_auth "https://github.com/arunesh062/notecraft_generator/blob/main/extension-react/src/context/AuthContext.jsx"
click node_firebase "https://github.com/arunesh062/notecraft_generator/blob/main/extension-react/src/firebase.js"
click node_history "https://github.com/arunesh062/notecraft_generator/blob/main/extension-react/src/services/notesHistory.js"
click node_historyui "https://github.com/arunesh062/notecraft_generator/blob/main/extension-react/src/components/HistoryList.jsx"

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_capture,node_content,node_worker,node_user toneBlue
class node_api,node_chunks,node_session,node_stt,node_finalize,node_speaker,node_llm,node_metrics,node_status,node_export toneAmber
class node_auth,node_firebase,node_history toneMint
class node_app,node_historyui toneRose
class node_meeting toneIndigo
```

## Components

### Extension capture

- [Audio capture](https://github.com/arunesh062/notecraft_generator/blob/main/extension-react/offscreen.js): `extension-react/offscreen.js`
- [Meeting-page widget](https://github.com/arunesh062/notecraft_generator/blob/main/extension-react/content.jsx): `extension-react/content.jsx`
- [Extension worker](https://github.com/arunesh062/notecraft_generator/blob/main/extension-react/background.js): `extension-react/background.js`

### Note processing

- [FastAPI app](https://github.com/arunesh062/notecraft_generator/blob/main/backend/main.py): `backend/main.py`
- [Chunk ingestion](https://github.com/arunesh062/notecraft_generator/blob/main/backend/routers/chunks.py): `backend/routers/chunks.py`
- [Session and chunks](https://github.com/arunesh062/notecraft_generator/blob/main/backend/session/store.py): `backend/session/store.py`
- [Speech transcription](https://github.com/arunesh062/notecraft_generator/blob/main/backend/services/stt_client.py): `backend/services/stt_client.py`
- [Finalize pipeline](https://github.com/arunesh062/notecraft_generator/blob/main/backend/routers/finalize.py): `backend/routers/finalize.py`
- [Speaker mapping](https://github.com/arunesh062/notecraft_generator/blob/main/backend/services/speaker_map.py): `backend/services/speaker_map.py`
- [Note generation](https://github.com/arunesh062/notecraft_generator/blob/main/backend/services/llm_client.py): `backend/services/llm_client.py`
- [Pipeline metrics](https://github.com/arunesh062/notecraft_generator/blob/main/backend/services/metrics_logger.py): `backend/services/metrics_logger.py`
- [Status and download](https://github.com/arunesh062/notecraft_generator/blob/main/backend/routers/status.py): `backend/routers/status.py`
- [DOCX export](https://github.com/arunesh062/notecraft_generator/blob/main/backend/services/export.py): `backend/services/export.py`

### Identity and history

- [Auth state](https://github.com/arunesh062/notecraft_generator/blob/main/extension-react/src/context/AuthContext.jsx): `extension-react/src/context/AuthContext.jsx`
- [Firebase services](https://github.com/arunesh062/notecraft_generator/blob/main/extension-react/src/firebase.js): `extension-react/src/firebase.js`
- [Notes history service](https://github.com/arunesh062/notecraft_generator/blob/main/extension-react/src/services/notesHistory.js): `extension-react/src/services/notesHistory.js`

### Extension interface

- [Recording and notes UI](https://github.com/arunesh062/notecraft_generator/blob/main/extension-react/src/App.jsx): `extension-react/src/App.jsx`
- [History and detail](https://github.com/arunesh062/notecraft_generator/blob/main/extension-react/src/components/HistoryList.jsx): `extension-react/src/components/HistoryList.jsx`

### Other components

- **Meeting or class**
- **Extension user**

## Connections

- Meeting or class → Audio capture: provides audio (evidence: `Readme.md`)
- Audio capture → Chunk ingestion: uploads chunks (evidence: `Readme.md`)
- Meeting-page widget → Recording and notes UI: hosts widget (evidence: `Readme.md`)
- Recording and notes UI → Extension worker: controls capture (evidence: `Readme.md`)
- Extension worker → FastAPI app: proxies requests (evidence: `Readme.md`)
- FastAPI app → Chunk ingestion: registers routes (evidence: `backend/main.py`)
- FastAPI app → Finalize pipeline: registers routes (evidence: `backend/main.py`)
- FastAPI app → Status and download: registers routes (evidence: `backend/main.py`)
- Chunk ingestion → Session and chunks: stores chunks (evidence: `backend/routers/chunks.py`)
- Chunk ingestion → Speech transcription: transcribes audio (evidence: `backend/routers/chunks.py`)
- Finalize pipeline → Session and chunks: reads session (evidence: `backend/routers/finalize.py`)
- Finalize pipeline → Speaker mapping: maps speakers (evidence: `backend/routers/finalize.py`)
- Finalize pipeline → Note generation: generates notes (evidence: `backend/routers/finalize.py`)
- Finalize pipeline → Pipeline metrics: records metrics (evidence: `backend/routers/finalize.py`)
- Status and download → Session and chunks: reads status (evidence: `backend/routers/status.py`)
- Status and download → DOCX export: exports DOCX (evidence: `backend/routers/status.py`)
- Extension user → Recording and notes UI: uses extension (evidence: `Readme.md`)
- Recording and notes UI → Auth state: reads auth state (evidence: `extension-react/src/App.jsx`)
- Auth state → Firebase services: observes auth (evidence: `extension-react/src/context/AuthContext.jsx`)
- Recording and notes UI → Notes history service: saves generated notes (evidence: `extension-react/src/App.jsx`)
- Notes history service → Firebase services: reads and writes (evidence: `extension-react/src/services/notesHistory.js`)
- Recording and notes UI → History and detail: shows history (evidence: `extension-react/src/App.jsx`)
- History and detail → Notes history service: loads and deletes (evidence: `extension-react/src/components/HistoryList.jsx`)
- History and detail → DOCX export: exports saved notes (evidence: `Readme.md`)
- Recording and notes UI → Status and download: checks processing (evidence: `Readme.md`)
- Recording and notes UI → DOCX export: downloads document (evidence: `Readme.md`)
