How goekss/goai-chatlab works
GoAI ChatLab is a browser-based multimodal AI chat app. Users choose a model and system instruction, compose a message with optional documents or images, and receive an assistant reply through a server-side OpenRouter proxy; chat history is stored locally. The graph distinguishes UI, message preparation, proxying, and model inference, and includes the documented history and settings capabilities. Express and Cloudflare Worker are alternative proxy implementations. The serverless API file is present, but its implementation and wiring were not excerpted, so its relationship is left unverified.
Main entry points: App.js Chat orchestration · aiService.js Model selection and failover · SettingsPanel.jsx Chat settings · InputArea.jsx Message composer
Components 13
Chat experience
- Chat orchestration
src/App.js - Theme header
src/Components/Header/Header.jsx - Chat settings
src/Components/SettingsPanel/SettingsPanel.jsx - Message composer
src/Components/InputArea/InputArea.jsx - Conversation view
src/Components/ChatBox/ChatBox.jsx - Browser chat history
src/App.js
Message preparation
- Document extraction
src/aiService/fileParser.js - Model selection and failover
src/aiService/aiService.js
Secure proxy
- Express proxy
server/server.js - Cloudflare proxy
worker/worker.js - Serverless chat API
api/chat.mjs
Model inference
- OpenRouter API
Other components
- Chat user
Connections 16
- Chat user → Chat orchestration: uses
README.md - Chat orchestration → Theme header: renders
src/App.js - Chat orchestration → Chat settings: renders
src/App.js - Chat orchestration → Message composer: renders
src/App.js - Chat orchestration → Conversation view: renders
src/App.js - Message composer → Chat orchestration: submits input
src/App.js - Chat settings → Chat orchestration: updates settings
src/App.js - Chat orchestration → Browser chat history: reads and writes
src/App.js - Chat orchestration → Document extraction: extracts documents
src/App.js - Chat orchestration → Model selection and failover: sends chat
src/App.js - Chat settings → Model selection and failover: loads model options
src/Components/SettingsPanel/SettingsPanel.jsx - Model selection and failover → Express proxy: posts chat
src/aiService/aiService.js - Model selection and failover → Cloudflare proxy: posts chat
README.md - Express proxy → OpenRouter API: forwards request
server/server.js - Cloudflare proxy → OpenRouter API: forwards request
worker/worker.js - Serverless chat API → OpenRouter API: proxy relationship unverified