Compare commits

2 Commits

Author SHA1 Message Date
naomi 3c8a46e5a6 feat: add meeting transcription app scaffolding
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 48s
CI / Lint & Test (pull_request) Successful in 14m18s
CI / Build Linux (pull_request) Successful in 14m19s
CI / Build Windows (cross-compile) (pull_request) Failing after 19m39s
- Add Python backend structure with FastAPI for transcription/summarization
- Add React UI with audio recording, transcript, and summary views
- Configure Tauri to manage Python backend lifecycle
- Set up Windows cross-compilation with cargo-xwin
- Add Gitea CI workflow for lint, test, and multi-platform builds
- Configure ESLint, Prettier, and Vitest for code quality

Note: App scaffolding only - Python env and models not yet set up
2026-01-21 20:18:03 -08:00
naomi 96494a9997 feat: prep the scaffolding 2026-01-21 17:49:25 -08:00
68 changed files with 10230 additions and 32 deletions
+2 -3
View File
@@ -1,6 +1,6 @@
name: 🐛 Bug Report
description: Something isn't working as expected? Let us know!
title: '[BUG] - '
title: "[BUG] - "
labels:
- "status/awaiting triage"
body:
@@ -50,7 +50,7 @@ body:
description: The operating system you are using, including the version/build number.
validations:
required: true
# Remove this section for non-web apps.
# Remove this section for non-web apps.
- type: input
id: browser
attributes:
@@ -66,4 +66,3 @@ body:
- No
validations:
required: true
+1 -1
View File
@@ -2,4 +2,4 @@ blank_issues_enabled: false
contact_links:
- name: "Discord"
url: "https://chat.nhcarrigan.com"
about: "Chat with us directly."
about: "Chat with us directly."
+1 -1
View File
@@ -1,6 +1,6 @@
name: 💭 Feature Proposal
description: Have an idea for how we can improve? Share it here!
title: '[FEAT] - '
title: "[FEAT] - "
labels:
- "status/awaiting triage"
body:
+1 -1
View File
@@ -1,6 +1,6 @@
name: ❓ Other Issue
description: I have something that is neither a bug nor a feature request.
title: '[OTHER] - '
title: "[OTHER] - "
labels:
- "status/awaiting triage"
body:
+189
View File
@@ -0,0 +1,189 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
lint-and-test:
name: Lint & Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
librsvg2-dev \
patchelf \
libgtk-3-dev \
libayatana-appindicator3-dev
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install frontend dependencies
run: pnpm install
- name: Run ESLint
run: pnpm lint
- name: Run Prettier check
run: pnpm format:check
- name: Build frontend
run: pnpm build
- name: Run frontend tests
run: pnpm test
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
src-tauri/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run Clippy
working-directory: src-tauri
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run Rust tests
working-directory: src-tauri
run: cargo test
build-linux:
name: Build Linux
runs-on: ubuntu-latest
needs: lint-and-test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
librsvg2-dev \
patchelf \
libgtk-3-dev \
libayatana-appindicator3-dev \
xdg-utils
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install frontend dependencies
run: pnpm install
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
src-tauri/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build Linux
run: pnpm build:linux
build-windows:
name: Build Windows (cross-compile)
runs-on: ubuntu-latest
needs: lint-and-test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Linux dependencies for cross-compilation
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
librsvg2-dev \
patchelf \
libgtk-3-dev \
libayatana-appindicator3-dev \
clang \
lld \
llvm \
nsis
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install frontend dependencies
run: pnpm install
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- name: Install cargo-xwin
run: |
curl -fsSL https://github.com/rust-cross/cargo-xwin/releases/download/v0.20.2/cargo-xwin-v0.20.2.x86_64-unknown-linux-musl.tar.gz | tar xz
sudo mv cargo-xwin /usr/local/bin/
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
src-tauri/target/
key: ${{ runner.os }}-cargo-windows-${{ hashFiles('**/Cargo.lock') }}
- name: Build Windows
run: pnpm build:windows
+13 -13
View File
@@ -2,11 +2,11 @@ name: Security Scan and Upload
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
schedule:
- cron: '0 0 * * 1'
- cron: "0 0 * * 1"
workflow_dispatch:
jobs:
@@ -24,18 +24,18 @@ jobs:
env:
DD_URL: ${{ secrets.DD_URL }}
DD_TOKEN: ${{ secrets.DD_TOKEN }}
PRODUCT_NAME: ${{ github.repository }}
PRODUCT_TYPE_ID: 1
PRODUCT_NAME: ${{ github.repository }}
PRODUCT_TYPE_ID: 1
run: |
sudo apt-get install jq -y > /dev/null
echo "Checking connection to $DD_URL..."
# Check if product exists - capture HTTP code to debug connection issues
RESPONSE=$(curl --write-out "%{http_code}" --silent --output /tmp/response.json \
-H "Authorization: Token $DD_TOKEN" \
"$DD_URL/api/v2/products/?name=$PRODUCT_NAME")
# If response is not 200, print error
if [ "$RESPONSE" != "200" ]; then
echo "::error::Failed to query DefectDojo. HTTP Code: $RESPONSE"
@@ -44,7 +44,7 @@ jobs:
fi
COUNT=$(cat /tmp/response.json | jq -r '.count')
if [ "$COUNT" = "0" ]; then
echo "Creating product '$PRODUCT_NAME'..."
curl -s -X POST "$DD_URL/api/v2/products/" \
@@ -75,7 +75,7 @@ jobs:
echo "Uploading Trivy results..."
# Generate today's date in YYYY-MM-DD format
TODAY=$(date +%Y-%m-%d)
HTTP_CODE=$(curl --write-out "%{http_code}" --output response.txt --silent -X POST "$DD_URL/api/v2/import-scan/" \
-H "Authorization: Token $DD_TOKEN" \
-F "active=true" \
@@ -86,7 +86,7 @@ jobs:
-F "scan_date=$TODAY" \
-F "auto_create_context=true" \
-F "file=@trivy-results.json")
if [[ "$HTTP_CODE" != "200" && "$HTTP_CODE" != "201" ]]; then
echo "::error::Upload Failed with HTTP $HTTP_CODE"
echo "--- SERVER RESPONSE ---"
@@ -154,7 +154,7 @@ jobs:
run: |
echo "Uploading Semgrep results..."
TODAY=$(date +%Y-%m-%d)
HTTP_CODE=$(curl --write-out "%{http_code}" --output response.txt --silent -X POST "$DD_URL/api/v2/import-scan/" \
-H "Authorization: Token $DD_TOKEN" \
-F "active=true" \
@@ -174,4 +174,4 @@ jobs:
exit 1
else
echo "Upload Success!"
fi
fi
+54
View File
@@ -0,0 +1,54 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
env/
venv/
ENV/
.venv/
*.egg-info/
# Models (we'll add these to git lfs later)
models/*.gguf
models/*.bin
# Tauri
src-tauri/target/
src-tauri/WixTools/
# App data
recordings/
transcripts/
summaries/
# Environment
.env
*.env.local
prod.env
+8
View File
@@ -0,0 +1,8 @@
build/
.svelte-kit/
dist/
src-tauri/target/
src-tauri/gen/
node_modules/
.pnpm-store/
pnpm-lock.yaml
+7
View File
@@ -0,0 +1,7 @@
{
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5",
"printWidth": 100
}
+3
View File
@@ -0,0 +1,3 @@
{
"recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
}
+120
View File
@@ -0,0 +1,120 @@
# Chronara - Local Meeting Transcription & Summarization
A Windows desktop application that transcribes, diarizes, and summarizes meetings using only locally-running models.
## Features
- 🎙️ Real-time audio transcription with speaker diarization (WhisperX)
- 📝 Intelligent meeting summarization (Llama 3.2)
- 🖥️ Everything runs locally - no cloud services required
- 📦 All models bundled - no separate downloads needed
## Tech Stack
- **Transcription**: WhisperX (Whisper + speaker diarization)
- **Summarization**: Llama 3.2 1B/3B
- **Backend**: Python with FastAPI
- **Frontend**: Tauri + React
- **Model Runtime**: llama-cpp-python
## Project Structure
```
chronara/
├── src/
│ ├── backend/ # Python FastAPI backend
│ ├── components/ # React components
│ └── App.tsx # Main React app
├── src-tauri/ # Tauri configuration
├── models/ # Bundled model files
├── scripts/ # Build and setup scripts
└── assets/ # Icons, resources
```
## Development Setup
### Prerequisites
- Node.js 18+ with pnpm
- Python 3.10+
- Rust (for Tauri)
- Windows build tools (for native modules)
### Installation
1. Clone the repository:
```bash
git clone https://github.com/naomi-lgbt/chronara.git
cd chronara
```
2. Install frontend dependencies:
```bash
pnpm install
```
3. Install Python dependencies:
```bash
pip install -r requirements.txt
```
4. Download the AI models:
```bash
python scripts/download_models.py
```
5. Run in development mode:
```bash
pnpm tauri:dev
```
## Building for Production
### Windows
1. Download models if not already done:
```bash
python scripts/download_models.py
```
2. Build the Windows executable:
```bash
python scripts/build_windows.py
```
The installer will be created in `src-tauri/target/release/bundle/nsis/`.
## Usage
1. **Start Recording**: Click the "Start Recording" button to begin capturing audio
2. **Real-time Transcription**: Watch as the conversation is transcribed with speaker labels
3. **Generate Summary**: After recording, click "Generate Summary" for an AI-powered meeting summary
4. **Export**: Download both the full transcript and summary as text files
## Model Information
### Transcription (WhisperX)
- **Model**: OpenAI Whisper base model with WhisperX enhancements
- **Features**: Speaker diarization, timestamp alignment
- **Size**: ~150MB
### Summarization (Llama 3.2)
- **1B Model**: Fast, good for basic summaries (~1.2GB)
- **3B Model**: Better quality summaries (~2.5GB)
- **Format**: GGUF quantized models
## Privacy & Security
- All processing happens locally on your machine
- No audio or text data is sent to external servers
- Models are bundled with the application
- Meeting data stays on your device
+3 -13
View File
@@ -1,16 +1,6 @@
# New Repository Template
# Chronara
This template contains all of our basic files for a new GitHub repository. There is also a handy workflow that will create an issue on a new repository made from this template, with a checklist for the steps we usually take in setting up a new repository.
If you're starting a Node.JS project with TypeScript, we have a [specific template](https://github.com/naomi-lgbt/nodejs-typescript-template) for that purpose.
## Readme
Delete all of the above text (including this line), and uncomment the below text to use our standard readme template.
<!-- # Project Name
Project Description
A meeting transcription and summarisation tool that uses 100% local models.
## Live Version
@@ -36,4 +26,4 @@ Copyright held by Naomi Carrigan.
## Contact
We may be contacted through our [Chat Server](http://chat.nhcarrigan.com) or via email at `contact@nhcarrigan.com`. -->
We may be contacted through our [Chat Server](http://chat.nhcarrigan.com) or via email at `contact@nhcarrigan.com`.
Executable
+40
View File
@@ -0,0 +1,40 @@
#!/bin/bash
set -e
echo "🔍 Running all checks..."
echo "========================================"
echo ""
echo "📦 Installing dependencies..."
pnpm install
echo ""
echo "🔎 Running ESLint..."
pnpm lint
echo ""
echo "💅 Running Prettier check..."
pnpm format:check
echo ""
echo "🏗️ Building frontend..."
pnpm build
echo ""
echo "🧪 Running frontend tests..."
pnpm test
echo ""
echo "🦀 Running Clippy..."
cd src-tauri
cargo clippy --all-targets --all-features -- -D warnings
echo ""
echo "🧪 Running Rust tests..."
cargo test
cd ..
echo ""
echo "========================================"
echo "✅ All checks passed!"
+34
View File
@@ -0,0 +1,34 @@
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import prettier from "eslint-config-prettier";
import globals from "globals";
export default tseslint.config(
js.configs.recommended,
...tseslint.configs.recommended,
prettier,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
},
{
files: ["**/*.{ts,tsx}"],
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
},
},
{
ignores: ["build/", "dist/", "src-tauri/target/", "node_modules/"],
}
);
+14
View File
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tauri + React + Typescript</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
+49
View File
@@ -0,0 +1,49 @@
{
"name": "chronara",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier --write .",
"format:check": "prettier --check .",
"preview": "vite preview",
"tauri": "tauri",
"tauri:dev": "tauri dev",
"build:linux": "tauri build",
"build:windows": "tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc",
"build:all": "pnpm build:linux && pnpm build:windows",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage"
},
"dependencies": {
"@tauri-apps/api": "^2",
"@tauri-apps/plugin-opener": "^2",
"react": "^19.1.0",
"react-dom": "^19.1.0"
},
"devDependencies": {
"@eslint/js": "^9.19.0",
"@tauri-apps/cli": "^2",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"@vitejs/plugin-react": "^4.6.0",
"eslint": "^9.19.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^17.0.0",
"jsdom": "^27.4.0",
"prettier": "^3.8.0",
"typescript": "~5.8.3",
"typescript-eslint": "^8.53.0",
"vite": "^7.0.4",
"vitest": "^4.0.17"
}
}
+2934
View File
File diff suppressed because it is too large Load Diff
+6
View File
@@ -0,0 +1,6 @@
<svg width="206" height="231" viewBox="0 0 206 231" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M143.143 84C143.143 96.1503 133.293 106 121.143 106C108.992 106 99.1426 96.1503 99.1426 84C99.1426 71.8497 108.992 62 121.143 62C133.293 62 143.143 71.8497 143.143 84Z" fill="#FFC131"/>
<ellipse cx="84.1426" cy="147" rx="22" ry="22" transform="rotate(180 84.1426 147)" fill="#24C8DB"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M166.738 154.548C157.86 160.286 148.023 164.269 137.757 166.341C139.858 160.282 141 153.774 141 147C141 144.543 140.85 142.121 140.558 139.743C144.975 138.204 149.215 136.139 153.183 133.575C162.73 127.404 170.292 118.608 174.961 108.244C179.63 97.8797 181.207 86.3876 179.502 75.1487C177.798 63.9098 172.884 53.4021 165.352 44.8883C157.82 36.3744 147.99 30.2165 137.042 27.1546C126.095 24.0926 114.496 24.2568 103.64 27.6274C92.7839 30.998 83.1319 37.4317 75.8437 46.1553C74.9102 47.2727 74.0206 48.4216 73.176 49.5993C61.9292 50.8488 51.0363 54.0318 40.9629 58.9556C44.2417 48.4586 49.5653 38.6591 56.679 30.1442C67.0505 17.7298 80.7861 8.57426 96.2354 3.77762C111.685 -1.01901 128.19 -1.25267 143.769 3.10474C159.348 7.46215 173.337 16.2252 184.056 28.3411C194.775 40.457 201.767 55.4101 204.193 71.404C206.619 87.3978 204.374 103.752 197.73 118.501C191.086 133.25 180.324 145.767 166.738 154.548ZM41.9631 74.275L62.5557 76.8042C63.0459 72.813 63.9401 68.9018 65.2138 65.1274C57.0465 67.0016 49.2088 70.087 41.9631 74.275Z" fill="#FFC131"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.4045 76.4519C47.3493 70.6709 57.2677 66.6712 67.6171 64.6132C65.2774 70.9669 64 77.8343 64 85.0001C64 87.1434 64.1143 89.26 64.3371 91.3442C60.0093 92.8732 55.8533 94.9092 51.9599 97.4256C42.4128 103.596 34.8505 112.392 30.1816 122.756C25.5126 133.12 23.9357 144.612 25.6403 155.851C27.3449 167.09 32.2584 177.598 39.7906 186.112C47.3227 194.626 57.153 200.784 68.1003 203.846C79.0476 206.907 90.6462 206.743 101.502 203.373C112.359 200.002 122.011 193.568 129.299 184.845C130.237 183.722 131.131 182.567 131.979 181.383C143.235 180.114 154.132 176.91 164.205 171.962C160.929 182.49 155.596 192.319 148.464 200.856C138.092 213.27 124.357 222.426 108.907 227.222C93.458 232.019 76.9524 232.253 61.3736 227.895C45.7948 223.538 31.8055 214.775 21.0867 202.659C10.3679 190.543 3.37557 175.59 0.949823 159.596C-1.47592 143.602 0.768139 127.248 7.41237 112.499C14.0566 97.7497 24.8183 85.2327 38.4045 76.4519ZM163.062 156.711L163.062 156.711C162.954 156.773 162.846 156.835 162.738 156.897C162.846 156.835 162.954 156.773 163.062 156.711Z" fill="#24C8DB"/>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

