How augustdev/enchanted works
Enchanted is a SwiftUI chat app for using privately hosted Ollama models across Apple platforms. The main workflow is composing a prompt, optionally with an image or voice input, sending conversation context to Ollama, then displaying and saving the response. It also supports model selection, conversation history, read-aloud, settings, and a macOS Spotlight-style prompt/completion panel. The tree and README establish these capabilities; sampled source confirms chat generation and SwiftData persistence, while some UI and store wiring is unsampled.
Main entry points: PanelManager.swift Panel controller · ConversationStore.swift Conversation workflow · ChatView_iOS.swift Chat interface · OllamaService.swift Ollama client
Components 20
Chat experience
- Application entry
Enchanted/UI/Shared/ApplicationEntry.swift - Chat interface
Enchanted/UI/iOS/ChatView_iOS.swift - Message display
Enchanted/UI/Shared/Chat/Components/MessageListVIew.swift - Voice prompts
Enchanted/UI/Shared/Chat/Components/Recorder/SpeechRecogniser.swift - Read aloud
Enchanted/UI/Shared/Chat/Components/ReadingAloudView.swift
Models and settings
- Ollama client
Enchanted/Services/OllamaService.swift - Model catalog
Enchanted/Stores/LanguageModelStore.swift - App settings
Enchanted/UI/Shared/Settings/SettingsView.swift
Conversation state
- Conversation workflow
Enchanted/Stores/ConversationStore.swift - Conversation data
Enchanted/SwiftData/Models/ConversationSD.swift - Message data
Enchanted/SwiftData/Models/MessageSD.swift - Local persistence
Enchanted/Services/SwiftDataService.swift
macOS prompt panel
- Panel controller
Enchanted/UI/macOS/PromptPanel/PanelManager.swift - Prompt panel
Enchanted/UI/macOS/PromptPanel/PromptPanel.swift - Completions
Enchanted/Stores/CompletionsStore.swift
Platform services
- Speech synthesis
Enchanted/Services/SpeechService.swift - Hotkey service
Enchanted/Services/HotkeyService.swift - Clipboard
Enchanted/Services/Clipboard.swift
Other components
- User
- Ollama server
Connections 21
- User → Chat interface: composes
- Application entry → Chat interface: presents
- Chat interface → Conversation workflow: submits prompt
- Chat interface → Voice prompts: records prompt
- Conversation workflow → Ollama client: requests completion
- Ollama client → Ollama server: sends request
- Ollama server → Ollama client: returns response
- Conversation workflow → Local persistence: loads and saves
- Local persistence → Conversation data: persists
- Local persistence → Message data: persists
- Conversation workflow → Message display: publishes messages
- Message display → User: shows response
- Model catalog → Ollama client: fetches models
- App settings → User: configures
- Read aloud → Speech synthesis: speaks response
- Speech synthesis → User: plays audio
- User → Panel controller: opens panel
- Panel controller → Prompt panel: presents
- Panel controller → Completions: uses completions
- Panel controller → Hotkey service: registers shortcut
- Panel controller → Clipboard: copies text