Skip to content

mit112/StreakSync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

138 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StreakSync Icon

StreakSync

Track your daily puzzle game streaks, compete with friends, and never lose a streak again.

Download on the App Store

iOS 26 Swift 6 SwiftUI Firebase MVVM 335 Tests


StreakSync is a native iOS app for tracking daily puzzle game streaks across 15 built-in games including Wordle, Connections, Strands, LinkedIn Queens, and more. Share your game results using the iOS Share Extension, and StreakSync automatically parses scores, tracks streaks, unlocks achievements, and lets you compete with friends on real-time leaderboards.

Why This Project

This isn't a tutorial app — it's a production-grade iOS application built from scratch with real architectural complexity:

  • Share Extension ingestion pipeline that parses unstructured text from 15 supported games into structured data
  • Real-time social features with Firestore snapshot listeners, friend codes, and daily leaderboards
  • Tiered achievement system (Bronze → Diamond) with particle effects and celebration animations
  • Analytics engine with interactive charts, trend analysis, and CSV export
  • Smart notification scheduling that learns when you play and reminds you at the right time
  • Security-hardened Firestore rules with field validation, ownership checks, and a 100-case penetration test suite
  • 335 unit and UI tests covering streak logic, sync merge, game detection, analytics computation, and more
  • CI pipeline via GitHub Actions with automated build + test on every push

Features

Streak Tracking — Automatic streak detection and maintenance for every supported game. Smart streak logic handles safe skip days, missed days, and edge cases across time zones.

Share Extension — Share your game results from any app. StreakSync parses the shared text, detects the game, extracts your score, and updates your streaks — all without leaving the source app.

Friends & Leaderboards — Add friends via 6-character friend codes. Real-time leaderboards powered by Firestore snapshot listeners show daily scores across all games, with streak badges and "hasn't played yet" sections.

Tiered Achievements — Bronze → Silver → Gold → Diamond progression across 10 achievement categories (Streak Master, Game Collector, Daily Devotee, Variety Player, and more). Unlock celebrations with particle effects and confetti.

Analytics Dashboard — Completion rates, streak trends, personal bests, weekly summaries, and deep-dive stats for specific games. Interactive charts with export to CSV.

Smart Reminders — Analyzes your play history to suggest the optimal reminder time. Learns when you typically play and nudges you before your usual window.

Account Management — Sign in with Apple for identity, with full account deletion flow (App Store requirement). Anonymous auth for frictionless onboarding with credential linking when ready.

Guest Mode — Let a friend try the app on your device without affecting your data. Snapshots and restores your state seamlessly.

Supported Games

15 built-in games with dedicated parsers, plus support for custom game tracking:

NYT Games LinkedIn Games Other
Wordle Queens Quordle
Connections Tango Octordle
Spelling Bee Crossclimb Nerdle
Mini Crossword Pinpoint Pips
Strands Zip
Mini Sudoku

Each game has a dedicated parser that extracts scores, attempts, completion time, or hints from the shared result text. Custom games can also be added manually.

Architecture

StreakSyncApp (@main)
 └─ AppContainer (DI container)
      ├─ AppState (@Observable) ─── Core data store + 7 focused extensions
      ├─ NavigationCoordinator ──── Tab-based navigation with per-tab stacks
      ├─ FirebaseSocialService ──── Friends, leaderboards, real-time listeners
      ├─ FirebaseAuthStateManager ─ Apple Sign-In + anonymous auth linking
      ├─ AnalyticsService ───────── Computed stats with fingerprint cache
      ├─ NotificationCoordinator ── Share extension + deep link handling
      ├─ GameCatalog (@Observable)─ Game registry + favorites
      └─ ... (haptics, sound, persistence, sync)

Key patterns:

  • MVVM with a centralized AppContainer for dependency injection — no service locators, no singletons for business logic
  • Protocol-oriented servicesSocialService protocol backed by FirebaseSocialService (production) and MockSocialService (testing)
  • Swift Concurrencyasync/await throughout, GameResultIngestionActor for thread-safe share extension processing, structured concurrency with async let in analytics
  • @Observable (Swift Observation framework) for AppState and GameCatalog
  • Extension-based decompositionAppState split into 7 focused files (GameLogic, Persistence, Achievements, Reminders, etc.)
  • Pure computation extractionAnalyticsComputer and TieredAchievementChecker are testable structs with zero UI dependencies
  • Security-first Firestore rules — field validation, ownership enforcement, allowedReaders arrays for score privacy, with a 100-case penetration test suite

Project Structure

