How beingpax/voiceink works
Main Components
• Application Entry Point: Represent the AppDelegate (found in VoiceInk/AppDelegate.swift) which is where the app lifecycle begins.
• UI Layer: Include the Views (entire VoiceInk/Views directory with ContentView, Onboarding, Settings, Metrics, etc.) and ViewModels (VoiceInk/ViewModels) that represent the presentation layer. Also show the Components (subdirectory within Views) like ProBadge, TrialMessageView, VideoCTAView, etc.
• Business & Domain Logic:
• Services: Create a separate component for the “Services” directory. This encapsulates critical functionalities (e.g., AIEnhancementService, AIService, AudioTranscriptionService, BrowserURLService, ScreenCaptureService, and others). These handle tasks like transcription, AI prompt management, audio processing, audio transcription, window management, and even integration with external utilities.
• Models: Include the Models directory (CustomPrompt, PowerModeConfig, PredefinedPrompts, etc.) to show data structures and domain objects.
• Audio and Media Management: Highlight specialized files such as Recorder.swift, MediaController.swift, AudioDeviceManager.swift, AudioTranscriptionManager.swift, AudioProcessor.swift, and SoundManager.swift.
• Auxiliary Components:
• ClipboardManager.swift and HotkeyManager.swift – these are used to support user input and register global shortcuts for functionalities.
• WindowManager.swift – likely managing app windows (menu bar, mini-recorder, notch recorder views).
• Whisper Directory: Include a component showing how the whisper-based transcription (using LibWhisper, WhisperError, WhisperPrompt etc.) is abstracted for handling deep transcription logic.
External and Third-party Dependencies
• Use of external libraries like Sparkle (for updates), KeyboardShortcuts, and LaunchAtLogin.
• Integration with open-source AI models (whisper.cpp) which drive the core transcription functionality.
• Voice recording and transcription architecture that supports “local AI” processing for privacy.
Defining Relationships and Interactions
• Application Lifecycle Flow: Illustrate how the AppDelegate initializes core services, loads the UI, and then dispatches interactions.
• Configuration and Helpers: Show that Settings, AudioDeviceConfiguration, UserDefaultsManager, and ClipboardManager are supporting services that maintain user preferences and hardware configurations.
Architectural Patterns and Design Principles
• MVC/MVVM: Highlight the use of common macOS patterns such as separating UI (Views) from business logic (ViewModels) and domain services.
• Modular Design: The clear separation into directories such as Models, Views, and Services suggests a modular architecture, making it easier to extend and maintain.
• Dependency Management: Indicate use of Swift packages (via swiftpm) and Xcode project structure which abstracts configuration and builds scripts, suggesting that configurations (like build and deployment, including the use of Sparkle for updates) are taken into account.