πŸŽ… Santa Tracker

December 3, 2025 Β· View on GitHub

GitHub Workflow Status codecov License: MIT Python Version Code Quality

Track Santa's magical journey around the world on Christmas Eve! This interactive Progressive Web App provides real-time updates on Santa's location, destinations, and estimated arrival times.

✨ Features

  • πŸ—ΊοΈ Interactive Map - Real-time visualization using Leaflet.js with OpenStreetMap
  • πŸ“ Location Tracking - Current location, next destination, and route visualization
  • πŸ“ Distance Calculator - Calculate distance from Santa to your location
  • ⏱️ Countdown Timer - Live countdown to Christmas (UTC+14 timezone-aware)
  • πŸŽ„ Advent Calendar - Daily unlockable Christmas content (facts, games, stories, videos) (requires ADVENT_ENABLED=True)
  • πŸ” Admin Dashboard - Comprehensive route and location management
  • πŸ“± Progressive Web App - Installable with offline support
  • β™Ώ Accessible - Full ARIA support, keyboard navigation, screen reader compatible
  • 🎨 Responsive Design - Works seamlessly on all devices

πŸš€ Quick Start

Prerequisites

  • Python 3.10+
  • pip (Python package manager)
  • Modern web browser

Installation

# Clone the repository
git clone https://github.com/WxboySuper/Santa_Tracker.git
cd Santa_Tracker

# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt
npm install  # For frontend linting tools

# Run the application
python src/app.py

# Development mode with debug enabled
FLASK_DEBUG=True python src/app.py

# Enable advent calendar feature
ADVENT_ENABLED=True python src/app.py

Navigate to http://localhost:5000 to start tracking Santa!

🚩 Feature Flags

FlagDefaultDescription
ADVENT_ENABLEDFalseEnables the advent calendar feature. When disabled, the advent calendar UI, navigation links, and API endpoints are hidden/inaccessible.

To enable a feature flag, set the corresponding environment variable:

# Via environment variable
export ADVENT_ENABLED=True
python src/app.py

# Or in your .env file
ADVENT_ENABLED=True

πŸ“ Project Structure

Santa_Tracker/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ static/          # CSS, JavaScript, images
β”‚   β”œβ”€β”€ templates/       # HTML templates
β”‚   β”œβ”€β”€ utils/           # Core logic (tracker, locations, advent)
β”‚   └── app.py           # Flask application
β”œβ”€β”€ tools/
β”‚   └── route-editor/    # Standalone route editor tool (React + Vite)
β”œβ”€β”€ docs/                # Documentation
β”œβ”€β”€ tests/               # Test suite
β”œβ”€β”€ config.py            # Configuration
└── requirements.txt     # Python dependencies

πŸ› οΈ Technology Stack

Backend: Flask, Gunicorn, Geopy, Python-dotenv
Frontend: Tailwind CSS (CDN), Leaflet.js, Vanilla JavaScript, CSS3
DevOps: GitHub Actions, Dependabot, DeepSource
Testing: pytest, pytest-cov (79% coverage across 140 tests)

πŸ§ͺ Testing & Route Simulation

Running Tests

# Run all tests with coverage
pytest --cov=src --cov-report=term-missing tests/

# Run specific test files
pytest tests/test_tracker.py -v
pytest tests/test_route_generation.py -v

# Quick test run
pytest tests/ -q

Route Simulation

The admin dashboard includes a Route Testing & Simulation feature that allows you to:

  • Test Santa's route with different timing scenarios
  • Preview routes before finalizing them
  • Simulate with custom start times
  • Test specific location subsets
  • View detailed timing calculations and summaries

Access via Admin Dashboard β†’ Route Testing & Simulation β†’ Simulate Route

API Endpoint: POST /api/admin/route/simulate

  • Accepts optional start_time (ISO 8601 format) and location_ids (array)
  • Returns simulated route with arrival/departure times
  • Does not modify stored route data

Test Coverage

  • tracker.py: 100% coverage
  • locations.py: 94% coverage
  • advent.py: 95% coverage
  • app.py: 75% coverage
  • Overall: 79% coverage (140 tests passing)

πŸ› οΈ Developer Tools

Santa Route Editor

A standalone visual route editor for creating and managing Santa's journey routes. This tool provides:

  • Interactive map interface with geocoding search
  • Drag-and-drop route ordering
  • Editable location metadata (priority, UTC offset, notes, etc.)
  • JSON export matching the Santa Tracker route format

Quick Start:

cd tools/route-editor
npm install
npm run dev

See tools/route-editor/README.md for detailed documentation.

πŸ“š Documentation

🀝 Contributing

We welcome contributions! Here's how:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes and test thoroughly
  4. Commit your changes (git commit -m 'Add amazing feature')
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a Pull Request

See our Pull Request Template for guidelines.

Issue Templates

πŸ”’ Security

Report security vulnerabilities via GitHub Security Advisories. All dependencies are automatically updated via Dependabot.

πŸ“„ License

Licensed under the MIT License - see LICENSE file for details.

πŸ‘¨β€πŸ’» Author

WxboySuper - @WxboySuper

πŸŽ„ Acknowledgments

  • Santa tracking route inspired by NORAD Santa Tracker
  • Map tiles by OpenStreetMap contributors
  • Icons from open-source projects

πŸ“ž Support


Made with ❀️ for the holiday season

May your Christmas be merry and bright! πŸŽ…πŸŽ„