StreakSync/
├── App/                          # Entry point, DI container, app delegate
├── Core/
│   ├── State/                    # AppState + 7 extensions
│   ├── Models/                   # Game, GameResult, Streak, Achievement, Social models
│   ├── Services/                 # Firebase, notifications, analytics, persistence, sync
│   ├── Errors/                   # Typed error system (AppError)
│   └── Utilities/
├── Design System/                # Colors, haptics, animations, sound
├── Features/
│   ├── Dashboard/                # Home tab — streak overview, search, filters
│   ├── Friends/                  # Leaderboards, friend management
│   ├── Achievement/              # Tiered achievements grid, celebrations
│   ├── Analytics/                # Charts, trends, deep dives, CSV export
│   ├── Games/                    # Game detail, result history, management
│   ├── Settings/                 # Account, notifications, appearance
│   ├── Streaks/                  # All streaks view, streak history
│   └── Shared/                   # Reusable components (GradientAvatar, GameIconCarousel)
├── StreakSyncShareExtension/     # iOS Share Extension for result import
├── StreakSyncTests/              # 325 unit tests across 24 files
└── StreakSyncUITests/            # 10 UI tests for launch + navigation

165 Swift source files · ~31k lines of production code · 26 test files

Tech Stack

Layer Technology
UI SwiftUI (iOS 26, Liquid Glass)
Architecture MVVM + DI Container
State Swift Observation (@Observable)
Concurrency Swift Concurrency (async/await, actors)
Backend Firebase (Firestore, Auth)
Auth Sign in with Apple + anonymous auth linking
Storage UserDefaults + App Group + Keychain
Notifications UNUserNotificationCenter with smart scheduling
Linting SwiftLint (strict mode)
Testing XCTest (335 tests)
CI GitHub Actions

Security

  • Firestore security rules enforce ownership, field validation, string size limits, and allowedReaders arrays for score privacy
  • 100-case penetration test suite (firestore-rules-tests/) validates all rules against attack vectors including hijacking, spoofing, enumeration, and privilege escalation
  • Friendship rules prevent arbitrary modification — only sender creates, only recipient accepts, user IDs are immutable after creation
  • Account deletion flow removes all user data across 6 Firestore collections (App Store requirement)
  • Sensitive data stored in Keychain (not UserDefaults)
  • Firebase credentials excluded from version control via .gitignore
  • Privacy manifest (PrivacyInfo.xcprivacy) declares all API usage

Getting Started

The app is live on the App Store: StreakSync — Puzzle Tracker

To build from source:

Prerequisites

  • Xcode 26+
  • iOS 26.0+ deployment target
  • Firebase project (Firestore + Auth)
  • Apple Developer account (for Sign in with Apple + Share Extension)

Setup

  1. Clone the repository

    git clone https://github.com/mit112/StreakSync.git
    cd StreakSync
  2. Add your Firebase configuration

    cp StreakSync/GoogleService-Info.example.plist StreakSync/GoogleService-Info.plist
    # Fill in your Firebase project values, or download from Firebase Console
  3. Deploy Firestore rules and indexes

    firebase deploy --only firestore:rules,firestore:indexes
  4. Open StreakSync.xcodeproj in Xcode, build and run (iOS 26+)

Testing

335 tests across 26 files:

Test Suite Tests Coverage
AchievementCheckerTests + Extended 66 All 10 achievement categories, edge cases, sync merge
GameResultParserTests + Games 44 Per-game result parsing for all 15 supported games
AnalyticsComputerTests + Extended 41 All pure analytics computation functions
LeaderboardScoringTests 23 All 5 scoring models + metric labels
EditGameResultTests 22 Result editing flows, validation, persistence
GameDetectionTests 21 Share extension game detection across all games
SocialModelTests 18 UserProfile, Friendship, DailyGameScore, date encoding
StreakLogicTests 16 Core streak calculation and safe skip edge cases
SyncMergeTests 14 Conflict resolution across sync merge scenarios
NotificationContentTests 13 Notification content builder for all result types
AuthProviderDerivationTests 9 Auth provider detection + anonymous→Apple upgrade
NormalizeStreaksTests 9 Streak normalization edge cases
PendingSaveStoreTests 6 Offline Keychain queue for score retry
LoadAndAchievementsTests 4 App load + achievement recompute on cold start
SyncServiceConversionTests 5 Firestore ↔ local model round-trip conversion
ShareExtensionIngestionTests 3 End-to-end share extension pipeline
NotificationSchedulingDateTests 3 Smart reminder date calculation
FriendsViewModelTests 2 Friend management view model state
GameUUIDUniquenessTests 2 Deterministic UUID collision prevention
NotificationPermissionFlowTests 2 Permission request flow
SocialSettingsServiceTests 2 Social settings persistence
UI Tests 10 Launch, tab navigation, accessibility
# Run tests via Xcode
⌘+U

# Or via command line
xcodebuild test -project StreakSync.xcodeproj -scheme StreakSync \
  -destination 'platform=iOS Simulator,name=iPhone 17 Pro Max'

# Run Firestore rules tests
cd firestore-rules-tests
firebase emulators:start --only firestore &
node firestore.rules.test.mjs

License

This project is available under the MIT License. See LICENSE for details.

About

Native iOS app for tracking daily puzzle game streaks (Wordle, Connections, Strands + more). Share Extension, real-time leaderboards, tiered achievements.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors