Tech Stack Decisions: Web Framework Analysis
Why We Removed the Web Framework
You caught an important inconsistency. The original documentation recommended Axum as the web framework, but this was from the initial API-first architecture where we planned to build:
Axum Server → REST API → Web Frontend (React/Vue)
↓
TUI Client
With the shift to TUI-first, dual-target architecture, this changes completely:
New Architecture: No Web Framework Needed
Native Terminal (ratatui) ──┐
├── Shared Core ──→ LLM APIs
Web Browser (WASM) ─────────┘ ↓
SQLite/LocalStorage
Key differences:
- No server required for basic functionality
- Native TUI is a standalone binary (no HTTP)
- Web version is a static WASM app served from CDN/static host
- Both talk directly to LLM APIs from client side
What We Actually Need
For Native TUI
ratatui+crossterm- UI frameworktokio- Async runtime for I/Oreqwest- HTTP client to call LLM APIssqlx- Local SQLite databaseclap- CLI argument parsing
For Web (WASM)
ratzilla- DOM backend for ratatuiwasm-bindgen- Rust/JS bridgeweb-sys- Browser APIsgloo- Ergonomic web wrappers
Shared Core
serde- Serializationfutures- Async utilities- Custom LLM provider trait
When Would We Add a Web Framework?
Only if we later implement server mode for:
- Multi-user/team features - Centralized conversation storage
- Cloud sync - Sync across devices without manual export/import
- Enterprise deployment - Admin controls, audit logs
- Heavy compute - Running large models on server instead of client
Then we’d add:
axumoractix-web- HTTP API- PostgreSQL - Centralized database
- Redis - Caching/sessions
- Authentication/authorization layer
But this is Phase 3+ and optional. The core product works without it.
Updated Recommendation
| Component | Original | Revised | Notes |
|---|---|---|---|
| Web Framework | Axum | None | Not needed for TUI |
| Database (native) | PostgreSQL | SQLite | Local, embedded |
| Database (web) | PostgreSQL | LocalStorage/IndexedDB | Browser storage |
| HTTP Client | reqwest | reqwest | Direct to LLM APIs |
| Server | Required | Optional | Only for sync features |
Why This Is Better
- Simpler deployment:
cargo installor static web hosting - Privacy: Conversations stay on device by default
- Offline capable: Works without internet (local models)
- Lower latency: No HTTP hop to our own server
- Cheaper to run: No server infrastructure for basic users
The Mental Model Shift
Old: Web application with TUI as alternative client New: Terminal application with web as alternative deployment target
This aligns with tools like:
lazygit- Git TUI (terminal only, no web)k9s- Kubernetes TUI (terminal only, no web)opencode- AI TUI (terminal-first, web as convenience)
The web deployment via WASM is a feature, not the primary architecture.
Documentation Updates
The tech-stack-revised.md document reflects this approach. This document (decisions.md) now serves as:
- Historical reference for the API-first approach
- Future reference if we add server mode
- Comparison of the two architectures
Next Steps
- Build
harness-core- Shared business logic - Build
harness-tui- Native terminal app - Build
harness-web- WASM browser version - Later: Consider
harness-serveronly if needed
No Axum needed until we explicitly decide to add server-side features.