A smart delivery route optimization app that helps Santa plan the most efficient path to deliver gifts worldwide.
- Location Management - Add delivery addresses manually or upload via CSV file
- Geocoding - Automatically converts addresses to coordinates using OpenStreetMap Nominatim API
- Route Optimization - Uses Nearest Neighbor TSP algorithm with 2-opt improvement for efficient routes
- Interactive Map - Visual canvas-based map with dragging, zooming, and route visualization
- Santa Dashboard - Real-time stats showing total distance, estimated travel time, and delivery progress
- Delivery Tracking - Mark deliveries as complete and track progress
- Priority System - Tag children as Nice, Naughty, or Extra-Nice for delivery prioritization
- Christmas Theme - Festive dark theme with animated snowfall effect
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS v4
- UI Components: shadcn/ui
- Map Rendering: HTML Canvas API
- Geocoding: OpenStreetMap Nominatim API
- Algorithm: Traveling Salesman Problem (TSP) with Nearest Neighbor + 2-opt optimization
- Node.js 18+ installed
- npm or yarn package manager
-
Clone the repository:
git clone https://github.com/yourusername/santa-route-optimizer.git cd santa-route-optimizer -
Install dependencies:
npm install
-
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser
npx shadcn@latest add https://v0.dev/chat/your-project-id- Add Locations: Enter addresses manually or upload a CSV file with addresses
- Geocode: The app converts addresses to latitude/longitude coordinates
- Optimize: Click "Optimize Route" to calculate the shortest delivery path
- Track: Mark deliveries as complete and monitor progress on the dashboard
The route optimization uses a two-phase approach:
- Nearest Neighbor Heuristic: Builds an initial route by always visiting the closest unvisited location
- 2-opt Improvement: Iteratively improves the route by reversing segments that reduce total distance
This provides a good balance between computation speed and route quality.
├── app/
│ ├── globals.css # Tailwind styles + Christmas theme
│ ├── layout.tsx # Root layout with fonts
│ └── page.tsx # Main dashboard page
├── components/
│ ├── location-form.tsx # Add location form + CSV upload
│ ├── location-list.tsx # Delivery locations list
│ ├── route-map.tsx # Canvas-based interactive map
│ ├── snowfall.tsx # Animated snow effect
│ └── stats-dashboard.tsx # Statistics cards
├── lib/
│ ├── route-optimizer.ts # TSP algorithm implementation
│ ├── types.ts # TypeScript interfaces
│ └── utils.ts # Utility functions
└── README.md
- Weather-based rerouting
- Sleep schedule integration for optimal delivery windows
- 3D sleigh animation
- Multi-night route planning
- Real-time tracking simulation




