This document provides a deep technical analysis of the RepoMind architecture, design patterns, and data flow.
RepoMind is built as a Local-First Static Application. It bypasses the need for a backend proxy by implementing secure, client-side adapters for all major LLM providers.
- [SEC] Privacy by Design: API keys are stored in
localStorageand optionally encrypted. No data is sent to intermediate servers. - [PERF] Interaction Priority: Using React 19's
useTransitionanduseOptimisticto ensure the UI remains fluid during heavy network I/O. - [MOD] Modular Adapters: New LLM providers can be added by implementing the
LLMProviderinterface.
The application uses a Streaming Orchestrator to handle responses.
- Input Capture: User prompt is normalized and combined with repository context (file contents, structure).
- Context Compression: Relevant file snippets are prioritized based on token limits.
- Provider Selection: The
LLMFactoryinstantiates the correct adapter (Google, Anthropic, etc.). - Dual-Track Streaming:
- Track A: Model output (Text/Markdown).
- Track B: Internal "Thinking" or metadata (for models like DeepSeek R1 or Gemini 2.0).
We use Zustand for global state management, partitioned into specialized stores:
- [CONFIG] Config Store: Handles API keys, provider settings, and model capabilities.
- [CHAT] Chat Store: Manages conversation history, streaming state, and optimistic message updates.
- [UI] UI Store: Controls application appearance (Dark/Light mode), modals, and sidebar state.
- [REPO] Repo Store: Tracks uploaded files and repository metadata.
Keys are handled through the EncryptionService, which provides an abstraction layer for storage.
- Development: Keys are stored as raw strings in
localStoragefor ease of use. - Production-Ready: Interface supports AES-GCM encryption if a master password is provided by the user.
- GSAP: Used for complex sequence animations and entrance choreography.
- Framer Motion: Used for declarative UI transitions (modals, list reordering, sidebars).
- Mermaid.js: Integrated as a dynamic renderer. The system detects mermaid code blocks in LLM responses and automatically renders them as interactive SVG diagrams.
- [CI] Integrity Gate: A pre-merge script (
scripts/integrity-gate.sh) that runs Lint, Type-Check, and Vitest suites. - [CD] Static Export: The app is optimized for
next export, allowing deployment on Vercel or GitHub Pages with zero configuration.
Technical Specification v1.0.0