Skip to main content

Frontend Architecture

See Terminal UI Architecture for the complete technical deep-dive with diagrams.

Tech Stack

LayerTechnology
FrameworkNext.js 14 (App Router)
StateZustand 5
StylingTailwind CSS 3.4 + 8bitcn/ui
AI ChatVercel AI SDK v6 (@ai-sdk/react)
Graphreact-force-graph-2d
ChartsRecharts
Markdownreact-markdown
ValidationZod
ToastsSonner

Key Hooks

HookPurpose
useAgentPipeline()Derives 3-stage pipeline state from AI SDK messages
usePlaybook()Streams /api/playbook SSE for 4-lens analysis
useThreadLoader()Loads user threads on mount
useFeed()Infinite cursor-based pagination for community cards
useMarketData()BTC price + Fear & Greed index
useGraphData()Speaker nodes + similarity links
useWatchlist()Watchlist CRUD
useBeliefAnalysis()Individual belief deep analysis

Speaker Tier System

TierColorCriteria
LegendaryGoldHighest belief count
EpicTealHigh belief count
RarePurpleModerate
CommonOrangeDefault