How anurag0224q/coding_buddy works
Coding Buddy is a browser-based AI coding assistant. Users manage chats, choose a chat mode, attach text or code files, and stream AI responses; settings allow default or user-supplied provider credentials and connection testing. The main path runs from the chat UI through the streaming client and Node API to shared request shaping and provider adapters. Local chat and settings persistence is a separate state branch. A Cloudflare Worker is also present, but its runtime wiring is not shown in the excerpts; its links are therefore marked unverified.
Main entry points: ChatPage.jsx Chat workspace · app.js HTTP API · providers.js Provider adapters · SettingsModal.jsx Provider settings
Components 15
Chat interface
- Chat workspace
src/pages/ChatPage.jsx - App routing
src/App.tsx - Provider settings
src/components/SettingsModal.jsx - Chat sidebar
src/components/Sidebar.jsx - Markdown renderer
src/components/Markdown.jsx - Code formatting
src/components/CodeBlock.jsx - Streaming client
src/lib/aiClient.js - JSON API client
src/lib/api.ts
Browser state
- Chat and settings storage
src/lib/storage.js
AI service
- Prompt and message shaping
server/core.js - Provider adapters
server/providers.js
Server runtimes
- HTTP API
server/app.js - Worker runtime
worker/index.js
Other components
- User
- AI providers
Connections 19
- User → App routing: opens app
src/App.tsx - App routing → Chat workspace: routes to
src/App.tsx - Chat workspace → Provider settings: opens
src/pages/ChatPage.jsx - Chat workspace → Chat sidebar: renders
src/pages/ChatPage.jsx - Chat workspace → Markdown renderer: renders
src/pages/ChatPage.jsx - Markdown renderer → Code formatting: uses
src/components/Markdown.jsx - Chat workspace → Chat and settings storage: loads and saves
src/pages/ChatPage.jsx - Provider settings → Chat and settings storage: saves settings
- Chat workspace → Streaming client: streams chat
src/pages/ChatPage.jsx - Provider settings → JSON API client: tests connection
src/components/SettingsModal.jsx - Chat workspace → JSON API client: loads config
src/pages/ChatPage.jsx - Streaming client → HTTP API: posts chat
- JSON API client → HTTP API: calls API
- HTTP API → Prompt and message shaping: shapes request
server/app.js - HTTP API → Provider adapters: streams completion
server/app.js - HTTP API → Provider adapters: tests connection
server/app.js - Provider adapters → AI providers: calls provider
server/providers.js - Worker runtime → Prompt and message shaping: uses shaping
worker/index.js - Worker runtime → Provider adapters: uses adapters
worker/index.js