App Structure
The application follows SwiftUI’s declarative architecture with three core managers:- MenuBarExtra for lightweight menu bar presence
- Window for the dashboard interface
- @StateObject to manage singleton instances
StateObject Pattern
TypeSteps uses the StateObject pattern to manage app-wide state through singleton managers:StorageManager.shared
Manages all data persistence and statistics:StorageManager.swift:5-392
KeystrokeListener.shared
Handles global event monitoring:KeystrokeListener.swift:5-91
WakaTimeManager.shared
Integrates with WakaTime API:WakaTimeManager.swift:4-62
App Lifecycle
AppDelegate
The AppDelegate handles initialization and onboarding flow:TypeStepsApp.swift:5-29
Notification System
TypeSteps uses NotificationCenter for app-wide events:TypeStepsApp.swift:31-35
UI Architecture
Menu Bar Interface
The menu bar provides quick stats and controls:TypeStepsApp.swift:55-98
Dashboard Window
The main dashboard uses a tabbed interface showing:- Day view with hourly activity chart
- Week view with daily breakdowns
- Month view with historical data
TypeStepsApp.swift:113-150
Theme System
TypeSteps includes 24 built-in themes (12 light, 12 dark):Theme.swift:3-258
Data Models
ActivityPoint
Used for chart rendering:AppCategory
Categorizes applications:Models.swift:1-28
Service Management
TypeSteps uses ServiceManagement for login item registration:TypeStepsApp.swift:164-176