student-timekeeper-ios

DreamLauncherLite iOS - Complete Documentation

πŸ“š Documentation Index

This folder contains complete documentation for the new, streamlined iOS app that replaces the bloated dreamlauncher-ios.

Core Documents

  1. STREAMLINED_IOS_APP_PLAN.md
    • Executive summary and rationale
    • Complete architecture overview
    • Feature breakdown
    • Implementation phases (5 weeks)
    • Data models and API integration
    • Comparison with student-time-tracker
  2. IOS_APP_TECHNICAL_SPEC.md
    • Detailed code specifications
    • Complete service implementations
    • View and ViewModel patterns
    • Core Data schema
    • API client implementation
    • Storage layer design
    • ~2,300 lines of code total
  3. IOS_APP_IMPLEMENTATION_CHECKLIST.md
    • Day-by-day implementation plan
    • 30-day timeline to App Store
    • Testing checklist
    • App Store submission guide
    • Troubleshooting section
  4. OLD_VS_NEW_IOS_COMPARISON.md
    • Side-by-side feature comparison
    • Performance metrics
    • Cost analysis
    • Legal compliance comparison
    • Why the old app failed

🎯 Quick Summary

The Problem

The old dreamlauncher-ios app:

The Solution

The new DreamLauncherLite app:


πŸš€ What It Does

One thing: Cross-platform screen time tracking

Core Features

  1. Track iOS screen time using Family Controls
  2. Sync to cloud via existing dreamlauncher-api
  3. View combined data from iOS + macOS devices
  4. See weekly trends with simple charts
  5. Platform breakdown (how much time on each device)

What It Doesn’t Do


πŸ“‹ Prerequisites

Development Requirements

Existing Infrastructure


πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         iOS App (SwiftUI)               β”‚
β”‚                                         β”‚
β”‚  Views                                  β”‚
β”‚  β”œβ”€β”€ AuthView                           β”‚
β”‚  β”œβ”€β”€ DashboardView                      β”‚
β”‚  └── SettingsView                       β”‚
β”‚                                         β”‚
β”‚  ViewModels                             β”‚
β”‚  β”œβ”€β”€ AuthViewModel                      β”‚
β”‚  └── DashboardViewModel                 β”‚
β”‚                                         β”‚
β”‚  Services                               β”‚
β”‚  β”œβ”€β”€ AuthService                        β”‚
β”‚  β”œβ”€β”€ ScreenTimeService                  β”‚
β”‚  β”œβ”€β”€ SyncService                        β”‚
β”‚  └── APIClient                          β”‚
β”‚                                         β”‚
β”‚  Storage                                β”‚
β”‚  β”œβ”€β”€ KeychainService                    β”‚
β”‚  β”œβ”€β”€ CoreDataStack                      β”‚
β”‚  └── StorageService                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚
              β”‚ HTTPS/REST
              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      dreamlauncher-api (Node.js)        β”‚
β”‚                                         β”‚
β”‚  Endpoints                              β”‚
β”‚  β”œβ”€β”€ POST /apple-auth/sign-in           β”‚
β”‚  β”œβ”€β”€ POST /user-screen-time             β”‚
β”‚  β”œβ”€β”€ GET  /user-screen-time             β”‚
β”‚  └── GET  /user-screen-time/combined    β”‚
β”‚                                         β”‚
β”‚  Database (PostgreSQL)                  β”‚
β”‚  β”œβ”€β”€ users                              β”‚
β”‚  └── user_screen_time                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚
              β”‚ Shared Data
              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      macOS App (student-time-tracker)   β”‚
β”‚                                         β”‚
β”‚  - Displays iOS data                    β”‚
β”‚  - Uploads macOS data                   β”‚
β”‚  - Combined view                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“¦ File Structure

