Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JerryZLiu/Dayflow/llms.txt
Use this file to discover all available pages before exploring further.
Why Build from Source?
Building Dayflow from source allows you to:- Audit the code: Inspect how screen recordings and AI processing work
- Customize behavior: Modify capture intervals, deep-link actions, or AI prompts
- Contribute: Fix bugs or add features with pull requests
- Maximum privacy: Verify no data leaves your machine when using local AI
- Debug issues: Run instrumented builds with enhanced logging
Prerequisites
System Requirements
- macOS 13.0+ (Ventura or later)
- Xcode 15+ (Download from Mac App Store)
- Command Line Tools (installed automatically with Xcode or via
xcode-select --install)
Optional: Gemini API Key
If you plan to use Gemini for AI processing, obtain a free API key:- Visit Google AI Studio
- Sign in with your Google account
- Click Get API Key → Create API key
- Copy the key (starts with
AIza...)
Building Dayflow
Clone the repository
Open Terminal and clone the Dayflow repository:This downloads the complete source code to
~/Dayflow.Open the Xcode project
Configure code signing
In Xcode, select the Dayflow target in the project navigator.Go to Signing & Capabilities tab.For local development:
- Set Team to your Apple ID or “None” (for unsigned local builds)
- Xcode will auto-generate a provisioning profile
- Use a paid Apple Developer account
- Enable Hardened Runtime and Notarization for public release
Unsigned builds work fine locally but will trigger Gatekeeper warnings if shared with others.
Add GEMINI_API_KEY environment variable (optional)
If using Gemini, add your API key to the run scheme:
- In Xcode, click the scheme selector (“Dayflow” near the top toolbar) → Edit Scheme…
- Select Run in the left sidebar
- Go to the Arguments tab
- Under Environment Variables, click + to add:
- Name:
GEMINI_API_KEY - Value:
AIzaSy...(your actual API key)
- Name:
In your Run scheme, add your GEMINI_API_KEY under Arguments > Environment Variables (if using Gemini).
Granting Permissions
When you run Dayflow for the first time, macOS will prompt for screen recording access.Grant Screen Recording permission
When prompted, click Open System Settings.In Privacy & Security → Screen & System Audio Recording, enable the Dayflow checkbox.
Build Configuration
Debug vs. Release
Debug (default for Xcode Run):- Enhanced logging (SQL query profiling, LLM call traces)
- Slower performance due to optimizations disabled
- Easier to debug with breakpoints and inspectors
- Optimized for performance
- Minimal logging
- Smaller binary size
- Edit Scheme… → Run → Build Configuration
- Select Debug or Release
Debug-Only Features
FromStorageManager.swift:493-501, debug builds enable SQL profiling:
Project Structure
From README.md:304-311:Dayflow/App/AppDeepLinkRouter.swift- URL scheme handlingDayflow/Core/Recording/StorageManager.swift- Database and file managementDayflow/Core/AI/GeminiService.swift- Gemini API integrationDayflow/Views/Timeline/TimelineView.swift- Main timeline UI
Common Build Issues
”No signing certificate found”
Solution: In Signing & Capabilities, set Team to your Apple ID or “Sign to Run Locally” (Xcode 14+).”ScreenCaptureKit not available”
Solution: Ensure deployment target is macOS 13.0+. Check Dayflow target → General → Minimum Deployments.”Cannot find ‘GRDB’ in scope”
Solution: Xcode may need to resolve Swift Package Manager dependencies:Build succeeds but app crashes on launch
Solution: Check Console.app for crash logs. Common causes:- Missing
Info.plistkeys (screen recording usage description) - Corrupted database (delete
~/Library/Application Support/Dayflow/chunks.sqliteand rebuild)
Modifying the Source
Example: Change Recording Interval
By default, Dayflow captures in 60-second chunks. To change:- Open
Dayflow/Core/Recording/ScreenRecorder.swift - Find the chunk duration constant (search for
60) - Modify the value:
- Rebuild (Cmd+B) and run
Example: Add Custom Deep-Link Action
To add a new URL action (e.g.,dayflow://open-settings):
- Open
AppDeepLinkRouter.swift:10-24 - Add new case to
Actionenum: - Update
init?(identifier:)to handle the new action - Implement in
perform(_ action:): - Add the handler method and rebuild
Example: Customize AI Prompts
AI prompts are defined in service files likeGeminiService.swift. To modify:
- Search for prompt strings (look for
systemInstructionor prompt constants) - Edit the prompt text
- Rebuild and test with a small batch
Running Tests
Dayflow includes unit tests for core functionality:- Date/time calculations (4 AM boundary logic)
- Database migrations
- URL scheme routing
- Storage management
Creating a Distribution Build
To create a.dmg for sharing:
Archive the app
In Xcode: Product → ArchiveWait for the build to complete (may take several minutes).
Export for distribution
When Organizer opens, select the archive → Distribute AppChoose Direct Distribution (for personal use) or Developer ID (for public release).
Notarize (optional but recommended)
For public distribution, enable notarization to avoid Gatekeeper warnings.Requires a paid Apple Developer account ($99/year).Xcode will upload to Apple’s notary service and staple the ticket automatically.
Staying Updated
To pull the latest changes from the repository:Handling Merge Conflicts
If you’ve modified files locally:Contributing
From README.md:332-334:PRs welcome! If you plan a larger change, please open an issue first to discuss scope and approach.Workflow:
- Fork the repository on GitHub
- Create a feature branch:
git checkout -b feature/my-improvement - Make changes and commit:
git commit -m "Add feature X" - Push to your fork:
git push origin feature/my-improvement - Open a Pull Request on GitHub
Getting Help
If you encounter build issues:- Search GitHub Issues for similar problems
- Check Xcode’s Report Navigator (Cmd+9) for detailed error logs
- Try cleaning the build folder: Product → Clean Build Folder (Cmd+Shift+K)
- If stuck, open a new issue with:
- Xcode version
- macOS version
- Complete error output
- Steps to reproduce
Related Documentation
- Debugging & Developer Tools - Inspect app behavior in debug builds
- URL Scheme Automation - Test deep-link modifications