+27
View File
@@ -0,0 +1,27 @@
[project]
name = "chronara"
version = "0.1.0"
description = "Local meeting transcription and summarization app"
requires-python = ">=3.10"
dependencies = [
"fastapi==0.115.6",
"uvicorn==0.34.0",
"whisperx==3.1.6",
"llama-cpp-python==0.3.4",
"pyaudio==0.2.14",
"numpy==1.26.4",
"torch==2.5.1",
"pydantic==2.10.4",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.ruff]
line-length = 100
target-version = "py310"
[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "B", "C90", "D"]
ignore = ["D100", "D101", "D102", "D103", "D104", "D105", "D106", "D107"]
+10
View File
@@ -0,0 +1,10 @@
fastapi==0.115.6
uvicorn==0.134.0
whisperx==3.1.6
llama-cpp-python==0.3.4
pyaudio==0.2.14
numpy==1.26.4
torch==2.5.1
pydantic==2.10.4
python-multipart==0.0.18
websockets==14.1
+128
View File
@@ -0,0 +1,128 @@
"""Build script to create a Windows executable with bundled Python environment.
This script should be run ON WINDOWS, not cross-compiled from Linux.
"""
import shutil
import subprocess
import sys
from pathlib import Path
def main():
"""Create a Windows executable bundle for Chronara."""
project_root = Path(__file__).parent.parent
dist_dir = project_root / "dist-bundle"
print("🔨 Chronara Windows Build Script")
print("=" * 50)
print("\n⚠️ NOTE: This script must be run on Windows!")
print(" Cross-compilation from Linux is not supported.\n")
if sys.platform != "win32":
print("❌ This script must be run on Windows.")
print(" Please run this on a Windows machine or in a Windows VM.")
sys.exit(1)
# Clean previous builds
if dist_dir.exists():
print("Cleaning previous build...")
shutil.rmtree(dist_dir)
dist_dir.mkdir(exist_ok=True)
# Step 1: Create Python bundle using PyInstaller
print("\n📦 Creating Python bundle...")
# Create a temporary spec file for PyInstaller
spec_content = f"""
# -*- mode: python ; coding: utf-8 -*-
a = Analysis(
['{project_root / "src" / "backend" / "main.py"}'],
pathex=['{project_root / "src"}'],
binaries=[],
datas=[
('{project_root / "models" / "*.gguf"}', 'models'),
],
hiddenimports=['uvicorn', 'fastapi', 'whisperx', 'llama_cpp'],
hookspath=[],
hooksconfig={{}},
runtime_hooks=[],
excludes=[],
noarchive=False,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='chronara-backend',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
"""
spec_path = project_root / "chronara-backend.spec"
spec_path.write_text(spec_content)
try:
subprocess.run([
sys.executable,
"-m",
"PyInstaller",
str(spec_path),
"--clean",
"--noconfirm",
"--distpath", str(dist_dir / "backend")
], check=True)
except subprocess.CalledProcessError:
print("⚠️ PyInstaller not found. Installing...")
subprocess.run([sys.executable, "-m", "pip", "install", "pyinstaller"], check=True)
subprocess.run([
sys.executable,
"-m",
"PyInstaller",
str(spec_path),
"--clean",
"--noconfirm",
"--distpath", str(dist_dir / "backend")
], check=True)
# Clean up spec file
spec_path.unlink()
# Step 2: Build Tauri app (creates NSIS installer on Windows)
print("\n🦀 Building Tauri app with NSIS installer...")
subprocess.run(
"pnpm tauri build",
cwd=project_root,
check=True,
shell=True
)
print("\n✅ Build complete!")
print("\nWindows installer (.exe) location:")
print(" src-tauri/target/release/bundle/nsis/Chronara_0.1.0_x64_en-US.exe")
print("\nThis installer includes:")
print(" - Tauri app with React frontend")
print(" - Python backend (bundled)")
print(" - Llama model files")
print(" - All dependencies")
if __name__ == "__main__":
main()
+90
View File
@@ -0,0 +1,90 @@
"""Download required models for Chronara."""
import os
import sys
from pathlib import Path
from urllib.request import urlretrieve
# Model download URLs
MODELS = {
"llama-3.2-1B": {
"url": "https://huggingface.co/bartowski/Llama-3.2-1B-Instruct-GGUF/resolve/main/Llama-3.2-1B-Instruct-Q4_K_M.gguf",
"filename": "llama-3.2-1B-instruct-Q4_K_M.gguf",
"size": "1.2GB",
},
"llama-3.2-3B": {
"url": "https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf",
"filename": "llama-3.2-3B-instruct-Q4_K_M.gguf",
"size": "2.5GB",
},
}
def download_with_progress(url: str, filepath: Path):
"""Download file with progress bar."""
def _progress(block_num, block_size, total_size):
downloaded = block_num * block_size
percent = min(downloaded * 100 / total_size, 100)
progress = int(50 * percent / 100)
sys.stdout.write(
f"\r[{'=' * progress}{' ' * (50 - progress)}] {percent:.1f}%"
)
sys.stdout.flush()
print(f"Downloading {filepath.name}...")
urlretrieve(url, filepath, reporthook=_progress)
print() # New line after progress bar
def main():
"""Download all required models."""
# Get project root
project_root = Path(__file__).parent.parent
models_dir = project_root / "models"
models_dir.mkdir(exist_ok=True)
print("🤖 Chronara Model Downloader")
print("=" * 50)
# Ask which model to download
print("\nWhich Llama model would you like to use?")
print("1. Llama 3.2 1B (1.2GB) - Faster, good for basic summaries")
print("2. Llama 3.2 3B (2.5GB) - Better quality summaries")
print("3. Both models")
choice = input("\nEnter your choice (1/2/3): ").strip()
models_to_download = []
if choice == "1":
models_to_download = ["llama-3.2-1B"]
elif choice == "2":
models_to_download = ["llama-3.2-3B"]
elif choice == "3":
models_to_download = ["llama-3.2-1B", "llama-3.2-3B"]
else:
print("Invalid choice!")
return
# Download selected models
for model_name in models_to_download:
model_info = MODELS[model_name]
filepath = models_dir / model_info["filename"]
if filepath.exists():
print(f"\n{model_name} already downloaded")
continue
print(f"\n📥 Downloading {model_name} ({model_info['size']})...")
try:
download_with_progress(model_info["url"], filepath)
print(f"✓ Downloaded {model_name} successfully!")
except Exception as e:
print(f"✗ Failed to download {model_name}: {e}")
print("\n✨ Model download complete!")
print("\nNote: WhisperX models will be downloaded automatically on first run.")
if __name__ == "__main__":
main()
+24
View File
@@ -0,0 +1,24 @@
"""Start the Chronara backend server."""
import os
import sys
import subprocess
from pathlib import Path
# Add src directory to Python path
src_path = Path(__file__).parent.parent / "src"
sys.path.insert(0, str(src_path))
# Set environment for bundled deployment
os.environ["CHRONARA_BUNDLED"] = "1"
# Start the FastAPI server
subprocess.run([
sys.executable,
"-m",
"uvicorn",
"backend.main:app",
"--host", "127.0.0.1",
"--port", "8000",
"--reload" if os.environ.get("CHRONARA_DEV") else ""
])
+7
View File
@@ -0,0 +1,7 @@
# Generated by Cargo
# will have compiled files and executables
/target/
# Generated by Tauri
# will have schema files for capabilities auto-completion
/gen/schemas
+5198
View File
File diff suppressed because it is too large Load Diff
+34
View File
@@ -0,0 +1,34 @@
[package]
name = "chronara"
version = "0.1.0"
description = "A meeting transcription and summarisation tool using local AI models"
authors = ["Naomi Carrigan <nhcarrigan@gmail.com>"]
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
# The `_lib` suffix may seem redundant but it is necessary
# to make the lib name unique and wouldn't conflict with the bin name.
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
name = "chronara_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2", features = [] }
[dependencies]
tauri = { version = "2", features = [] }
tauri-plugin-opener = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
[target.'cfg(windows)'.dependencies]
windows = { version = "0.62", features = [
"Win32_System_Com",
"Win32_Foundation",
"Win32_Media_Audio",
"Win32_Media_Audio_Endpoints",
"Win32_System_Threading",
] }
+3
View File
@@ -0,0 +1,3 @@
fn main() {
tauri_build::build()
}
+7
View File
@@ -0,0 +1,7 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": ["main"],
"permissions": ["core:default", "opener:default"]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 974 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 903 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

