Vue 3 Rebuild of DeepSeek's Chat Demo Cuts Source by 27% and Adds MCP and Skills
A Vue 3 component library can now absorb the intricate state management of a production AI chat app, so a small team can replicate an 18,000-line reference implementation and still extend it with MCP and Skills. That puts a lot of infrastructure work behind a single dependency, making complex AI frontends significantly cheaper to build and maintain.
DeepSeek open-sourced a browser-direct chat application with streaming conversation, thinking, web search, link reading, multimodal uploads, voice, message branch trees, and ZIP archive import/export. The official React 18 + Zustand implementation runs 18,412 lines of production source. A Vue 3 rebuild using the TinyRobot component library and runtime suite replicated every feature, then added MCP tool connections and Skills management, and reduced the source to 13,368 lines, a 27.40% decrease.
The reduction came from three architecture iterations. Replacing hand-written UI components with TinyRobot's atomic components saved 4,347 lines, but adopting the higher-level ChatUI suite without also delegating the runtime actually increased code by 331 lines. The third iteration handed session state, streaming, cancellation, and persistence to TinyRobot's headless runtime and chat suite, removing an extra adapter layer and custom logic. The final structure separates atomic components, a UI-agnostic runtime layer, and a pre-built chat UI, while still allowing custom providers for DeepSeek's domain protocol.
The project also fixed deep concurrency issues, such as a ghost-write race where a stale engine save could overwrite a newly imported ZIP archive with the same session ID, solved with a historyEpoch marker. It passed 38 Playwright regression tests with no failures or flaky runs, plus static checks and real API tests covering streaming, search, OCR, ASR, and TTS.
The 331-line increase when adding the ChatUI suite without transferring runtime is a cautionary tale: component library value depends on delegating state and lifecycle, not just rendering.
The complexity that makes a production AI chat app hard to replicate is not the chat UI itself but the message tree, ZIP interoperability, file re-upload, audio pipeline, and concurrency races.
TinyRobot's layered design, with a headless runtime separate from UI components, resolves the usual trade-off between abstraction and customization by letting developers inject custom protocol logic while reusing the rest.
The historyEpoch pattern for rejecting stale async writes is a generalizable solution for any IndexedDB-backed application where session IDs can collide.