How xxnuo/open-coreui works
Main Components
• Desktop Client (Tauri)
• Bundles: SvelteKit frontend + Rust backend in one native executable
• Uses Tauri’s IPC (Rust ↔ WebView)
• Web Client (Browser)
• SvelteKit application served by the backend server
• Communicates via HTTP REST and WebSockets
• Backend Server (Rust)
• HTTP/REST API + Socket.IO endpoints (chat)
• Middleware chain for auth, rate‐limiting, security headers, code execution, auditing
• Service layer (business logic)
• Retrieval/vector layer (Chroma vector store)
• Cache manager
• Static file serving (web assets)
• Data & External Services
• Local storage: SQLite or file system (per env)
• Vector database: Chroma (embedded)
• AI providers: OpenAI (via routes/openai)
• Tool runtimes / code interpreter sandbox
Relationships & Data Flows
• User → Desktop UI (Tauri WebView)
↕ IPC commands/Callbacks → Rust backend
• User → Browser UI
↔ HTTP REST / WebSockets → Rust backend
• Rust backend
→ invokes Service layer methods → Data layer (DB, vector store)
→ calls External AI APIs (OpenAI) or sandbox runtimes
• Cache & Retrieval
↔ Vector store (Chroma)
• Static assets
← Rust backend (serves SvelteKit build in CLI mode; bundled in Tauri mode)
Architectural Patterns
• Layered architecture: HTTP layer → Middleware → Service → Data/External
• Modular code organization (routes, services, models, middleware, utils)
• IPC channel for desktop mode vs HTTP API for server mode
• Embedded vector DB (Chroma) for retrieval‐augmented generation
Technologies & Frameworks
• Frontend: SvelteKit, Tailwind CSS, Vite
• Desktop wrapper: Tauri
• Backend: Rust (Axum or Warp HTTP server, Socket.IO adapter)
• Storage: SQLite or file‐based, Chroma vector store
• External: OpenAI API, code sandbox executor
• Build/Deploy: Dockerfiles, Makefile, GitHub Actions CI
• Clear component labels (e.g., “SvelteKit Frontend”, “Tauri IPC”, “Rust HTTP Server”)
• Notes on configuration (env files) and build (Docker/Tauri) as peripheral annotations