Developer Guide · 01

Architecture Overview

text
┌──────────────────────────────────────────────────────────────────┐
│                        Clients                                    │
│  ┌──────────────┐ ┌────────────┐ ┌─────────┐ ┌────────────────┐ │
│  │  Admin SPA   │ │  Service   │ │ WeChat  │ │ Tauri Desktop  │ │
│  │  React 19    │ │ /s/{sid}   │ │ /wc/..  │ │ (Rust + WV)    │ │
│  └──────┬───────┘ └─────┬──────┘ └────┬────┘ └────────┬───────┘ │
└─────────┼───────────────┼─────────────┼───────────────┼─────────┘
          │ /api/*        │ /api/v1/*   │ iLink         │ launcher.py
          ▼               ▼             ▼               ▼
┌──────────────────────────────────────────────────────────────────┐
│  Nginx (:80) — SSL termination + reverse proxy                    │
│  → Express (:3000) — static files (dist/) + /api proxy            │
│  → FastAPI (:8000) — core backend                                  │
├──────────────────────────────────────────────────────────────────┤
│  FastAPI Application (app/)                                       │
│  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌────────┐ │
│  │ routes/  │ │ services/│ │ channels/│ │ storage/ │ │ voice/ │ │
│  │ routing  │ │ business │ │ wechat   │ │ abstraction│S2S WS │ │
│  └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ └───┬────┘ │
│       └─────┬──────┴───────┬────┘            │           │      │
│             ▼              ▼                  ▼           ▼      │
│  ┌─────────────────────────────┐  ┌──────────────────┐ ┌──────┐ │
│  │  deepagents + LangGraph     │  │  Local FS / S3   │ │ S2S  │ │
│  │  Agent runtime + AsyncSqlite│  │  + AES key enc.  │ │ Proxy│ │
│  └─────────────────────────────┘  └──────────────────┘ └──────┘ │
└──────────────────────────────────────────────────────────────────┘

External protocols:
  • WeChat iLink Bot: app/channels/wechat/ ⇄ ilinkai.weixin.qq.com
  • OpenAI Realtime:  app/voice/router.py ⇄ wss://api.openai.com/.../realtime
  • CloudsWay / Tavily: app/services/web_tools.py (web search)

Layered Design

LayerResponsibilityDirectory
Route LayerHTTP request handling, parameter validation, SSE streamingapp/routes/
Business LayerAgent creation/cache, tools, conversations, scheduling, inboxapp/services/
Channel LayerWeChat iLink protocol (Service + Admin dual-stack)app/channels/wechat/
Storage LayerLocal / S3 file storage abstractionapp/storage/
Core LayerAuth, config, path security, encryption, Langfuseapp/core/
Voice LayerS2S WebSocket proxy (OpenAI Realtime)app/voice/

Three Runtime Environments

EnvironmentEntry PointUse Case
Local Devpython launcher.py --dev or uvicorn + vite devDevelopment, hot reload
Dockerdocker compose up -d --buildServer / team deployment
Desktop Apptauri-launcher/ compiled to .dmg / .exeEnd users, double-click launch