Near-real-time river flow monitoring for iOS & macOS
A complete reboot of the original GaugeWatcher, rebuilt from scratch to explore iOS 26, macOS 26, and SwiftData alternatives.
Features β’ GaugeBot AI β’ Installation β’ Architecture β’ Contributing
Warning
This is very much a work in progress and the macOS app has thus far been the primary focus. There will be bugs, incomplete features, and other issues. Please report them!
|
Access water flow data from agencies worldwide:
|
Chat with an on-device AI assistant powered by Apple Intelligence:
|
|
|
GaugeBot is an on-device AI chat assistant powered by Apple Intelligence and the Foundation Models framework.
See GaugeBot Tools to see the available tools.
| What You Can Ask | Example Prompts |
|---|---|
| Search Gauges | "Find gauges on the Arkansas River" β’ "What gauges are in Colorado?" |
| Check Favorites | "Show me my favorite gauges" β’ "What are my saved stations?" |
| Get Information | Ask about specific rivers, locations, or gauge data |
| Requirement | Details |
|---|---|
| Platform | iOS 26.0+ / macOS 26.0+ (Apple Silicon) |
| Apple Intelligence | Must be enabled on your device |
| Language Model | Downloads automatically when Apple Intelligence is enabled |
Note
GaugeBot runs entirely on-device using Apple's Foundation Models framework. No data is sent to external AI services β all processing happens locally.
GaugeBot is currently available on iOS and macOS. The feature gracefully degrades on unsupported devices or when Apple Intelligence is not enabled, showing helpful guidance on how to enable it.
| Tool | Version |
|---|---|
| iOS | 26.0+ |
| macOS | 26.0+ |
| Xcode | 26.0+ |
| Swift | 6.0+ |
| Docker | Latest |
| openapi-generator | For forecast server Swift client |
# Clone the repository
git clone https://github.com/drewalth/gauge-watcher.git
cd gauge-watcher
# Copy environment template
cp .env.example .env
# Run setup
./scripts/setup.sh
# Open in Xcode
xed .Analytics (Optional)
Edit .env and add your PostHog credentials:
POSTHOG_API_KEY=phc_your_api_key_here
POSTHOG_HOST=https://us.i.posthog.comThe app works without analytics configured β telemetry will simply be disabled.
Development Team Setup
Before building, set your Apple Development Team:
- Open the project in Xcode
- Select the
GaugeWatchertarget - Go to Signing & Capabilities
- Select your Development Team from the dropdown
Flow Forecast Server (Optional)
The app includes a flow forecasting feature for USGS gauges that requires a local Python server.
cd server/flow-forecast
./run.shThe server runs on http://localhost:8000 by default. If you don't run the forecast server, the app will still work β the forecast feature will simply show as unavailable.
If you run into an issue loading the
FlowForecastSwift package, runmake generate_clientsfrom theserver/flow-forecastdirectory to regenerate the Swift client.
- swift-composable-architecture β App architecture
- SQLiteData β Database layer
- Custom local packages for modularity (GaugeSources, GaugeDrivers, AppTelemetry, UIAppearance)
| Platform | Scheme | Command |
|---|---|---|
| iOS | GaugeWatcher |
βR in Xcode |
| macOS | GaugeWatcherMac |
βR in Xcode |
The macOS app features a sidebar/detail layout with an interactive full-screen map.
| Script | Description |
|---|---|
./scripts/test.sh |
Run all tests |
./scripts/format.sh |
Format and lint code |
./scripts/lint.sh |
Run linter only |
./scripts/check-leaks.sh |
Check for secrets/leaks |
The app follows The Composable Architecture (TCA) pattern with unidirectional data flow.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Applications β
ββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ€
β GaugeWatcher β GaugeWatcherMac β
β (iOS App) β (macOS App) β
ββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββ΄βββββββββββββββ
β SharedFeatures β
β (Cross-platform TCA) β
ββββββββββββββββ¬βββββββββββββββ
β
ββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββ
β β β
βββββββββ΄ββββββββ ββββββββββ΄βββββββββ ββββββββββ΄βββββββββ
β GaugeSources β β GaugeDrivers β β GaugeService β
β (Definitions)β β (API Clients) β β (Data Layer) β
βββββββββββββββββ βββββββββββββββββββ ββββββββββ¬βββββββββ
β
ββββββββββ΄βββββββββ
β AppDatabase β
β (SQLite) β
βββββββββββββββββββ
- Repository pattern for data access (GaugeService, GaugeSourceService)
- Driver pattern for API integrations (one driver per data source)
- Dependency injection via TCA's dependency system
View all modules
| Module | Responsibility |
|---|---|
| GaugeWatcher | Main iOS app container, features, and UI |
| GaugeWatcherMac | Native macOS app with NavigationSplitView layout |
| SharedFeatures | Cross-platform TCA reducers and state management |
| GaugeSources | Static gauge definitions, state/province configs |
| GaugeDrivers | Network clients for each provider's API |
| GaugeService | Database queries, data sync, business logic |
| AppDatabase | SQLite schema definitions using SQLiteData |
| AppTelemetry | Event tracking and analytics abstraction |
| UIAppearance | Design system components, colors, and assets |
| UIComponents | Reusable SwiftUI view components |
| Suite | Coverage |
|---|---|
GaugeDriversTests |
API driver tests |
GaugeSourcesTests |
Gauge data parsing |
GaugeWatcherTests |
iOS app integration |
GaugeWatcherMacTests |
macOS app integration |
SharedFeaturesTests |
Cross-platform features |
# Test all packages
./scripts/test.sh
# Test individual packages
swift test --package-path ./GaugeSources
swift test --package-path ./GaugeDriversContributions are welcome! Feel free to open an issue or pull request.
Note
This is a small hobby project β mostly an excuse to learn new things. If you're interested in projects with real-world impact, consider contributing to American Whitewater, Whitewater NZ, or BC Whitewater.
Install gitleaks to check for secrets before pushing changes.
- Add gauge definitions to
GaugeSources/Sources/GaugeSources/Resources/ - Implement a new driver in
GaugeDrivers/Sources/GaugeDrivers/ - Extend
GaugeDrivers.swiftunified API - Add comprehensive tests for your driver
- Update documentation
| Provider | Documentation |
|---|---|
| USGS | waterservices.usgs.gov |
| Environment Canada | dd.weather.gc.ca |
| Colorado DWR | dwr.state.co.us/Tools |
| LAWA | lawa.org.nz |
- @ajbonich β Initial forecasting server implementation
- @ngottlieb β Canadian gauge data guidance
Made with β for paddlers everywhere
