How rouzzle/rouzzle_ios works
Project type and purpose
• This is a native iOS mobile application (“Rouzzle_iOS”) built with SwiftUI and the MVVM pattern.
• Purpose: help users build and track daily routines (AddRoutine, Home, Recommend, RoutineTimer, Statistic features), using on-device data storage and local recommendation logic.
High-level architecture and main components
a. App entry point
• Rouzzle_iOSApp.swift – SwiftUI App struct, sets up the DI container (Container.swift) and the root ContentView.
b. Feature modules (each follows MVVM)
• AddRoutine (Model, ViewModel, View)
• Home (Model, ViewModel, View)
• Recommend (Model, ViewModel, View)
• RoutineTimer (Model, ViewModel, View)
• Statistic (View)
c. Shared utilities and services
• Utils/Component – reusable SwiftUI UI components (buttons, alerts, pickers)
• Utils/Emoji – emoji picker components and view model
• Utils/Functions – pure helper functions (string conversion, statistics utils)
• Utils/Global – service implementations (QuotesProvider, RecommendTaskService, SwiftDataService)
• Utils/Protocol – service interfaces for DI (RecommendTaskServiceProtocol, SwiftDataServiceProtocol)
• NotificationManager – schedules local notifications
d. Data & resources
• Resources/RecommendTasks.json, RecommendTodoTasks.json – static recommendation data
• SwiftDataService – core data or SwiftData-backed persistence
• Assets.xcassets / Fonts – UI assets and typography
Relationships and data-flow
• Views bind to their ViewModels (via @StateObject or @ObservedObject).
• ViewModels depend on one or more services (through service protocols) to load/save data, fetch recommendations, provide quotes, schedule notifications.
• Services use JSON files or SwiftDataService for persistence.
• Container.swift wires up these dependencies with a simple DI approach: registers protocol implementations, instantiates view models, injects into root view.
Architectural patterns & principles
• MVVM per feature – clear separation of View, ViewModel, Model
• Service layer – protocols + implementations for data persistence and business logic
• Dependency Injection – Container.swift ensures testability and loose coupling
• SwiftUI + Combine/Publisher extensions for reactive UI updates
• Feature modularization – each feature in its own folder
Essential elements
– Arrowheads on all lines to denote direction of data or control flow.