Create a SwiftUI Habit Tracker app using SwiftData with the following features:
-
Data Model:
- Habit: name, color, creation date, target frequency (daily/weekly)
- HabitLog: date completed, relationship to Habit
- Use SwiftData for persistence
-
Main Features:
- List view showing all habits with completion status for today
- Ability to mark habits as complete/incomplete for today
- Visual indicator (checkmark or circle) for completion
- Display current streak for each habit
- Color-coded habits using SF Symbols or colored circles
-
Add/Edit Habits:
- Sheet to create new habits
- Choose habit name, color, and frequency
- Simple form-based UI
-
Detail View:
- Show habit history (last 7-14 days)
- Display total completions and current streak
- Calendar-style view showing completion pattern
Use modern SwiftUI architecture with proper separation of concerns. Follow Apple's SwiftData best practices. Include sample data for testing.