| title | Dune Moon - Dune-Inspired Moon Phase Tracker | ||||||
|---|---|---|---|---|---|---|---|
| description | iOS app for tracking lunar phases with accurate astronomical calculations and Dune-themed interface | ||||||
| category | overview | ||||||
| version | 1.1.0 | ||||||
| last_updated | 2026-06-15 | ||||||
| tags |
|
||||||
| audience | all | ||||||
| platform | iOS 17.0+ | ||||||
| language | Swift 5.9+ | ||||||
| license | MIT | ||||||
| repository | https://github.com/tholewis/dune-moon |
A beautiful iOS app that tracks lunar phases with a stunning Dune/Arrakis-inspired interface. Built with SwiftUI, Dune Moon combines accurate astronomical calculations with an immersive vintage poster aesthetic.
Quick Links: Documentation Index | Build Guide | GitHub
- Swipe through an infinite scrollable timeline to view moon phases for any date
- Visual day-of-week indicators with color-coded current day
- Smooth animations and intuitive gesture controls
- Real-time moon phase visualization with custom-drawn graphics
- Precise illumination percentage calculations
- Phase names (New Moon, Waxing Crescent, First Quarter, Waxing Gibbous, Full Moon, Waning Gibbous, Last Quarter, Waning Crescent)
- Days until next major phase
- Waxing/waning status indication
- Powered by Apple WeatherKit for location-accurate moonrise/moonset times
- Automatically falls back to the built-in astronomical calculation when WeatherKit is unavailable (offline, not entitled, or for dates outside WeatherKit's forecast window)
- Built-in fallback algorithm accounts for:
- Earth's rotation and orbit
- Moon's declination and right ascension
- Local sidereal time
- Geographic coordinates (from GPS via CoreLocation)
See WeatherKit Integration for how this works, requirements, and attribution.
- Tap the desert planet button to enter an immersive fullscreen experience
- Vintage WPA National Park poster aesthetic inspired by Dune
- Dynamic moon emoji that updates based on current phase
- Beautiful hand-crafted desert landscape illustration featuring:
- Sandworm emerging from dunes
- Settlement (sietch) buildings
- Starry night sky with flowing clouds
- Layered sand dunes
- Language: Swift 6.0
- Framework: SwiftUI
- Minimum iOS: iOS 15.0+
- Architecture: MVVM pattern with reactive state management
- Location Services: CoreLocation for GPS coordinates
- Weather Data: Apple WeatherKit for moonrise/moonset times (with local fallback)
- Graphics: Custom Shape protocols and Canvas API
- iOS 15.0 or later
- Xcode 15.0 or later
- Swift 6.0 or later
- Clone the repository:
git clone https://github.com/tholewis/dune-moon.git
cd dune-moon- Open the project in Xcode:
open DuneMoon.xcodeproj-
Select your target device or simulator
-
Build and run (βR)
The app requires location permissions to calculate accurate moonrise/moonset times. Make sure to add the following to your Info.plist:
<key>NSLocationWhenInUseUsageDescription</key>
<string>Dune Moon needs your location to calculate accurate moonrise and moonset times for your area.</string>Moonrise/moonset times are sourced from Apple WeatherKit, with a local fallback so the app works without any WeatherKit setup. To enable live WeatherKit data you need a paid Apple Developer Program membership and must:
- Enable the WeatherKit service for the explicit App ID (
AlienArchitecture.DuneMoon) in the Apple Developer portal. - Add the WeatherKit capability in Xcode β target β Signing & Capabilities
(writes
com.apple.developer.weatherkittoDuneMoon/DuneMoon.entitlements).
No API keys are required β native WeatherKit authenticates via the entitlement. Service activation can take up to ~30 minutes to propagate. Without this setup the app falls back to its built-in calculation. See WeatherKit Integration for details.
- View Current Moon Phase: Launch the app to see today's moon phase with detailed information
- Browse Timeline: Swipe left or right on the timeline to navigate through dates
- Select a Date: Tap any date in the timeline to view its moon phase details
- Arrakis View: Tap the desert planet button in the top-right to enter the immersive poster view
- Return: Tap anywhere in the Arrakis view to return to the main interface
DuneMoon/
βββ DuneMoonApp.swift # App entry point
βββ ContentView.swift # Main view with timeline and moon display
βββ MoonPhaseCalculator.swift # Astronomical calculation engine (phase + fallback rise/set)
βββ WeatherMoonService.swift # WeatherKit moonrise/moonset + attribution
βββ TimelineView.swift # Horizontal date timeline
βββ PhaseInfoPanel.swift # Detailed phase information panel
βββ ArrakisMoonView.swift # Fullscreen Arrakis poster view
βββ LocationManager.swift # GPS location services
βββ SpiceGlowEffect.swift # Custom visual effects
βββ CalendarGridView.swift # Monthly calendar grid of moon phases
βββ DuneMoon.entitlements # WeatherKit entitlement
βββ Assets.xcassets/
βββ ArrakisPoster.imageset/ # Vintage poster artwork
Dune Moon uses the synodic month (29.53 days) to calculate moon phases based on a reference new moon date. The phase is computed as:
let daysSinceNewMoon = daysBetween(from: referenceNewMoon, to: date)
let phase = (daysSinceNewMoon.truncatingRemainder(dividingBy: synodicMonth)) / synodicMonthMoonrise/moonset times are sourced from Apple WeatherKit when available (location-accurate, requires the WeatherKit entitlement and network). When WeatherKit is unavailable, the app falls back to its built-in astronomical algorithm:
- Calculate Julian Date for the given date/time
- Compute Moon's ecliptic coordinates (longitude, latitude)
- Convert to equatorial coordinates (right ascension, declination)
- Calculate local sidereal time
- Determine hour angle for rise/set events
- Convert to local time accounting for timezone
See WeatherKit Integration for the hybrid data flow, and the docs folder for all technical documentation.
π Start here: Documentation Index - Complete navigation guide to all documentation
Comprehensive developer documentation is available:
- Build & Run Guide - Installation, setup, and deployment instructions
- Documentation Index - Navigation hub for all documentation
- Architecture Guide - MVVM patterns, data flow, state management
- UI Components - SwiftUI views, design system, color palette
- Moon Phase Calculations - Astronomical algorithms and formulas
- WeatherKit Integration - Moonrise/moonset via Apple WeatherKit, requirements, attribution
- Claude Code Skills - Development automation and testing tools
- CLAUDE.md - AI assistant documentation standards and guidelines
- llms.txt - AI-optimized project summary and quick reference
This project includes custom Claude Code skills for development automation:
/test-moon-phases- Validate calculation accuracy against known data/preview-arrakis- Instant UI preview and design iteration/update-docs- Auto-sync documentation with code changes/check-astronomy- Verify accuracy against NASA/USNO reference data
See Claude Code Skills Documentation for detailed usage guide.
The "On Arrakis" feature is inspired by:
- Frank Herbert's Dune universe and the desert planet Arrakis
- Vintage WPA (Works Progress Administration) National Park posters from the 1930s-40s
- Mid-century modern design aesthetics
- Minimalist flat illustration styles
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Thomas Lewis
- Astronomical calculation algorithms based on Jean Meeus' Astronomical Algorithms
- Moon phase emoji provided by Unicode Consortium
- Arrakis poster artwork inspired by vintage National Park poster designs
- Dune universe created by Frank Herbert
For questions, suggestions, or issues, please open an issue on GitHub.
"He who controls the moon phases controls the universe." - Dune Moon Motto (adapted from Dune)

