Skip to content

Development ​

Local development, builds, tech stack, architecture, and the REST API.

Development ​

Requirements ​

  • Node.js 22 or newer; .nvmrc selects the default development version. Focused state regressions require Node.js 24 or newer.
  • Rust 1.91 or newer, declared by the workspace for the updated security dependencies.
  • Session data from at least one supported CLI.

Desktop platform dependencies:

PlatformRequirements
WindowsVisual C++ Build Tools and WebView2
macOSXcode command-line tools (xcode-select --install)
Ubuntu/Debianlibwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

The web server does not need desktop WebKit/GUI libraries.

Run locally ​

bash
git clone https://github.com/zuoliangyu/AI-Session-Viewer.git
cd AI-Session-Viewer
npm ci
npx tauri dev

Use npx tauri dev for desktop development: it starts both the Rust backend and Vite. Running Vite alone does not provide a desktop backend.

Windows provides ./menu.ps1; Linux/macOS provide ./menu.sh. Script details are in scripts/README.md. For web development, use npm run dev:web.

Build and validate manually ​

Run node scripts/audit-dependencies.mjs for dependency security checks. It reads lockfiles, verifies the vendored patch and queries advisories without installing dependencies or compiling. See dependency security maintenance for scope, the GLib backport and the remaining maintenance warning.

bash
# Desktop packages
npx tauri build

# Web executable
npm run build:web && cargo build -p session-web --release

# Docker image
docker build -t ai-session-viewer-web .

# Lightweight regression checks
npm run check:scripts
npm run check:regressions # Node.js 24+, focused state regressions without compilation

# Rust lint and TypeScript validation
cargo clippy --workspace -- -D warnings
npx tsc --noEmit

Desktop artifacts are in target/release/bundle/; the web executable is target/release/session-web. Local menu builds disable updater artifacts and do not require a signing key. Release CI uses repository signing secrets.

AppImage: the project pins @tauri-apps/cli to 2.11.4, which includes Tauri #15596. It creates relative .DirIcon and root .desktop symlinks, so they remain valid outside the build machine. Install dependencies from the lockfile. node scripts/check-appimage.mjs checks the version pin; Linux artifact extraction and launch still require manual verification. See the artifact checklist.

The interface remains Chinese by default. Providing an English option alone does not satisfy the AppImage catalog's request for English by default outside Chinese locales.

Translations: edit both dictionaries in src/i18n/locales/. Components use useTranslation; utilities share the same i18next instance. Keep placeholders consistent and do not translate user content. See src/i18n/README.md.

Release checks: tag releases call the CI workflow from the same commit and wait for all checks to pass before packaging or publishing. Failed or cancelled checks block release. CI also runs for pull requests, pushes to main/master, and manual runs; tags do not start a duplicate standalone CI run.

An independent Node.js 24 CI job runs focused regressions for sync previews, empty tag caching, question trees, message request isolation, billing pagination, chat lifecycle, and message navigation. The checks exercise real state logic with in-memory APIs and WebSockets, each in a separate process so mocks cannot leak between checks. They do not replace Rust/TypeScript compilation or live UI verification.

Markdown HTTP(S) and mailto: links open in the system default application on desktop and in a new tab with opener isolation on the web. In-page anchors remain available. File, script, custom-protocol and relative-path links render as text instead of application routes. The desktop WebView only accepts exact application origins; development additionally permits the exact scheme, host and port configured in devUrl, preventing remote pages from gaining local IPC access.

node scripts/check-markdown-links.mjs verifies filtering and system-browser calls with in-memory mocks. It does not open real links. Rust navigation tests in src-tauri/src/navigation.rs require manual compilation.

Architecture ​

LayerTechnology
DesktopTauri v2, Rust, system WebView
Web serverAxum + WebSocket
FrontendReact 19, TypeScript, Vite 6
UITailwind CSS, lucide-react
StateZustand 5
Localizationi18next + react-i18next
Renderingreact-markdown, remark-gfm, react-syntax-highlighter
ChartsRecharts
Shared backendsession-core Rust crate

The Cargo workspace contains crates/session-core, src-tauri, and crates/session-web. Shared React components use api.ts, which selects Tauri IPC or HTTP/WebSocket via the compile-time __IS_TAURI__ flag. Providers parse source-specific files into shared project, session, and display-message models.

API overview ​

The web API uses source=claude|codex|grok|omp where applicable. Authenticated deployments require a bearer token.

MethodEndpointPurpose
GET/api/projects, /api/sessionsList projects and sessions
DELETE/api/sessionsDelete a session
GET/api/messagesPaginated messages (filePath, page, pageSize, fromEnd)
GET/api/messages/questionsCompact question index (source, filePath)
GET/api/messages/locationLocate any message role (source, filePath, messageId); returns { messageIndex: number | null }, with null for missing IDs
POST/api/sessions/forkFork a session
PUT/api/sessions/metaUpdate alias and tags
GET/api/trajectoryCodex trace records
GET/api/exportJSON / Markdown / HTML export
GET/api/scan-progressInitial scan progress
GET/api/search, /api/tags, /api/cross-tagsSearch and tags
GET/api/stats, /api/stats/requests, /api/stats/projects, /api/stats/sessionUsage and cost statistics
GET, POST/api/bookmarksList or add bookmarks
DELETE/api/bookmarks/:idRemove a bookmark
GET/api/cli/detect, /api/cli/configCLI detection and masked configuration
POST/api/modelsList models
GET, DELETE/api/skillsList or delete skills
GET/api/skills/contentRead SKILL.md
POST/api/skills/importImport a ZIP archive
GET/api/provider-sync/statusProvider metadata status
POST/api/provider-sync/sync, /api/provider-sync/switchSync or change provider
POST/api/provider-sync/restore, /api/provider-sync/pruneRestore or prune backups
WS/ws, /ws/chatFile events and CLI chat

Released under the MIT License · Reads local session files only, nothing is uploaded