+68
View File
@@ -0,0 +1,68 @@
use std::process::{Child, Command};
use std::sync::Mutex;
use tauri::{Manager, State};
struct PythonBackend {
process: Mutex<Option<Child>>,
}
#[tauri::command]
fn start_backend(backend: State<PythonBackend>) -> Result<String, String> {
let mut process_lock = backend.process.lock().map_err(|e| e.to_string())?;
if process_lock.is_some() {
return Ok("Backend already running".to_string());
}
// Get the resource path for the bundled Python executable
let python_cmd = if cfg!(windows) {
"python"
} else {
"python3"
};
// Start the Python backend
let child = Command::new(python_cmd)
.args(["-m", "uvicorn", "backend.main:app", "--host", "127.0.0.1", "--port", "8000"])
.spawn()
.map_err(|e| format!("Failed to start backend: {}", e))?;
*process_lock = Some(child);
Ok("Backend started successfully".to_string())
}
#[tauri::command]
fn stop_backend(backend: State<PythonBackend>) -> Result<String, String> {
let mut process_lock = backend.process.lock().map_err(|e| e.to_string())?;
if let Some(mut child) = process_lock.take() {
child.kill().map_err(|e| format!("Failed to stop backend: {}", e))?;
Ok("Backend stopped".to_string())
} else {
Ok("Backend not running".to_string())
}
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_opener::init())
.manage(PythonBackend {
process: Mutex::new(None),
})
.invoke_handler(tauri::generate_handler![start_backend, stop_backend])
.on_window_event(|window, event| {
// Stop backend when window closes
if let tauri::WindowEvent::CloseRequested { .. } = event {
if let Some(backend) = window.try_state::<PythonBackend>() {
if let Ok(mut process_lock) = backend.process.lock() {
if let Some(mut child) = process_lock.take() {
let _ = child.kill();
}
}
}
}
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
+6
View File
@@ -0,0 +1,6 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
fn main() {
chronara_lib::run()
}
+45
View File
@@ -0,0 +1,45 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Chronara",
"version": "0.1.0",
"identifier": "com.nhcarrigan.chronara",
"build": {
"beforeDevCommand": "pnpm dev",
"devUrl": "http://localhost:1420",
"beforeBuildCommand": "pnpm build",
"frontendDist": "../dist"
},
"app": {
"windows": [
{
"title": "Chronara - Meeting Transcription",
"width": 1200,
"height": 800,
"minWidth": 800,
"minHeight": 600
}
],
"security": {
"csp": null
}
},
"bundle": {
"active": true,
"targets": ["nsis"],
"publisher": "NHCarrigan",
"copyright": "Copyright © 2026 Naomi Carrigan",
"category": "Productivity",
"shortDescription": "Meeting transcription and summarization tool using local AI models",
"longDescription": "Chronara provides real-time meeting transcription with speaker diarization and AI-powered summaries, all processed locally for maximum privacy.",
"windows": {
"nsis": {}
},
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
}
}
+344
View File
@@ -0,0 +1,344 @@
:root {
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 1.5;
font-weight: 400;
--primary-color: #3b82f6;
--primary-hover: #2563eb;
--secondary-color: #10b981;
--danger-color: #ef4444;
--bg-color: #ffffff;
--surface-color: #f9fafb;
--text-color: #111827;
--text-secondary: #6b7280;
--border-color: #e5e7eb;
--shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
color: var(--text-color);
background-color: var(--bg-color);
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
margin: 0;
min-height: 100vh;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 2rem;
min-height: 100vh;
display: flex;
flex-direction: column;
}
/* Header */
.app-header {
text-align: center;
margin-bottom: 2rem;
}
.app-header h1 {
font-size: 2.5rem;
font-weight: 700;
margin-bottom: 0.5rem;
}
.app-header p {
color: var(--text-secondary);
font-size: 1.125rem;
}
/* Warning Banner */
.warning-banner {
background-color: #fef3c7;
color: #92400e;
padding: 1rem;
border-radius: 0.5rem;
margin-bottom: 2rem;
text-align: center;
}
/* App Content */
.app-content {
flex: 1;
display: flex;
flex-direction: column;
gap: 2rem;
}
/* Controls Section */
.controls-section {
display: flex;
flex-direction: column;
align-items: center;
gap: 1.5rem;
}
/* Audio Recorder */
.audio-recorder {
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
}
.record-button {
font-size: 1.25rem;
padding: 1rem 2rem;
border-radius: 0.75rem;
border: 2px solid transparent;
background-color: var(--primary-color);
color: white;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
box-shadow: var(--shadow);
}
.record-button:hover {
background-color: var(--primary-hover);
transform: translateY(-2px);
box-shadow:
0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.record-button.recording {
background-color: var(--danger-color);
}
.record-button.recording:hover {
background-color: #dc2626;
}
.recording-indicator {
display: flex;
align-items: center;
gap: 0.5rem;
color: var(--danger-color);
font-weight: 500;
}
.pulse {
width: 0.75rem;
height: 0.75rem;
background-color: var(--danger-color);
border-radius: 50%;
animation: pulse 1.5s infinite;
}
@keyframes pulse {
0% {
opacity: 1;
transform: scale(1);
}
50% {
opacity: 0.5;
transform: scale(1.2);
}
100% {
opacity: 1;
transform: scale(1);
}
}
/* Action Buttons */
.action-buttons {
display: flex;
gap: 1rem;
}
.primary-button,
.secondary-button {
padding: 0.75rem 1.5rem;
border-radius: 0.5rem;
border: none;
font-size: 1rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
box-shadow: var(--shadow);
}
.primary-button {
background-color: var(--secondary-color);
color: white;
}
.primary-button:hover:not(:disabled) {
background-color: #059669;
transform: translateY(-1px);
}
.primary-button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.secondary-button {
background-color: var(--surface-color);
color: var(--text-color);
border: 1px solid var(--border-color);
}
.secondary-button:hover {
background-color: var(--border-color);
}
/* Content Grid */
.content-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2rem;
flex: 1;
}
@media (max-width: 768px) {
.content-grid {
grid-template-columns: 1fr;
}
}
/* Transcript Display */
.transcript-display,
.summary-display {
background-color: var(--surface-color);
border: 1px solid var(--border-color);
border-radius: 0.75rem;
padding: 1.5rem;
display: flex;
flex-direction: column;
max-height: 600px;
}
.transcript-display h2,
.summary-display h2 {
font-size: 1.25rem;
font-weight: 600;
margin-bottom: 1rem;
}
.transcript-segments,
.summary-content {
flex: 1;
overflow-y: auto;
}
.empty-state {
color: var(--text-secondary);
text-align: center;
padding: 2rem;
}
.segment {
margin-bottom: 1rem;
padding-bottom: 1rem;
border-bottom: 1px solid var(--border-color);
}
.segment:last-child {
border-bottom: none;
}
.segment-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.5rem;
}
.speaker {
font-weight: 600;
font-size: 0.875rem;
}
.timestamp {
font-size: 0.75rem;
color: var(--text-secondary);
}
.segment-text {
line-height: 1.6;
}
/* Summary Display */
.summary-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
}
.download-button {
padding: 0.5rem 1rem;
border-radius: 0.375rem;
border: 1px solid var(--border-color);
background-color: var(--bg-color);
font-size: 0.875rem;
cursor: pointer;
transition: all 0.2s;
}
.download-button:hover {
background-color: var(--surface-color);
}
.summary-text {
white-space: pre-wrap;
line-height: 1.6;
}
/* Loading */
.loading {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 3rem;
gap: 1rem;
}
.spinner {
width: 3rem;
height: 3rem;
border: 3px solid var(--border-color);
border-top-color: var(--primary-color);
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
/* Dark Mode */
@media (prefers-color-scheme: dark) {
:root {
--bg-color: #111827;
--surface-color: #1f2937;
--text-color: #f3f4f6;
--text-secondary: #9ca3af;
--border-color: #374151;
--shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}
.warning-banner {
background-color: #451a03;
color: #fbbf24;
}
}
+189
View File
@@ -0,0 +1,189 @@
import { useState, useEffect, useRef } from "react";
import { invoke } from "@tauri-apps/api/core";
import "./App.css";
import { AudioRecorder } from "./components/AudioRecorder";
import { TranscriptDisplay } from "./components/TranscriptDisplay";
import { SummaryDisplay } from "./components/SummaryDisplay";
interface TranscriptSegment {
start: number;
end: number;
text: string;
speaker: string;
}
function App() {
const [isRecording, setIsRecording] = useState(false);
const [transcriptSegments, setTranscriptSegments] = useState<TranscriptSegment[]>([]);
const [summary, setSummary] = useState<string | null>(null);
const [isGeneratingSummary, setIsGeneratingSummary] = useState(false);
const [backendReady, setBackendReady] = useState(false);
const wsRef = useRef<WebSocket | null>(null);
useEffect(() => {
// Start Python backend through Tauri
startPythonBackend();
}, []);
const startPythonBackend = async () => {
try {
// Start backend through Tauri command
await invoke("start_backend");
// Give backend time to start up
setTimeout(() => {
checkBackendHealth();
}, 2000);
} catch (error) {
console.error("Failed to start backend:", error);
}
};
const checkBackendHealth = async () => {
try {
const response = await fetch("http://localhost:8000/health");
if (response.ok) {
setBackendReady(true);
}
} catch (error) {
console.error("Backend not ready:", error);
// In production, Tauri will start the backend automatically
}
};
const handleAudioData = (audioData: ArrayBuffer) => {
if (!wsRef.current || wsRef.current.readyState !== WebSocket.OPEN) {
// Create WebSocket connection
wsRef.current = new WebSocket("ws://localhost:8000/ws/transcribe");
wsRef.current.onopen = () => {
console.log("WebSocket connected");
// Send the audio data
wsRef.current?.send(audioData);
};
wsRef.current.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === "transcription" && data.data.segments) {
setTranscriptSegments((prev) => [...prev, ...data.data.segments]);
}
};
wsRef.current.onclose = () => {
console.log("WebSocket disconnected");
};
} else {
// Send audio data through existing connection
wsRef.current.send(audioData);
}
};
const generateSummary = async () => {
if (transcriptSegments.length === 0) return;
setIsGeneratingSummary(true);
// Combine all transcript segments into text
const fullTranscript = transcriptSegments
.map((seg) => `${seg.speaker}: ${seg.text}`)
.join("\n");
try {
const response = await fetch("http://localhost:8000/summarize", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ transcript: fullTranscript }),
});
const data = await response.json();
setSummary(data.summary);
} catch (error) {
console.error("Failed to generate summary:", error);
} finally {
setIsGeneratingSummary(false);
}
};
const downloadTranscript = () => {
const content = transcriptSegments
.map((seg) => `[${formatTime(seg.start)}] ${seg.speaker}: ${seg.text}`)
.join("\n");
const blob = new Blob([content], { type: "text/plain" });
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = `meeting-transcript-${new Date().toISOString().split("T")[0]}.txt`;
a.click();
URL.revokeObjectURL(url);
};
const downloadSummary = () => {
if (!summary) return;
const blob = new Blob([summary], { type: "text/plain" });
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = `meeting-summary-${new Date().toISOString().split("T")[0]}.txt`;
a.click();
URL.revokeObjectURL(url);
};
const formatTime = (seconds: number) => {
const mins = Math.floor(seconds / 60);
const secs = Math.floor(seconds % 60);
return `${mins}:${secs.toString().padStart(2, "0")}`;
};
return (
<main className="container">
<header className="app-header">
<h1>🎙 Chronara</h1>
<p>Local Meeting Transcription & Summarization</p>
</header>
{!backendReady && (
<div className="warning-banner"> Backend is starting up. This may take a moment...</div>
)}
<div className="app-content">
<section className="controls-section">
<AudioRecorder
onAudioData={handleAudioData}
isRecording={isRecording}
setIsRecording={setIsRecording}
/>
{!isRecording && transcriptSegments.length > 0 && (
<div className="action-buttons">
<button className="secondary-button" onClick={downloadTranscript}>
📄 Download Transcript
</button>
<button
className="primary-button"
onClick={generateSummary}
disabled={isGeneratingSummary}
>
Generate Summary
</button>
</div>
)}
</section>
<div className="content-grid">
<TranscriptDisplay segments={transcriptSegments} />
<SummaryDisplay
summary={summary}
isLoading={isGeneratingSummary}
onDownload={downloadSummary}
/>
</div>
</div>
</main>
);
}
export default App;
+7
View File
@@ -0,0 +1,7 @@
import { describe, it, expect } from "vitest";
describe("App", () => {
it("placeholder test", () => {
expect(true).toBe(true);
});
});
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

