How carthadash/jarvis works
Purpose and entry points
This is a Tauri desktop knowledge-graph application with a React/Vite frontend, a Rust native backend, SQLite schema migrations, and a separate Node.js MCP server for programmatic graph access.
Frontend bootstraps at src/main.tsx and renders the application in src/App.tsx. Native startup is in src-tauri/src/main.rs and src-tauri/src/lib.rs. The MCP process starts from mcp-server/index.js.
Frontend application shell
The React UI is organized around graph navigation, node editing, inbox processing, ingestion, and settings. Core screen composition and global interaction likely originate in:
• src/App.tsx
• src/components/Sidebar.tsx
• src/components/TopBar.tsx
The UI boundary is the browser/webview layer; it delegates persistent operations to the native Tauri backend through database-oriented hooks such as src/hooks/useDatabase.ts.
Graph visualization and interaction
Graph exploration is a primary feature, represented by dedicated graph, canvas, filtering, and local-context components:
• src/components/Graph.tsx
• src/components/GraphCanvas.tsx
• src/components/MiniGraph.tsx
Graph behavior is separated from rendering through src/hooks/useGraph.ts, while force-layout mechanics and shared graph parameters reside in src/lib/forceSim.ts and src/lib/graphConstants.ts. This establishes a flow from persisted nodes/connections → graph hook/layout → interactive canvas and filters.
Node lifecycle and knowledge capture
Nodes appear to support creation, editing, tags, connections, history, search, and fast capture. The main editing and capture boundary is represented by:
• src/components/NodeEditor.tsx
• src/components/QuickAdd.tsx
• src/components/ProcessInbox.tsx
src/components/IngestWizard.tsx provides a more structured ingestion path, while src/components/NodeHistory.tsx exposes revision/history data. Rich-text features are implemented with Tiptap extensions under src/lib/tiptapExtensions, including node mentions and pasted images.
Native backend and persistence
Rust implements the authoritative application backend: Tauri commands, configuration, domain models, persistence, markdown processing, image handling, and index output:
• src-tauri/src/commands.rs
• src-tauri/src/db.rs
• src-tauri/src/models.rs
The persistent schema evolves through SQLite migrations in src-tauri/migrations/0001_init.sql through src-tauri/migrations/0005_node_history.sql. Schema stages explicitly cover initial data, tags, a v2 schema, daily logs, and node history. Backend error handling, configuration, and generated index writing are isolated in src-tauri/src/error.rs, src-tauri/src/config.rs, and src-tauri/src/index_writer.rs.
MCP integration boundary
mcp-server/ is an independent Node.js service exposing graph/database capabilities as tools for an MCP client or agent. Its database adapter is mcp-server/db.js; tool registration/orchestration is mcp-server/index.js.
The tool surface maps directly to core knowledge-graph operations: node CRUD (mcp-server/tools/createNode.js, mcp-server/tools/updateNode.js), relationship mutation (mcp-server/tools/addConnection.js, mcp-server/tools/removeConnection.js), retrieval/search (mcp-server/tools/searchNodes.js, mcp-server/tools/getBacklinks.js), and activity logging (mcp-server/tools/appendLog.js, mcp-server/tools/sessionLog.js). HTML content can be normalized through mcp-server/lib/htmlToMarkdown.js.
Runtime and infrastructure boundaries
The frontend runs as a Vite-built TypeScript/React webview; the desktop host is Tauri/Rust, configured by src-tauri/tauri.conf.json with permissions in src-tauri/capabilities/default.json. Native storage is migration-managed SQLite. The MCP server is a separate Node.js runtime with its own mcp-server/package.json, forming an automation/API boundary rather than part of the desktop UI process.
Main entry points: App.tsx Application shell · commands.rs Tauri commands · createNode.js Graph operation tools · useDatabase.ts Database bridge
Components 17
React Webview
Vite-built desktop UI.
- Frontend bootstrap
src/main.tsx - Application shell · Composes navigation and global application interactions.
src/App.tsx - Navigation chrome · Sidebar and top-bar navigation.
src/components/Sidebar.tsx - Graph explorer · Interactive graph canvas and local graph views.
src/components/Graph.tsx - Graph behavior & layout · Separates graph state and force layout from rendering.
src/hooks/useGraph.ts - Capture & node lifecycle · Editing, quick capture, inbox processing, and ingestion.
src/components/NodeEditor.tsx - Database bridge · Webview boundary for persistent operations.
src/hooks/useDatabase.ts
Tauri Native Backend
Authoritative desktop application backend.
- Native startup · Launches the Tauri desktop host.
src-tauri/src/main.rs - Tauri commands · Native operations exposed to the webview.
src-tauri/src/commands.rs - Domain & content services · Models, markdown, images, configuration, and index output.
src-tauri/src/models.rs - SQLite persistence · Authoritative reads and writes for graph data.
src-tauri/src/db.rs
SQLite Storage
Migration-managed knowledge graph data.
- Schema migrations · Initial schema through tags, v2, daily logs, and node history.
src-tauri/migrations/0001_init.sql - Knowledge graph database · Nodes, relationships, tags, logs, and history.
MCP Server
Independent Node.js automation boundary.
- MCP tool server · Registers graph operations for MCP clients and agents.
mcp-server/index.js - Graph operation tools · CRUD, connections, search, backlinks, and activity logging.
mcp-server/tools/createNode.js - Database adapter · Connects MCP tools to the shared graph database.
mcp-server/db.js - HTML normalization · Converts HTML content to Markdown.
mcp-server/lib/htmlToMarkdown.js
Connections 17
- Frontend bootstrap → Application shell: renders
- Application shell → Navigation chrome: composes
- Application shell → Graph explorer: hosts
- Application shell → Capture & node lifecycle: hosts
- Graph explorer → Graph behavior & layout: uses
- Graph behavior & layout → Database bridge: loads graph data
- Capture & node lifecycle → Database bridge: persists changes
- Database bridge → Tauri commands: invokes
- Native startup → Tauri commands: hosts
- Tauri commands → Domain & content services: uses
- Tauri commands → SQLite persistence: reads and writes
- SQLite persistence → Knowledge graph database: stores
- Schema migrations → Knowledge graph database: evolves schema
- MCP tool server → Graph operation tools: registers
- Graph operation tools → HTML normalization: normalizes content
- Graph operation tools → Database adapter: uses
- Database adapter → Knowledge graph database: accesses · Shares the native knowledge graph store.