Skip to content

Latest commit

 

History

History
117 lines (94 loc) · 3.51 KB

File metadata and controls

117 lines (94 loc) · 3.51 KB

Architecture

Project Structure

The AiteProfiles application follows a layered architecture with clear separation of concerns:

src/
├── Api/                 # HTTP API layer
├── Application/         # Business logic and application services
├── Core/               # Shared utilities and infrastructure
├── Domain/             # Core business entities and logic
├── Runtime/            # System-level services (tray, hotkeys)
├── Services/           # Application services
├── ViewModels/         # MVVM view models
├── Views/              # UI components
└── Models/             # Data transfer objects

Main Layers

1. Presentation Layer (Views/ViewModels)

  • Built with WinUI 3 and MVVM pattern
  • MainWindow.xaml provides the main user interface
  • ProfileListItemViewModel represents individual profiles in the UI
  • TerminalViewModel handles the quick link functionality

2. Application Layer (Application/)

  • Contains business logic and workflows
  • Workers for asynchronous operations
  • Refresh controller for profile scanning

3. Domain Layer (Domain/)

  • Core entities: Profile, ProfileScanRow
  • Chrome service for browser interactions
  • Profile scanning and management logic
  • Contracts for service interfaces

4. Infrastructure Layer (Core/, Runtime/)

  • Configuration management
  • File I/O operations
  • System integration (tray icon, hotkeys)
  • Window management and activation

5. API Layer (Api/)

  • Local HTTP server implementation
  • RESTful endpoints for external integration
  • Token-based authentication

Key Components

MainWindow

The main application window that hosts the UI and manages:

  • System tray integration
  • Global hotkey handling (Ctrl+Shift+4)
  • Window positioning and animation
  • Application lifecycle management

ProfilesStore

Central data store for profile information:

  • Caches profile data for performance
  • Manages favorite profiles
  • Handles profile search and lookup
  • Persists user preferences

ChromeService

Manages all Chrome-related operations:

  • Profile scanning in Chrome user data directory
  • Launching Chrome with specific profiles
  • Opening URLs in profiles
  • Specialized actions (Gmail, Drive, etc.)

LocalHttpServer

Provides RESTful API for external integration:

  • Runs on localhost only (security measure)
  • Token-based authentication
  • Profile listing and launching endpoints

TrayIconService

Manages system tray presence:

  • Shows/hides application window
  • Provides context menu options
  • Maintains persistent presence

GlobalHotkeyService

Handles global keyboard shortcuts:

  • Registers Ctrl+Shift+4 for window toggle
  • Cross-platform hotkey abstraction

Component Interactions

  1. Startup Sequence:

    • App initializes services and checks for single instance
    • Chrome availability is verified
    • HTTP API server starts with generated token
    • MainWindow is displayed with system tray icon
  2. Profile Management:

    • ChromeService scans profile directories
    • ProfilesStore caches and manages profile data
    • UI displays profiles through ViewModels
    • User actions trigger ChromeService methods
  3. API Integration:

    • LocalHttpServer validates tokens
    • Requests are routed to ProfilesApiService
    • Actions are executed through ChromeService
    • Responses are formatted and returned
  4. Runtime Services:

    • TrayIconService provides system integration
    • GlobalHotkeyService enables quick access
    • SingleInstanceService prevents multiple instances

Source of truth

  • src/