How kashif-coder404/nexus-v2 works
Nexus is a desktop AI assistant: a user chats through the web dashboard, the backend processes the request with an AI model, and the paired Windows agent provides local desktop execution and live device status. The product also includes authentication, chat history and memory, device pairing, search, screenshots, and system information. The tree and excerpts establish the chat-controller flow and parts of agent pairing/telemetry; several other subsystems are represented by their exact tree paths, but their internal call wiring was not sampled.
Main entry points: Program.cs Windows agent · chat.controller.ts Chat controller · chat.routes.ts Chat routes · askAI.ts AI orchestration
Components 24
Web clients
- Web dashboard
frontend/app/(dashboard)/chat/page.tsx - Chat interface
frontend/app/components/ChatUI.tsx
Cloud backend
- Chat routes
backend/routes/chat.routes.ts - Chat controller
backend/controllers/chat.controller.ts - Authentication
backend/middlewares/auth - Auth routes
backend/routes/auth.routes.ts - Device API
backend/routes/device.routes.ts - Device websocket
backend/services/websocket.service.ts
AI and tools
- AI orchestration
backend/AI/askAI.ts - Model providers
backend/AI/CallAI.ts - Assistant behavior
backend/AI/instructions/main.Instructions.ts - Search service
backend/services/search.service.ts - Filesystem search
backend/tools/search/search.py - Command execution
backend/services/execute.service.ts
Windows agent
- Windows agent
Local-BE-v2/Program.cs - Cloud websocket client
Local-BE-v2/services/WebSocketClientService.cs - Pairing and device state
Local-BE-v2/services/DeviceStateManager.cs - Local execution
Local-BE-v2/services/ExecuteServices.cs - Local search
Local-BE-v2/services/SearchServices.cs - System information
Local-BE-v2/services/GetSystemInfoService.cs
Persistence and state
- Memory service
backend/services/memory.service.ts - Chat history
backend/services/chat.history.service.ts - MongoDB
backend/db/connectDB.ts
Other components
- User
Connections 22
- User → Web dashboard: uses
- Web dashboard → Chat interface: renders
- Chat interface → Chat routes: sends chat
- Chat routes → Authentication: guards requests
- Chat routes → Chat controller: dispatches
- Chat controller → AI orchestration: asks
- Chat controller → Chat history: reads and writes
- Chat controller → MongoDB: updates sessions
- Chat controller → Device websocket: sends progress
- AI orchestration → Model providers: requests model
- AI orchestration → Assistant behavior: uses guidance
- Search service → Filesystem search: spawns
- Auth routes → Authentication: authenticates
- Device API → Device websocket: uses device service
- Memory service → MongoDB: persists memory
- Chat history → MongoDB: persists chats
- Windows agent → Cloud websocket client: hosts
- Windows agent → Pairing and device state: uses state
- Windows agent → Local execution: serves commands
- Windows agent → Local search: serves search
- Windows agent → System information: streams telemetry
- Cloud websocket client → Device websocket: connects