How wilsonckm/runtracker works
Overall Architecture and Main Components
• Application Core (RunTracker): Represent the Xcode project as the overall application boundary. Inside, break down the system into major layers:
• User Interface Layer
• Domain/Business Logic Layer
• Helpers/Utilities
• External Frameworks/Services
And Break Down the Components
a. User Interface (UI) / Presentation Layer:
• Views: Look inside the “Views” directory which includes various view types such as HomeView, HistoryView (with subcomponents like RunListView, RunListCell, RunDetailView), RunView (with NewRun, RunSummaryView), Onboarding, and Profile.
• MapView: This view displays the tracked route using MapKit.
b. Domain/Model Layer:
• Models: Located in the “Model” folder including files like Run.swift, Coordinates.swift, and LocationManager.swift.
• These classes capture and manage the core data related to the run tracking.
• Integration with frameworks: Clearly indicate that LocationManager uses CoreLocation to capture sensor data, and MapView leverages MapKit for visualizing the route.
c. Helpers & Components:
• Helpers: Files in the “Helper” directory (StringFormatHelper.swift, TextFormatHelper.swift) to format and manage string/text functionalities.
• Additional business logic components in the “Component” folder (RunStat.swift) which likely computes and encapsulates run statistics.
d. External Frameworks and Libraries:
• CoreLocation: For real-time location tracking.
• MapKit: For displaying the route on a map.
• SwiftData: For local data storage (as mentioned in the README regarding persistence challenges).
• SwiftUI: For building the entire UI.
• Future integration: HealthKit (as described in future updates).
Relationships and Interactions
• That the MapView component in the UI pulls data from the LocationManager and Run Model to build polylines with MapKit.
• Helpers/Components as utility classes that support both the UI and Model (e.g., formatting values, computing statistics).
• Local data storage through SwiftData and mention the decision against a full MVVM separation – note that only aggregate observable objects that provide state are used.
Architectural Patterns and Design Principles
• Although the project originally considered MVVM, the chosen “ModelView” approach means that the user interface directly interacts with observable objects and aggregate models; illustrate this by showing a simplified flow between views and models.
Overall Representation Suggestions
• Notes near each component to explain their roles (e.g., “LocationManager monitors GPS data via CoreLocation”).