+1
View File
@@ -0,0 +1 @@
"""Chronara backend - Local meeting transcription and summarization."""
+74
View File
@@ -0,0 +1,74 @@
"""Main FastAPI application for Chronara."""
import os
from pathlib import Path
from fastapi import FastAPI, WebSocket
from fastapi.middleware.cors import CORSMiddleware
from .models.audio import AudioProcessor
from .models.llm import LlamaSummarizer
from .models.transcriber import WhisperXTranscriber
app = FastAPI(title="Chronara API", version="0.1.0")
# Enable CORS for Tauri frontend
app.add_middleware(
CORSMiddleware,
allow_origins=["tauri://localhost", "http://localhost:*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# Initialize models
MODEL_DIR = Path(__file__).parent.parent.parent / "models"
transcriber = WhisperXTranscriber(model_dir=MODEL_DIR)
summarizer = LlamaSummarizer(model_dir=MODEL_DIR)
audio_processor = AudioProcessor()
@app.get("/health")
async def health_check():
"""Check if the API is running and models are loaded."""
return {
"status": "healthy",
"models": {
"whisper": transcriber.is_loaded,
"llama": summarizer.is_loaded,
},
}
@app.websocket("/ws/transcribe")
async def transcribe_audio(websocket: WebSocket):
"""WebSocket endpoint for real-time audio transcription."""
await websocket.accept()
try:
while True:
# Receive audio chunk
audio_data = await websocket.receive_bytes()
# Process audio
audio_chunk = audio_processor.process_chunk(audio_data)
# Transcribe if we have enough audio
if audio_processor.has_speech(audio_chunk):
result = await transcriber.transcribe_chunk(audio_chunk)
if result:
await websocket.send_json({
"type": "transcription",
"data": result,
})
except Exception as e:
await websocket.close(code=1000, reason=str(e))
@app.post("/summarize")
async def summarize_transcript(transcript: str):
"""Summarize a meeting transcript."""
summary = await summarizer.summarize(transcript)
return {"summary": summary}
+1
View File
@@ -0,0 +1 @@
"""Model modules for Chronara."""
+73
View File
@@ -0,0 +1,73 @@
"""Audio processing utilities."""
import io
import wave
from typing import Optional
import numpy as np
import pyaudio
class AudioProcessor:
"""Handles audio capture and processing."""
def __init__(self, sample_rate: int = 16000, channels: int = 1):
"""Initialize audio processor."""
self.sample_rate = sample_rate
self.channels = channels
self.chunk_size = 1024
self.format = pyaudio.paInt16
# Initialize PyAudio
self.audio = pyaudio.PyAudio()
# Audio buffer for accumulating chunks
self.buffer = []
self.min_speech_duration = 0.5 # seconds
def start_recording(self) -> pyaudio.Stream:
"""Start audio recording stream."""
stream = self.audio.open(
format=self.format,
channels=self.channels,
rate=self.sample_rate,
input=True,
frames_per_buffer=self.chunk_size,
)
return stream
def stop_recording(self, stream: pyaudio.Stream) -> None:
"""Stop audio recording."""
stream.stop_stream()
stream.close()
def process_chunk(self, audio_bytes: bytes) -> np.ndarray:
"""Convert audio bytes to numpy array."""
# Convert bytes to numpy array
audio_array = np.frombuffer(audio_bytes, dtype=np.int16)
# Normalize to [-1, 1]
audio_float = audio_array.astype(np.float32) / 32768.0
return audio_float
def has_speech(self, audio_chunk: np.ndarray, energy_threshold: float = 0.01) -> bool:
"""Simple voice activity detection based on energy."""
# Calculate RMS energy
energy = np.sqrt(np.mean(audio_chunk**2))
# Check if energy exceeds threshold
return energy > energy_threshold
def save_audio(self, audio_data: bytes, filepath: str) -> None:
"""Save audio data to WAV file."""
with wave.open(filepath, "wb") as wf:
wf.setnchannels(self.channels)
wf.setsampwidth(self.audio.get_sample_size(self.format))
wf.setframerate(self.sample_rate)
wf.writeframes(audio_data)
def __del__(self):
"""Cleanup PyAudio."""
if hasattr(self, "audio"):
self.audio.terminate()
+67
View File
@@ -0,0 +1,67 @@
"""Local LLM for meeting summarization using Llama."""
from pathlib import Path
from typing import Optional
from llama_cpp import Llama
class LlamaSummarizer:
"""Handles meeting summarization using local Llama model."""
def __init__(self, model_dir: Path, model_size: str = "1B"):
"""Initialize Llama model."""
self.model_dir = model_dir
self.is_loaded = False
model_path = model_dir / f"llama-3.2-{model_size}-instruct-Q4_K_M.gguf"
try:
self.llm = Llama(
model_path=str(model_path),
n_ctx=8192, # Context window
n_threads=4, # CPU threads
n_gpu_layers=-1, # Use GPU if available
verbose=False,
)
self.is_loaded = True
except Exception as e:
print(f"Failed to load Llama model: {e}")
self.is_loaded = False
async def summarize(self, transcript: str) -> Optional[str]:
"""Generate a meeting summary from transcript."""
if not self.is_loaded:
return None
prompt = f"""<|begin_of_text|><|start_header_id|>system<|end_header_id|>
You are a helpful assistant that creates concise meeting summaries. Focus on:
- Key decisions made
- Action items and who owns them
- Important discussions and their outcomes
- Next steps
Keep the summary structured and easy to scan.<|eot_id|><|start_header_id|>user<|end_header_id|>
Please summarize this meeting transcript:
{transcript}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
Meeting Summary:
"""
try:
response = self.llm(
prompt,
max_tokens=1024,
temperature=0.7,
top_p=0.9,
stop=["<|eot_id|>", "<|end_of_text|>"],
)
return response["choices"][0]["text"].strip()
except Exception as e:
print(f"Summarization error: {e}")
return None
+88
View File
@@ -0,0 +1,88 @@
"""WhisperX transcription with speaker diarization."""
import json
from pathlib import Path
from typing import Any, Optional
import numpy as np
import torch
import whisperx
class WhisperXTranscriber:
"""Handles audio transcription and speaker diarization using WhisperX."""
def __init__(self, model_dir: Path, model_size: str = "base"):
"""Initialize WhisperX with local models."""
self.model_dir = model_dir
self.device = "cuda" if torch.cuda.is_available() else "cpu"
self.compute_type = "float16" if self.device == "cuda" else "int8"
self.is_loaded = False
try:
# Load ASR model
self.model = whisperx.load_model(
model_size,
self.device,
compute_type=self.compute_type,
download_root=str(model_dir / "whisper"),
)
# Load alignment model
self.align_model, self.align_metadata = whisperx.load_align_model(
language_code="en",
device=self.device,
model_dir=str(model_dir / "alignment"),
)
# Load diarization pipeline
self.diarize_model = whisperx.DiarizationPipeline(
device=self.device,
model_name=str(model_dir / "diarization"),
)
self.is_loaded = True
except Exception as e:
print(f"Failed to load WhisperX models: {e}")
self.is_loaded = False
async def transcribe_chunk(self, audio_chunk: np.ndarray) -> Optional[dict[str, Any]]:
"""Transcribe an audio chunk with speaker diarization."""
if not self.is_loaded:
return None
try:
# Transcribe
result = self.model.transcribe(
audio_chunk,
batch_size=16,
)
# Align whisper output
result = whisperx.align(
result["segments"],
self.align_model,
self.align_metadata,
audio_chunk,
self.device,
)
# Diarize
diarize_segments = self.diarize_model(audio_chunk)
result = whisperx.assign_word_speakers(diarize_segments, result)
# Format output
formatted_result = []
for segment in result["segments"]:
formatted_result.append({
"start": segment["start"],
"end": segment["end"],
"text": segment["text"],
"speaker": segment.get("speaker", "Unknown"),
})
return {"segments": formatted_result}
except Exception as e:
print(f"Transcription error: {e}")
return None
+83
View File
@@ -0,0 +1,83 @@
import { useRef, useEffect } from "react";
interface AudioRecorderProps {
onAudioData: (data: ArrayBuffer) => void;
isRecording: boolean;
setIsRecording: (recording: boolean) => void;
}
export function AudioRecorder({ onAudioData, isRecording, setIsRecording }: AudioRecorderProps) {
const mediaRecorderRef = useRef<MediaRecorder | null>(null);
const streamRef = useRef<MediaStream | null>(null);
useEffect(() => {
return () => {
// Cleanup on unmount
if (streamRef.current) {
streamRef.current.getTracks().forEach((track) => track.stop());
}
};
}, []);
const startRecording = async () => {
try {
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
streamRef.current = stream;
const mediaRecorder = new MediaRecorder(stream, {
mimeType: "audio/webm",
});
mediaRecorderRef.current = mediaRecorder;
const chunks: Blob[] = [];
mediaRecorder.ondataavailable = (event) => {
if (event.data.size > 0) {
chunks.push(event.data);
}
};
mediaRecorder.onstop = async () => {
const blob = new Blob(chunks, { type: "audio/webm" });
const arrayBuffer = await blob.arrayBuffer();
onAudioData(arrayBuffer);
chunks.length = 0;
};
// Send data every second for real-time processing
mediaRecorder.start(1000);
setIsRecording(true);
} catch (error) {
console.error("Error starting recording:", error);
alert("Failed to access microphone");
}
};
const stopRecording = () => {
if (mediaRecorderRef.current && isRecording) {
mediaRecorderRef.current.stop();
setIsRecording(false);
if (streamRef.current) {
streamRef.current.getTracks().forEach((track) => track.stop());
}
}
};
return (
<div className="audio-recorder">
<button
className={`record-button ${isRecording ? "recording" : ""}`}
onClick={isRecording ? stopRecording : startRecording}
>
{isRecording ? "⏹ Stop Recording" : "🎙️ Start Recording"}
</button>
{isRecording && (
<div className="recording-indicator">
<span className="pulse"></span> Recording...
</div>
)}
</div>
);
}
+32
View File
@@ -0,0 +1,32 @@
interface SummaryDisplayProps {
summary: string | null;
isLoading: boolean;
onDownload: () => void;
}
export function SummaryDisplay({ summary, isLoading, onDownload }: SummaryDisplayProps) {
return (
<div className="summary-display">
<div className="summary-header">
<h2>Meeting Summary</h2>
{summary && (
<button className="download-button" onClick={onDownload}>
📥 Download
</button>
)}
</div>
<div className="summary-content">
{isLoading ? (
<div className="loading">
<div className="spinner"></div>
<p>Generating summary...</p>
</div>
) : summary ? (
<div className="summary-text">{summary}</div>
) : (
<p className="empty-state">Summary will appear here after recording is complete.</p>
)}
</div>
</div>
);
}
+57
View File
@@ -0,0 +1,57 @@
interface TranscriptSegment {
start: number;
end: number;
text: string;
speaker: string;
}
interface TranscriptDisplayProps {
segments: TranscriptSegment[];
}
export function TranscriptDisplay({ segments }: TranscriptDisplayProps) {
const formatTime = (seconds: number) => {
const mins = Math.floor(seconds / 60);
const secs = Math.floor(seconds % 60);
return `${mins}:${secs.toString().padStart(2, "0")}`;
};
const getSpeakerColor = (speaker: string) => {
const colors = [
"#3b82f6", // blue
"#10b981", // green
"#f59e0b", // amber
"#ef4444", // red
"#8b5cf6", // purple
"#14b8a6", // teal
];
const speakerParts = speaker.split("_");
const index = speakerParts[1] ? parseInt(speakerParts[1], 10) % colors.length : 0;
return colors[index];
};
return (
<div className="transcript-display">
<h2>Transcript</h2>
<div className="transcript-segments">
{segments.length === 0 ? (
<p className="empty-state">No transcript yet. Start recording to begin.</p>
) : (
segments.map((segment, index) => (
<div key={index} className="segment">
<div className="segment-header">
<span className="speaker" style={{ color: getSpeakerColor(segment.speaker) }}>
{segment.speaker}
</span>
<span className="timestamp">
{formatTime(segment.start)} - {formatTime(segment.end)}
</span>
</div>
<p className="segment-text">{segment.text}</p>
</div>
))
)}
</div>
</div>
);
}
+9
View File
@@ -0,0 +1,9 @@
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
<App />
</React.StrictMode>
);
+1
View File
@@ -0,0 +1 @@
/// <reference types="vite/client" />
+21
View File
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}
+10
View File
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}
+32
View File
@@ -0,0 +1,32 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// @ts-expect-error process is a nodejs global
const host = process.env.TAURI_DEV_HOST;
// https://vite.dev/config/
export default defineConfig(async () => ({
plugins: [react()],
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
//
// 1. prevent Vite from obscuring rust errors
clearScreen: false,
// 2. tauri expects a fixed port, fail if that port is not available
server: {
port: 1420,
strictPort: true,
host: host || false,
hmr: host
? {
protocol: "ws",
host,
port: 1421,
}
: undefined,
watch: {
// 3. tell Vite to ignore watching `src-tauri`
ignored: ["**/src-tauri/**"],
},
},
}));
+12
View File
@@ -0,0 +1,12 @@
import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()],
test: {
include: ["src/**/*.{test,spec}.{js,ts,tsx}"],
environment: "jsdom",
setupFiles: ["./vitest.setup.ts"],
globals: true,
},
});
+1
View File
@@ -0,0 +1 @@
import "@testing-library/jest-dom/vitest";