How bariskisir/aichat works
AI Chat is an Electron desktop client for OpenAI-compatible APIs, ChatGPT, and Claude Web. The main workflow is selecting or creating a conversation, composing a request, streaming a provider response into the chat workspace, and retaining conversation data locally. Settings, provider authentication/model management, attachments, web search, rich Markdown rendering, and desktop updates are additional product capabilities. The graph follows documented IPC and service ownership; sampled excerpts do not expose every renderer action or provider protocol detail, so uncertain links are omitted.
Main entry points: ipc.service.ts IPC service · chat.service.ts Chat service · index.ts Main lifecycle · App.tsx App shell
Components 21
Desktop runtime
- Main lifecycle
src/main/index.ts - Window service
src/main/window/window.service.ts - Preload bridge
src/preload/index.ts - IPC service
src/main/ipc/ipc.service.ts
Chat experience
- App shell
src/renderer/src/App.tsx - Chat workspace
src/renderer/src/components/chat/ChatWorkspace.tsx - Conversation sidebar
src/renderer/src/components/sidebar/ConversationsSidebar.tsx - Markdown rendering
src/renderer/src/components/chat/markdown/markdownComponents.tsx - Chat service
src/main/chat/chat.service.ts
Provider access
- Provider settings
src/renderer/src/pages/settings/sections/ProviderSettingsSection.tsx - Provider registry
src/main/providers/provider.registry.ts - Provider families
src/main/providers/index.ts - Provider APIs
Local state
- Conversation storage
src/main/persistence/storage.service.ts - Attachment service
src/main/attachments/attachment.service.ts - Settings page
src/renderer/src/pages/settings/SettingsPage.tsx
Desktop features
- Web search
src/main/search/web.search.service.ts - Search window
src/main/search/hidden.window.service.ts - Update service
src/main/updates/app.updater.ts - GitHub releases
Other components
- User
Connections 27
- User → App shell: uses
- App shell → Chat workspace: renders
- App shell → Settings page: renders
- Chat workspace → Conversation sidebar: shows conversations
- Chat workspace → Markdown rendering: renders messages
- App shell → Preload bridge: requests desktop actions
- Preload bridge → IPC service: invokes channels
- Main lifecycle → Window service: creates window
- Main lifecycle → Provider registry: initializes providers
- Main lifecycle → Chat service: composes
- Main lifecycle → IPC service: registers handlers
- IPC service → Conversation storage: loads and saves
- IPC service → Provider registry: manages providers
- IPC service → Chat service: starts chat
- Chat service → Provider registry: resolves provider
- Provider registry → Provider families: dispatches provider
- Chat service → Provider APIs: sends requests
- Provider APIs → Chat service: streams responses
- Chat service → Conversation storage: persists conversations
- IPC service → Attachment service: handles attachment actions
- Provider settings → Preload bridge: requests provider actions
- Settings page → Preload bridge: requests settings actions
- Web search → Search window: extracts search results
- Chat service → Web search: requests web search
- IPC service → Update service: checks and installs
- Update service → GitHub releases: checks releases
- GitHub releases → Update service: provides release data