DreamLauncherLite-iOS/
β”œβ”€β”€ DreamLauncherLite/
β”‚   β”œβ”€β”€ App/
β”‚   β”‚   β”œβ”€β”€ DreamLauncherLiteApp.swift
β”‚   β”‚   └── AppDelegate.swift
β”‚   β”œβ”€β”€ Models/
β”‚   β”‚   β”œβ”€β”€ ScreenTimeEntry.swift
β”‚   β”‚   └── User.swift
β”‚   β”œβ”€β”€ Services/
β”‚   β”‚   β”œβ”€β”€ AuthService.swift              (100 lines)
β”‚   β”‚   β”œβ”€β”€ ScreenTimeService.swift        (150 lines)
β”‚   β”‚   β”œβ”€β”€ SyncService.swift              (200 lines)
β”‚   β”‚   └── APIClient.swift                (350 lines)
β”‚   β”œβ”€β”€ ViewModels/
β”‚   β”‚   β”œβ”€β”€ AuthViewModel.swift            (100 lines)
β”‚   β”‚   └── DashboardViewModel.swift       (200 lines)
β”‚   β”œβ”€β”€ Views/
β”‚   β”‚   β”œβ”€β”€ AuthView.swift                 (100 lines)
β”‚   β”‚   β”œβ”€β”€ DashboardView.swift            (300 lines)
β”‚   β”‚   └── SettingsView.swift             (100 lines)
β”‚   β”œβ”€β”€ Storage/
β”‚   β”‚   β”œβ”€β”€ CoreDataStack.swift            (100 lines)
β”‚   β”‚   β”œβ”€β”€ StorageService.swift           (200 lines)
β”‚   β”‚   β”œβ”€β”€ KeychainService.swift          (100 lines)
β”‚   β”‚   └── DreamLauncher.xcdatamodeld
β”‚   β”œβ”€β”€ Extensions/
β”‚   β”‚   β”œβ”€β”€ Date+Extensions.swift          (100 lines)
β”‚   β”‚   └── View+Extensions.swift          (100 lines)
β”‚   β”œβ”€β”€ Config.swift                       (50 lines)
β”‚   └── Info.plist
β”œβ”€β”€ DeviceActivityMonitorExtension/
β”‚   β”œβ”€β”€ DeviceActivityMonitorExtension.swift
β”‚   └── Info.plist
└── DeviceActivityReportExtension/
    β”œβ”€β”€ TotalActivityReport.swift
    └── Info.plist

Total: ~2,300 lines of code across ~20 files

🎯 Implementation Timeline

Week 1: Foundation (5 days)

Deliverable: Working authentication

Week 2: Screen Time (5 days)

Deliverable: Collecting real iOS screen time

Week 3: Sync (5 days)

Deliverable: Data syncing to backend

Week 4: Cross-Platform (5 days)

Deliverable: Shows iOS + macOS data

Week 5: Polish (5 days)

Deliverable: Production-ready app

Week 6: Submission

Deliverable: Live on App Store


πŸ’‘ Key Design Decisions

1. Why No Third-Party Dependencies?

2. Why SwiftUI Only?

3. Why Actor for SyncService?

4. Why Core Data Instead of SQLite?

5. Why No Firebase?


πŸ”’ Privacy & Security

Data Collection

Only collects:

Does NOT collect:

Data Storage

Compliance


πŸ§ͺ Testing

Unit Tests (~80% coverage)

AuthServiceTests
- testAppleSignIn()
- testTokenRefresh()
- testLogout()

StorageServiceTests
- testSaveEntry()
- testFetchUnsynced()
- testMarkSynced()

APIClientTests
- testAuth()
- testUpload()
- testFetch()

SyncServiceTests
- testBatchUpload()
- testRetry()
- testOfflineQueue()

Integration Tests

EndToEndTests
- testAuthToSync()
- testCrossPlatformData()
- testOfflineToOnline()

Manual Tests


🚒 Deployment

App Store Checklist

Launch Strategy

  1. Submit to App Store
  2. Wait for approval (1-3 days)
  3. Soft launch to beta testers
  4. Monitor crashes/feedback
  5. Fix critical bugs
  6. Full public release

πŸ“Š Success Metrics

Technical KPIs

User KPIs

Business KPIs


πŸŽ“ Learning Resources

Apple Documentation

SwiftUI

Best Practices


πŸ€” FAQ

Q: Why build a new app instead of fixing the old one?

A: The old app has too much technical debt and legal issues. Starting fresh is faster and safer.

Q: Can we add [feature X] later?

A: Maybe, but resist feature creep. Keep it simple. Every feature has a cost.

Q: What about Android/Windows?

A: Focus on iOS first. Prove the concept. Then consider other platforms.

Q: Why not use React Native?

A: Native SwiftUI is faster, smaller, more reliable, and better for Family Controls integration.

Q: How do I request Family Controls entitlement?

A: Go to https://developer.apple.com/contact/request/family-controls-distribution and explain your use case.

Q: What if Apple rejects the app?

A: Follow the checklist, be clear about purpose, and provide demo credentials. Should be approved first try.


πŸ› οΈ Troubleshooting

Family Controls not working

Background sync not triggering

API sync failing

Core Data crashes


πŸ“ž Support

Issues

Contributing

This is a personal project, but feedback welcome:


πŸ“ License

This documentation and code are part of the DreamLauncher project. See main project LICENSE for details.


πŸŽ‰ Let’s Ship It!

You have everything you need:

  1. βœ… Complete architecture design
  2. βœ… Detailed technical specs
  3. βœ… Day-by-day implementation plan
  4. βœ… Testing strategy
  5. βœ… Deployment checklist
  6. βœ… Lessons learned from old app

Next step: Create the Xcode project and start Day 1.

Estimated time to App Store: 6-7 weeks

Let’s build something simple, focused, and actually useful! πŸš€



Last updated: January 2025 Version: 1.0 (Pre-development documentation)