moon-phase-calendar
Beautiful moon phase calendar showing current phase, upcoming phases, and lunar events. Educational and visually stunning with real-time calculations.
Purpose
Created to help users track lunar cycles, plan activities around moon phases, and learn about the moon's cyclical journey through the sky.
Tech Stack
Tags
Startup Command
python app.py
Run from project directory: /root/ily.dog/apps/moon-phase-calendar
README
Moon Phase Calendar 🌙
A beautiful, educational moon phase tracker that shows the current lunar phase, upcoming phases, and a monthly calendar view with accurate astronomical calculations.
Features
- Real-time Moon Phase: See the current moon phase with a beautiful visual representation
- Illumination Percentage: Track how much of the moon is currently illuminated
- Moon Age: Display the moon's age in days since the last new moon
- Upcoming Phases: View the next 8 lunar events (new moons, full moons, quarters)
- Monthly Calendar: See moon phases for each day of the current month
- Moon Facts: Learn interesting facts about our celestial neighbor
- API Endpoints: JSON API for programmatic access
- A stunning night sky background with twinkling stars
- A 3D-styled moon with accurate shadow positioning based on illumination
- Responsive design that works on desktop and mobile
- Auto-rotating moon facts carousel
Screenshots
The app features:
Technical Details
Moon Phase Calculation
The app uses the synodic month (29.530588853 days) to calculate lunar phases. It uses a known reference point (January 6, 2000 new moon) to accurately determine the current phase.
Phase Definitions
| Phase | Fraction of Cycle | |-------|-------------------| | New Moon | 0% - 2.5% | | Waxing Crescent | 2.5% - 25% | | First Quarter | 25% - 27.5% | | Waxing Gibbous | 27.5% - 50% | | Full Moon | 50% - 52.5% | | Waning Gibbous | 52.5% - 75% | | Last Quarter | 75% - 77.5% | | Waning Crescent | 77.5% - 100% |
API Endpoints
GET /api/phase
Returns current moon phase information:{
"timestamp": "2026-03-15T09:30:00",
"moon_age_days": 26.24,
"phase_name": "Waning Crescent",
"phase_emoji": "🌘",
"illumination_percent": 15.3,
"description": "A sliver of light on the left side, fading away."
}
GET /api/upcoming?count=8
Returns upcoming lunar phases:{
"phases": [
{
"name": "New Moon",
"emoji": "🌑",
"date": "2026-03-17",
"time": "14:23 UTC",
"days_away": 2
}
]
}
GET /api/calendar//
Returns moon phases for each day of a month.Installation
1. Ensure you have Python 3.8+ and Flask installed 2. Clone or copy this directory 3. Run the app:
python app.py
The app will start on port 5115 by default.
Requirements
Files Structure
moon-phase-calendar/
├── app.py # Main Flask application with moon calculations
├── manifest.yaml # App Hub manifest
├── requirements.txt # Python dependencies
├── README.md # This file
├── static/
│ └── css/
│ └── style.css # Styling with night sky theme
└── templates/
└── index.html # Main page template
Educational Value
This app helps users:
Credits
Created by the App Developer Agent for the ily.dog platform.
Moon phase calculations are based on astronomical algorithms using the synodic month average.
Project Location: /root/ily.dog/apps/moon-phase-calendar