mirror of
https://github.com/pawelorzech/FastMemos.git
synced 2026-01-29 19:54:29 +00:00
2.4 KiB
2.4 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Build & Development
This is a native macOS SwiftUI app. Open FastMemos.xcodeproj in Xcode and build with ⌘B.
From the command line:
xcodebuild -project FastMemos.xcodeproj -scheme FastMemos -configuration Debug build
To run:
xcodebuild -project FastMemos.xcodeproj -scheme FastMemos -configuration Debug build
open ./build/Debug/FastMemos.app
Requirements: macOS 13.0+ (Ventura), Xcode 15+
Architecture
FastMemos is a menubar-only macOS app for quickly capturing notes to a self-hosted Memos server.
Key Components
Entry Point (FastMemosApp.swift):
AppDelegatesets up the menubar status item and popover- App runs as
.accessory(no dock icon) - Global hotkey (⌘⇧M) triggers
showNoteWindow() NotePanelis a floatingNSPanelfor the note capture UI
State Management:
AppState(inViewModels/) is the single source of truth, passed to all views- Publishes:
isLoggedIn,serverURL,defaultVisibility,isLoading,lastError,launchAtLogin - Handles authentication flow and memo creation
Services (in Services/):
MemosAPIService- Communicates with Memos v1 API (/api/v1/memos,/api/v1/auth/status)KeychainService- Stores access tokens securely in macOS Keychain (service:me.orzech.FastMemos)ShortcutService- Registers global hotkey using Carbon Events API
Views (in Views/):
MenuBarView- Main popover shown from menubar iconNoteWindowView- Floating note capture panel with visibility pickerLoginView- Access token authentication flowSettingsView- App preferences (visibility, launch at login)
Models (in Models/):
Memo,CreateMemoRequest- API request/response structuresMemoVisibility- Enum:.private,.protected,.public
Data Flow
- User triggers hotkey →
AppDelegate.showNoteWindow()→NotePanelappears - User writes note, selects visibility, presses ⌘Enter
NoteWindowView.submitMemo()→AppState.createMemo()→MemosAPIService.createMemo()- Token from
KeychainServiceis used for Bearer auth
Settings Storage
UserDefaults:serverURL,defaultVisibility,shortcutKeyCode,shortcutModifiers- Keychain:
accessToken,username SMAppService.mainAppfor launch at login