Created: March 3, 2025
Last Updated: July 21, 2025
Version: 2.2.0
iOS Target: 16.0+
Xcode: 17+
Swift: 5.10
HomeAssistantPro is a modern SwiftUI-based iOS application designed for smart home enthusiasts. Built with MVVM + Clean-DI architecture and 2025 iOS design principles, it features glassmorphism effects, responsive design, comprehensive design system, and real-time communication capabilities.
- π Home Dashboard: Curated smart home case studies with demo video player
- π¬ Community Forum: Discussion platform with hot topics, categories, and post creation/editing
- π§ Tech Support Chat: Real-time WebSocket chat with typing indicators and message management
- βοΈ Settings Hub: Profile management, theme switching, and app preferences
- β¨ Splash Screen: Modern glassmorphism launch screen with floating animations
- π― Intro Experience: Beautiful onboarding flow for new users
- π Authentication: Anonymous/registered login with persistent session management
- π Dark Mode: Automatic light/dark theme switching with adaptive colors
- π± Responsive Design: Device-adaptive layouts for compact/regular/large screen sizes
- β¨ Glassmorphism: Modern iOS design aesthetics with blur effects
- π¨ Design System: Centralized DesignTokens.swift for colors, spacing, typography
- β‘ Smooth Animations: Fluid spring transitions with haptic feedback integration
- πͺ Floating Elements: Dynamic orbs and animated gradient backgrounds
- βΏ Accessibility: VoiceOver support and Dynamic Type scaling
- ποΈ MVVM + Clean-DI: Architecture with dependency injection using @Environment
- π§ Modular Components: Reusable UI components with standardized styling
- π Responsive Layouts: Three-tier device size system (compact/regular/large)
- π― Type Safety: Comprehensive Swift 5.10 type system with async/await
- π Network Layer: URLSession-based API client with HMAC-SHA256 authentication
- π Security: Keychain-based device identification and UserDefaults caching
- β‘ Performance: BackgroundDataPreloader with CacheManager for optimized loading
- π Real-time: WebSocket integration with SocketIO for live chat features
- Xcode 17+
- iOS 16.0+ deployment target
- Swift 5.10+
- macOS Sonoma 14.0+
- Swift Package Manager (SPM)
# Clone the repository
git clone https://github.com/lipeng1667/HomeAssistantPro.git
cd HomeAssistantPro
# Open in Xcode
open HomeAssistantPro.xcodeproj
# Build and run (β+R)
HomeAssistantPro/
βββ HomeAssistantProApp.swift # App entry point with splash screen logic
βββ π§ ViewModels/
β βββ AppViewModel.swift # Global app state & authentication
β βββ AnonymousRestrictionViewModel.swift # Anonymous user access management
β βββ ImageViewerModal.swift # Image viewing modal state
βββ π οΈ Utils/
β βββ DesignTokens.swift # Complete design system (colors, spacing, typography)
β βββ AnimationPresets.swift # Consistent spring animations
β βββ HapticManager.swift # Haptic feedback patterns
β βββ SharedButtonStyles.swift # Unified button behaviors
β βββ KeyboardDismissModifier.swift # Keyboard handling utilities
β βββ LocalizationManager.swift # Multi-language support
β βββ DateUtils.swift # Date formatting utilities
β βββ PhoneNumberUtils.swift # Phone number validation
βββ π₯οΈ Views/
β βββ SplashView.swift # Glassmorphism splash with floating orbs
β βββ Components/
β β βββ MainTabView.swift # Tab navigation controller
β β βββ StandardTabHeader.swift # Unified headers with glassmorphism
β β βββ StandardTabBackground.swift # Animated gradient backgrounds
β β βββ GlassmorphismCard.swift # Glass effect cards
β β βββ CustomConfirmationModal.swift # Configurable confirmation modals
β β βββ ReviewStatusBadge.swift # Post status indicators
β βββ HomeView.swift # Home dashboard with video player
β βββ Forum/
β β βββ ForumView.swift # Community forum with categories
β β βββ TopicDetailView.swift # Forum topic details with replies
β β βββ CreatePostView.swift # Post creation interface
β β βββ EditReplyView.swift # Reply editing interface
β βββ ChatView.swift # Real-time WebSocket chat
β βββ SettingsView.swift # Settings & profile management
β βββ Login/
β β βββ AuthenticationView.swift # Main auth flow controller
β β βββ LoginView.swift # Login interface
β β βββ RegisterView.swift # Registration interface
β βββ IntroView.swift # Onboarding flow
βββ π Services/
β βββ APIClient.swift # HMAC authenticated HTTP client
β βββ ForumService.swift # Forum API integration
β βββ IMService.swift # Chat messaging service
β βββ SocketManager.swift # WebSocket connection manager
β βββ SettingsStore.swift # UserDefaults + Keychain wrapper
β βββ BackgroundDataPreloader.swift # Performance optimization service
β βββ CacheManager.swift # Memory caching system
βββ π¦ Models/
β βββ AuthModels.swift # Authentication request/response models
β βββ ForumModels.swift # Forum post and topic models
β βββ IMModels.swift # Chat message models
β βββ LocalVideoAssets.swift # Video player models
βββ π¬ Components/
β βββ VideoPlayer/
β βββ VideoPlayerView.swift # Main video player component
β βββ LocalVideoPlayer.swift # Local video playback
β βββ FullscreenVideoModal.swift # Fullscreen video modal
βββ ποΈ Legacy/
β βββ AppDelegate.swift # Legacy app delegate
βββ π§ͺ Tests/
βββ HomeAssistantProTests/ # Unit tests
βββ SettingsStoreTests.swift # Settings store test suite
βββ HomeAssistantProUITests/ # UI tests
The foundation of our design system providing:
- Adaptive Colors: Automatic light/dark mode switching with brand colors
- Responsive Spacing: Three-tier device system (compact/regular/large)
- Typography Scale: Device-aware font sizing with responsive scaling
- Shadow Presets: Elevation system with adaptive opacity
- Device Detection: Screen size categorization and responsive utilities
- StandardTabHeader: Unified header with glassmorphism background
- StandardTabBackground: Animated gradient backgrounds with floating orbs
- GlassmorphismCard: Material design cards with blur effects
- CustomConfirmationModal: Themed confirmation dialogs (.destructive/.primary/.success)
- ReviewStatusBadge: Post status indicators with color coding
- VideoPlayerView: Full-featured video player with fullscreen support
// Brand Colors
primaryPurple #8B5CF6 // Home tab, primary actions
primaryCyan #06B6D4 // Forum tab, secondary actions
primaryGreen #10B981 // Chat tab, success states
primaryAmber #F59E0B // Settings tab, warning states
// Adaptive Backgrounds (Light β Dark)
backgroundPrimary #FAFAFA β #0F0F0F
backgroundSecondary #F8FAFC β #1A1A1A
backgroundTertiary #F4F4F5 β #262626
Device Categories:
- Compact (<385pt width): iPhone SE, mini series - base spacing
- Regular (385-415pt width): iPhone standard models - enhanced spacing
- Large (>415pt width): iPhone Plus/Pro Max - maximum spacing
Responsive Spacing Examples:
- contentMargins(): 16pt β 20pt β 24pt
- responsivePadding(): 12pt β 16pt β 20pt
- Section spacing: 24pt β 28pt β 32pt
// DesignTokens.ResponsiveTypography
headingLarge: 28pt β 32pt β 36pt
headingMedium: 24pt β 26pt β 28pt
bodyLarge: 18pt β 19pt β 20pt
bodyMedium: 16pt β 17pt β 18pt
bodySmall: 14pt β 15pt β 16pt
caption: 12pt β 13pt β 14pt
// Package.swift - Swift Package Manager
dependencies: [
.package(url: "https://github.com/socketio/socket.io-client-swift", from: "16.0.0")
]
# Debug build
xcodebuild -project HomeAssistantPro.xcodeproj -scheme HomeAssistantPro -destination 'platform=iOS Simulator,name=iPhone 15 Pro' build
# Release build
xcodebuild -project HomeAssistantPro.xcodeproj -scheme HomeAssistantPro -configuration Release -destination 'platform=iOS Simulator,name=iPhone 15 Pro' build
# Run unit tests
xcodebuild test -project HomeAssistantPro.xcodeproj -scheme HomeAssistantPro -destination 'platform=iOS Simulator,name=iPhone 15 Pro'
# Run UI tests
xcodebuild test -project HomeAssistantPro.xcodeproj -scheme HomeAssistantProUITests -destination 'platform=iOS Simulator,name=iPhone 15 Pro'
- SwiftLint: Enforced strict code style and best practices
- swift-format: Auto-formatting with Google style guidelines
- Type Safety: Comprehensive Swift 5.10 type system usage
- MVVM + Clean-DI: Clear separation with dependency injection
- Async/Await: Structured concurrency, no Combine usage
- os.Logger: Unified logging with subsystem tagging
- Device Identification: UUID-based device ID stored securely in iOS Keychain
- HMAC Authentication: SHA-256 signature validation for all API requests
- Session Management: UserDefaults for state, Keychain for sensitive data
- Anonymous + Registered: Dual authentication modes with permission restrictions
// Service Architecture
APIClient (HMAC Auth) β ForumService/IMService β ViewModels β SwiftUI Views
β³ SocketManager (WebSocket) β Real-time Chat
- APIClient: URLSession-based HTTP client with HMAC-SHA256 authentication
- ForumService: Forum posts, topics, replies API integration
- IMService: Chat messaging service with real-time capabilities
- SocketManager: WebSocket connection management using SocketIO
- BackgroundDataPreloader: Performance optimization with CacheManager
- SettingsStore: UserDefaults + Keychain wrapper for user data
- CacheManager: Memory-based caching with 30-minute expiration
- Automatic Restoration: Persistent login state across app launches
- Permission System: Anonymous users have view-only access restrictions
// DesignTokens.DeviceSize detection
.compact: <385pt width (iPhone SE, mini series)
.regular: 385-415pt (iPhone 12-15 standard)
.large: >415pt width (iPhone Plus/Pro Max series)
- iOS 16.0+: Minimum deployment target (updated from 15.6+)
- iOS 18.0+: Recommended for optimal performance
- Swift 5.10: Latest language features and concurrency
- SwiftUI: Native UI framework with backward compatibility
- Dark Mode: Automatic system theme detection with adaptive colors
- Dynamic Type: Font scaling support for accessibility
- VoiceOver: Screen reader compatibility
- Responsive Layouts: Auto-adapting to screen sizes and orientations
- MVVM + Clean-DI: Structured architecture with dependency injection
- Centralized Design System: DesignTokens.swift eliminates styling inconsistencies
- Background Preloading: 3-second splash screen preloads forum data
- Memory Caching: CacheManager reduces redundant API calls
- Responsive Design: Automatic adaptation across device sizes
- Seamless Authentication: Anonymous and registered modes with session persistence
- Real-time Communication: WebSocket-powered chat with typing indicators
- Glassmorphism UI: Modern iOS design with blur effects and floating animations
- Accessibility First: VoiceOver, Dynamic Type, and responsive layouts
- Haptic Integration: Consistent tactile feedback throughout the app
- π WebSocket Integration: Real-time chat with SocketIO and typing indicators
- πΉ Video Player: Full-featured video player with fullscreen modal support
- π¨ Enhanced Components: ReviewStatusBadge and improved forum interfaces
- π± Chat System: Complete instant messaging with message management
- β‘ Performance: BackgroundDataPreloader with CacheManager optimization
- π Network Integration: Complete API authentication with backend server
- π Dual Authentication: Anonymous and registered login modes
- π Security: HMAC-SHA256 authenticated requests with device identification
- πΎ Session Persistence: Automatic login state restoration via SettingsStore
- π¨ Confirmation System: CustomConfirmationModal with themed variants
- β¨ Design System: Complete DesignTokens.swift implementation
- π Dark Mode: Adaptive color system with light/dark switching
- π± Responsive Design: Three-tier device size system (compact/regular/large)
- πͺ Glassmorphism: Modern UI with blur effects and floating animations
- ποΈ Architecture: MVVM + Clean-DI with dependency injection
- ποΈ Foundation: Initial MVVM architecture setup
- π¬ Onboarding: Complete intro flow and authentication system
- π± Navigation: Four-tab app structure with SwiftUI
- π Authentication: Basic login and anonymous mode implementation
This project is licensed under the MIT License. See LICENSE.md for details.
Michael Lee
- Created: March 3, 2025
- Architecture: MVVM + SwiftUI
- Design: Modern iOS 2025 aesthetics