How duxins/alog works
Main components of the system
• iOS Frontend:
• Primary application code under Sources/App (including AppDelegate, SceneDelegate, and various main views).
• Organized Modules in Sources/Modules (e.g., Recording, Export, Premium, Settings, Summary, Timeline). These likely follow an MVVM or MVC architecture.
• Components such as basic UI controls (located in Sources/Components) and styles (in Sources/Styles).
• Data modeling and persistence managed in Sources/DataModel (using Core Data, as indicated by the .xcdatamodeld files).
• Extensions in Sources/Extentions to enrich system libraries.
• Shared Library:
• Common utility classes such as Connectivity, Localization, notification names, and audio recording that reside in the Shared directory.
• Swift Packages:
• Packages/XLang and Packages/XLog hold reusable code libraries, which may provide localization and logging functionalities respectively.
• Server-Side Component:
• Server directory contains the Cloudflare Worker code (especially in Server/src/worker.js) and related configuration (prettier and package.json). This component handles API requests (including OpenAI API interactions and HMAC validations as described in the README).
• Companion Targets:
• Watch and WatchWidget folders that include separate codebases and assets to support the Apple Watch experience.
• Build and Deployment Tools:
• XCodeGen (driven by the project.yml and .arkana.yml) is used for project file generation.
• Fastlane folders and scripts for managing the build, tests, screenshots, and deployment pipelines.
• Environment/Configuration:
• .env file for environment variables, and additional config files (e.g., .github/workflows for CI).
Relationships and interactions
• The main iOS application communicates with external services via API calls to the deployed Cloudflare Worker. This worker handles requests that involve authentication (HMAC) and calls to OpenAI.
• The app uses shared libraries and Swift packages to modularize core features like localization (XLang) and logging (XLog), ensuring separation of concerns.
• The data layer managed via Core Data (Sources/DataModel) interacts with UI modules (in Sources/Modules) to display and modify user-generated notes or memos.
• Companion apps, like the Watch and WatchWidget, reuse portions of the primary business logic but tailor their interfaces to the watch-specific experience.
• Build-deployment tooling (XCodeGen and Fastlane) acts as an orchestration layer that ties together generation, testing, and releasing steps.
Architectural patterns and design principles
• Use of layered architecture – clear separation between:
• Presentation/UI (Views, Components, Modules)
• Business Logic/Services (under Sources/Services such as AudioPlayer, OpenAI, Transcription)
• Data Model (Core Data and extensions)
• Modularity through Swift packages and shared utilities promotes code reuse and maintainability.
• The server-side is treated as a remote microservice (Cloudflare Worker), emphasizing low-coupling between the client app and backend API.
• Deployment pipelines with CI (GitHub workflows) and Fastlane scripts further underline a modern, automated development lifecycle.