A native SwiftUI breathing companion with a quit-vaping dashboard, habit tracking, meditation timers, and optional community features.
Start with a quiet, local breathing pause. Clone the project, run it in the iOS Simulator, and follow a four-second inhale / six-second exhale cycle. The public checkout works without a Firebase project or model credentials.
Quick start · How it works · Cloud setup · Contributing
- Take a breathing break. A timed visual guide gives you a small, focused interaction without an account. It respects Reduce Motion.
- Build a native wellness interface. Reuse the SwiftUI breathing sphere, tab navigation, onboarding, charts, and ambient audio views in your own app.
- Study a larger app flow. The optional Firebase configuration opens the original dashboard, quit-date tracking, favorites, anonymous community chat, and leaderboard implementation.
The breathing preview is the default runnable experience. The connected features are a development foundation that requires your own services and access rules. The health estimates and optional AI conversation are not clinically validated; the app is not medical care.
You need macOS, Xcode with a Swift 6.1+ toolchain (tested with Xcode 26.6), and an installed iOS Simulator runtime. The app targets iOS 17+ and uses Swift Package Manager. The first build downloads its Firebase dependencies.
git clone https://github.com/HarshyChoc/BreathApp.git
cd BreathApp
open BreathApp.xcodeprojIn Xcode, select the BreathApp scheme and an iPhone simulator, then choose Product → Run. Press Start a breathing pause to begin and Finish pause to stop.
The checked-in Xcode project is ready to open. Signing is unnecessary for a simulator; running on your own device requires selecting your development team and a unique bundle identifier.
| Part | Responsibility |
|---|---|
BreathAppApp.swift |
Selects the local preview or connected app based on whether a Firebase configuration is bundled. |
Views/LocalWelcomeView.swift |
Local breathing interaction and deterministic ten-second cycle. |
Views/BreathingSphereView.swift |
Reusable breathing visualization. |
ContentView.swift, Views/ |
Dashboard, onboarding, meditation, statistics, and navigation. |
OnboardingStore.swift, AnalyticsModel.swift |
Local preferences and progress data. |
FirebaseAuthManager.swift, FirebaseMessagingService.swift |
Optional anonymous authentication and Firestore community messages. |
Services/LeaderboardService.swift |
Optional profile synchronization and leaderboard data. |
OpenAIClient.swift |
Optional chat experiment; development credentials are accepted only in debug launch environments. |
project.yml |
Reproducible Xcode project configuration, with Firebase pinned to 12.18.0. |
No GitHub Actions, deployment pipeline, or hosted demo is configured. Builds and tests run on your Mac.
This section is optional. The local breathing preview needs none of it.
- Create your own Firebase project and register an iOS app whose bundle ID matches your Xcode target (
dev.harshy.breathappby default). - Enable Authentication → Anonymous and create a Cloud Firestore database for your development project.
- Put your downloaded
GoogleService-Info.plistin the localBreathApp/directory. This file is ignored by Git. Add it to the BreathApp target's resources in Xcode, or regenerate the project with XcodeGen after adding the file. - Define and test Firestore access rules before enabling community writes. The original implementation uses
community_messages,votes,user_profiles, andleaderboard_top10. Message ownership and user profiles must be tied to the authenticated UID. Aggregate vote counts and leaderboard writes need a trusted service or carefully tested transaction rules; broad authenticated-user write access is not a safe production policy. - Run the app again. With your configuration present, it opens the original onboarding/dashboard flow and attempts anonymous authentication.
The repo does not provide a deployed backend, production moderation, validated Firestore rules, or a working purchase service. The lifetime-offer screen is a UI prototype. Connecting a Firebase project alone does not make those pieces production-ready.
The breathing preview does not initialize or call a model. The connected app includes a chat experiment that requires separate configuration. Its existing client accepts OPENAI_API_KEY from the debug process environment only. Use a private, unshared Xcode run scheme if experimenting locally, and be aware that sending a message can incur your provider's charges.
Never put a provider secret in Info.plist, source files, the app bundle, or a shared scheme. Release builds deliberately reject direct client credentials. A distributed chat feature requires an authenticated backend that keeps provider credentials server-side. No such backend is included here.
The connected app stores onboarding and progress preferences locally and can send community/profile data to your Firebase project. Chat content is sent to the model provider only when that optional feature is configured and used. Use synthetic data while evaluating the connected implementation.
Meditation and relaxation timers work as silent sessions. The original MP3s are excluded because their redistribution licenses could not be verified; they are not covered by this release's MIT license.
To use your own recordings or properly licensed replacements, create a local BreathApp/LocalSounds/ directory and add files with the base names meditation, campfire, ocean_waves, or rainstorm using .mp3, .wav, or .m4a. Run xcodegen generate to include them in your local target. This directory is ignored by Git. Keep the applicable attribution/license with any audio you later choose to distribute.
To regenerate the Xcode project after changing project.yml, install XcodeGen and run:
xcodegen generateBuild locally without signing:
xcodebuild build \
-project BreathApp.xcodeproj \
-scheme BreathApp \
-destination 'generic/platform=iOS Simulator' \
CODE_SIGNING_ALLOWED=NORun the focused breathing-cycle tests with an installed simulator. Use xcrun simctl list devices available to find its UUID:
xcodebuild test \
-project BreathApp.xcodeproj \
-scheme BreathApp \
-destination 'platform=iOS Simulator,id=YOUR_SIMULATOR_UUID' \
-parallel-testing-enabled NO \
CODE_SIGNING_ALLOWED=NOValidated locally with Xcode 26.6 and an isolated iOS 26.5 Simulator: the app built, the local preview launched, and both breathing-cycle tests passed. Tests cover phase boundaries and invalid clock values. Connected Firebase, model, purchase, and physical-device flows require separate validation with your own configuration.
MIT, copyright Harsh Shah. Preserve dependency and third-party asset notices when reusing their materials. The repository cover is original illustrative artwork; see artwork provenance.
