Phase 1 foundation: Tauri shell, Python sidecar, SQLite database

Tauri v2 + Svelte + TypeScript frontend:
- App shell with workspace layout (waveform, transcript, speakers, AI chat)
- Placeholder components for all major UI areas
- Typed stores (project, transcript, playback, AI)
- TypeScript interfaces matching the database schema
- Tauri bridge service with typed invoke wrappers
- svelte-check passes with 0 errors

Rust backend:
- Tauri v2 app entry point with command registration
- SQLite database layer (rusqlite with bundled SQLite)
  - Full schema: projects, media_files, speakers, segments, words,
    ai_outputs, annotations (with indexes)
  - Model structs with serde serialization
  - CRUD queries for projects, speakers, segments, words
  - Segment text editing preserves original text
  - Schema versioning for future migrations
  - 6 tests passing
- Command stubs for project, transcribe, export, AI, settings, system
- App state management

Python sidecar:
- JSON-line IPC protocol (stdin/stdout)
- Message types: IPCMessage, progress, error, ready
- Handler registry with routing and error handling
- Ping/pong handler for connectivity testing
- Service stubs: transcribe, diarize, pipeline, AI, export
- Provider stubs: local (llama-server), OpenAI, Anthropic, LiteLLM
- Hardware detection stubs
- 14 tests passing, ruff clean

Also adds:
- Testing strategy document (docs/TESTING.md)
- Validation script (scripts/validate.sh)
- Updated .gitignore for Svelte, Rust, Python artifacts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 15:16:06 -08:00
parent c450ef3c0c
commit 503cc6c0cf
95 changed files with 9607 additions and 0 deletions

13
src/app.html Normal file
View File

@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Voice to Notes</title>
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>

View File

@@ -0,0 +1,18 @@
<div class="ai-chat-panel">
<h3>AI Chat</h3>
<p class="placeholder">Ask questions about the transcript, generate summaries</p>
</div>
<style>
.ai-chat-panel {
padding: 1rem;
background: #16213e;
border-radius: 8px;
color: #e0e0e0;
}
h3 { margin: 0 0 0.5rem; }
.placeholder {
color: #666;
font-size: 0.875rem;
}
</style>

View File

@@ -0,0 +1,18 @@
<div class="export-panel">
<h3>Export</h3>
<p class="placeholder">SRT, WebVTT, ASS, plain text, Markdown export options</p>
</div>
<style>
.export-panel {
padding: 1rem;
background: #16213e;
border-radius: 8px;
color: #e0e0e0;
}
h3 { margin: 0 0 0.5rem; }
.placeholder {
color: #666;
font-size: 0.875rem;
}
</style>

View File

@@ -0,0 +1,58 @@
<script lang="ts">
interface Props {
visible?: boolean;
percent?: number;
stage?: string;
message?: string;
}
let { visible = false, percent = 0, stage = '', message = '' }: Props = $props();
</script>
{#if visible}
<div class="overlay">
<div class="progress-card">
<h3>{stage}</h3>
<div class="bar-track">
<div class="bar-fill" style="width: {percent}%"></div>
</div>
<p>{percent}% — {message}</p>
</div>
</div>
{/if}
<style>
.overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.7);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.progress-card {
background: #16213e;
padding: 2rem;
border-radius: 12px;
min-width: 400px;
color: #e0e0e0;
}
h3 { margin: 0 0 1rem; text-transform: capitalize; }
.bar-track {
height: 8px;
background: #0f3460;
border-radius: 4px;
overflow: hidden;
}
.bar-fill {
height: 100%;
background: #e94560;
transition: width 0.3s;
}
p {
margin: 0.5rem 0 0;
font-size: 0.875rem;
color: #999;
}
</style>

View File

@@ -0,0 +1,16 @@
<div class="project-list">
<h3>Projects</h3>
<p class="placeholder">Create, open, and manage projects</p>
</div>
<style>
.project-list {
padding: 1rem;
color: #e0e0e0;
}
h3 { margin: 0 0 0.5rem; }
.placeholder {
color: #666;
font-size: 0.875rem;
}
</style>

View File

@@ -0,0 +1,18 @@
<div class="settings-panel">
<h3>Settings</h3>
<p class="placeholder">Model selection, AI provider config, preferences</p>
</div>
<style>
.settings-panel {
padding: 1rem;
background: #16213e;
border-radius: 8px;
color: #e0e0e0;
}
h3 { margin: 0 0 0.5rem; }
.placeholder {
color: #666;
font-size: 0.875rem;
}
</style>

View File

@@ -0,0 +1,18 @@
<div class="speaker-manager">
<h3>Speakers</h3>
<p class="placeholder">Speaker list with rename/color controls</p>
</div>
<style>
.speaker-manager {
padding: 1rem;
background: #16213e;
border-radius: 8px;
color: #e0e0e0;
}
h3 { margin: 0 0 0.5rem; }
.placeholder {
color: #666;
font-size: 0.875rem;
}
</style>

View File

@@ -0,0 +1,18 @@
<div class="transcript-editor">
<p>Transcript Editor</p>
<p class="placeholder">TipTap rich text editor will be integrated here</p>
</div>
<style>
.transcript-editor {
padding: 1rem;
background: #16213e;
border-radius: 8px;
color: #e0e0e0;
flex: 1;
}
.placeholder {
color: #666;
font-size: 0.875rem;
}
</style>

View File

@@ -0,0 +1,17 @@
<div class="waveform-player">
<p>Waveform Player</p>
<p class="placeholder">wavesurfer.js will be integrated here</p>
</div>
<style>
.waveform-player {
padding: 1rem;
background: #1a1a2e;
border-radius: 8px;
color: #e0e0e0;
}
.placeholder {
color: #666;
font-size: 0.875rem;
}
</style>

View File

@@ -0,0 +1,14 @@
import { invoke } from '@tauri-apps/api/core';
import type { Project } from '$lib/types/project';
export async function createProject(name: string): Promise<Project> {
return invoke('create_project', { name });
}
export async function getProject(id: string): Promise<Project | null> {
return invoke('get_project', { id });
}
export async function listProjects(): Promise<Project[]> {
return invoke('list_projects');
}

17
src/lib/stores/ai.ts Normal file
View File

@@ -0,0 +1,17 @@
import { writable } from 'svelte/store';
export interface AIConfig {
default_provider: string;
providers: Record<string, { model: string; [key: string]: unknown }>;
}
export interface ChatMessage {
role: 'user' | 'assistant';
content: string;
}
export const aiConfig = writable<AIConfig>({
default_provider: 'local',
providers: {},
});
export const chatHistory = writable<ChatMessage[]>([]);

View File

@@ -0,0 +1,5 @@
import { writable } from 'svelte/store';
export const isPlaying = writable(false);
export const currentTimeMs = writable(0);
export const durationMs = writable(0);

View File

@@ -0,0 +1,5 @@
import { writable } from 'svelte/store';
import type { Project } from '$lib/types/project';
export const currentProject = writable<Project | null>(null);
export const projects = writable<Project[]>([]);

View File

@@ -0,0 +1,5 @@
import { writable } from 'svelte/store';
import type { Segment, Speaker } from '$lib/types/transcript';
export const segments = writable<Segment[]>([]);
export const speakers = writable<Speaker[]>([]);

16
src/lib/types/ipc.ts Normal file
View File

@@ -0,0 +1,16 @@
export interface IPCMessage {
id: string;
type: string;
payload: Record<string, unknown>;
}
export interface ProgressPayload {
percent: number;
stage: string;
message: string;
}
export interface ErrorPayload {
code: string;
message: string;
}

21
src/lib/types/project.ts Normal file
View File

@@ -0,0 +1,21 @@
export interface Project {
id: string;
name: string;
created_at: string;
updated_at: string;
settings: string | null;
status: string;
}
export interface MediaFile {
id: string;
project_id: string;
file_path: string;
file_hash: string | null;
duration_ms: number | null;
sample_rate: number | null;
channels: number | null;
format: string | null;
file_size: number | null;
created_at: string;
}

View File

@@ -0,0 +1,33 @@
export interface Word {
id: string;
segment_id: string;
word: string;
start_ms: number;
end_ms: number;
confidence: number | null;
word_index: number;
}
export interface Segment {
id: string;
project_id: string;
media_file_id: string;
speaker_id: string | null;
start_ms: number;
end_ms: number;
text: string;
original_text: string | null;
confidence: number | null;
is_edited: boolean;
edited_at: string | null;
segment_index: number;
words: Word[];
}
export interface Speaker {
id: string;
project_id: string;
label: string;
display_name: string | null;
color: string | null;
}

5
src/routes/+layout.ts Normal file
View File

@@ -0,0 +1,5 @@
// Tauri doesn't have a Node.js server to do proper SSR
// so we use adapter-static with a fallback to index.html to put the site in SPA mode
// See: https://svelte.dev/docs/kit/single-page-apps
// See: https://v2.tauri.app/start/frontend/sveltekit/ for more info
export const ssr = false;

38
src/routes/+page.svelte Normal file
View File

@@ -0,0 +1,38 @@
<script lang="ts">
import WaveformPlayer from '$lib/components/WaveformPlayer.svelte';
import TranscriptEditor from '$lib/components/TranscriptEditor.svelte';
import SpeakerManager from '$lib/components/SpeakerManager.svelte';
import AIChatPanel from '$lib/components/AIChatPanel.svelte';
</script>
<div class="workspace">
<div class="main-content">
<WaveformPlayer />
<TranscriptEditor />
</div>
<div class="sidebar-right">
<SpeakerManager />
<AIChatPanel />
</div>
</div>
<style>
.workspace {
display: flex;
gap: 1rem;
padding: 1rem;
height: calc(100vh - 3rem);
}
.main-content {
flex: 1;
display: flex;
flex-direction: column;
gap: 1rem;
}
.sidebar-right {
width: 300px;
display: flex;
flex-direction: column;
gap: 1rem;
}
</style>