How libec/clipninja works
Project Type Analysis
This is a native macOS application built with Swift and SwiftUI, following a clean architecture pattern with clear separation of concerns. The project is organized using feature modules and follows SOLID principles.
Main Architectural Components
a. Core Features Layer:
• Clipboard Management
• Pasteboard Integration
• Settings Management
• Tutorial System
• Keyboard Handling
b. Infrastructure Layer:
• Instance Provider (DI Container)
• Navigation System
• Lifecycle Events
• Logger
c. System Integration Layer:
• macOS Pasteboard
• Launch at Login
• System Keyboard Events
┌─────────────────────────────────────────────────────────────┐
• UI Layer (SwiftUI) │
• ┬─────────────┬────────────────┬───────────────┤
• Clipboard │ Settings │ Tutorial │ Paste Directly │
• View │ View │ View │ View │
• ┬──────┴──────┬──────┴───────┬────────┴───────┬───────┘
┌──────▼──────┬──────▼──────┬──────▼──────┬─────────▼───────┐
• Clipboard │ Settings │ Tutorial │ Pasteboard │
• Domain │ Domain │ Domain │ Domain │
• ┬──────┴──────┬──────┴──────┬──────┴───────┬────────┘
┌──────▼──────┬──────▼──────┬──────▼──────┬──────▼────────┐
• System │ Keyboard │ Launch At │ Infrastructure│
• Integration │ Handling │ Login │ Layer │
• ┴─────────────┴─────────────┴───────────────┘
Key Relationships to Highlight
a. Data Flow:
• User Interface → Domain Layer (Commands/Events)
• Domain Layer → System Integration (Actions)
• System Integration → macOS System (Native Integration)
b. Dependencies:
• Feature modules → Infrastructure
• UI → Domain Layer
• Domain Layer → System Resources
Important Implementation Details
Architectural patterns:
• Clean Architecture (Use Cases, Domain Models)
• MVVM Pattern (ViewModels for each feature)
• Dependency Injection (Instance Provider)
• Repository Pattern (Data Access)
• Observer Pattern (Keyboard and Pasteboard)