{"id":31684929,"url":"https://github.com/darksworm/airport-math","last_synced_at":"2025-10-08T08:58:34.704Z","repository":{"id":310713176,"uuid":"1040945198","full_name":"darksworm/airport-math","owner":"darksworm","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-20T21:08:38.000Z","size":106,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-21T06:46:49.770Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Svelte","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darksworm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-19T18:36:39.000Z","updated_at":"2025-08-20T21:08:43.000Z","dependencies_parsed_at":"2025-08-19T20:44:05.154Z","dependency_job_id":"c87370d3-8279-4c5f-80c0-184894b02c38","html_url":"https://github.com/darksworm/airport-math","commit_stats":null,"previous_names":["darksworm/airport-math"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/darksworm/airport-math","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darksworm%2Fairport-math","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darksworm%2Fairport-math/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darksworm%2Fairport-math/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darksworm%2Fairport-math/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darksworm","download_url":"https://codeload.github.com/darksworm/airport-math/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darksworm%2Fairport-math/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278916428,"owners_count":26068091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-08T08:58:31.769Z","updated_at":"2025-10-08T08:58:34.699Z","avatar_url":"https://github.com/darksworm.png","language":"Svelte","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ✈️ Airport Math - Planning Your Departure\n\nA modern web application built with Svelte that helps you calculate the optimal departure time for your flight based on your location, selected airport, and travel preferences.\n\n## 🚀 Features\n\n- **Smart Location Detection**: Uses browser geolocation API to find your current position\n- **Nearby Airport Discovery**: Finds airports near you using distance calculations\n- **Multiple Transport Options**: Calculate travel times for driving, walking, cycling, and public transit\n- **Real-time Route Calculation**: Integration with OSRM (Open Source Routing Machine) for accurate travel times\n- **Intelligent Time Calculation**: Automatically calculates when to leave based on:\n  - Flight departure time\n  - Check-in buffer (2h domestic, 3h international)\n  - Travel time to airport\n  - Safety margin (15 minutes)\n- **Responsive Design**: Works seamlessly on desktop and mobile devices\n- **Real-time Updates**: Countdown timer shows time remaining until departure\n\n## 🛠️ Technology Stack\n\n### Core Framework\n- **SvelteKit**: Modern web framework with server-side rendering\n- **TypeScript**: Type-safe development\n- **Vite**: Fast build tool and development server\n\n### Data Sources \u0026 APIs\n- **Browser Geolocation API**: For user location detection\n- **OurAirports Dataset**: Open-source airport database with global coverage\n- **OSRM (Open Source Routing Machine)**: For accurate routing and travel times\n- **OpenStreetMap Data**: Powers the routing calculations\n\n### Architecture\n- **Component-based**: Modular Svelte components for reusability\n- **Store Pattern**: Centralized state management for location data\n- **Service Layer**: Separate services for airports, routing, and calculations\n- **Type-safe**: Full TypeScript coverage for better developer experience\n\n## 📱 How It Works\n\n1. **Location Detection**: App detects your current location using the browser's geolocation API\n2. **Airport Discovery**: Finds nearby airports and ranks them by distance\n3. **Flight Input**: Enter your flight time and specify if it's international\n4. **Transport Selection**: Choose your preferred method of transportation\n5. **Route Calculation**: Calculates travel time using real routing data\n6. **Departure Time**: Shows exactly when you need to leave\n\n### Calculation Formula\n\n```\nleave_time = flight_time - (travel_time + check_in_buffer + safety_margin)\n```\n\nWhere:\n- `check_in_buffer` = 2 hours (domestic) or 3 hours (international)\n- `safety_margin` = 15 minutes\n- `travel_time` = Calculated via OSRM routing engine\n\n## 🏗️ Project Structure\n\n```\nsrc/\n├── lib/\n│   ├── components/          # Reusable Svelte components\n│   │   ├── LocationSelector.svelte\n│   │   ├── AirportSelector.svelte\n│   │   ├── FlightForm.svelte\n│   │   ├── TransportSelector.svelte\n│   │   └── DepartureResults.svelte\n│   ├── services/           # Business logic services\n│   │   ├── airports.ts     # Airport data and search\n│   │   ├── routing.ts      # OSRM integration and travel times\n│   │   └── departure.ts    # Departure time calculations\n│   ├── stores/             # Svelte stores for state management\n│   │   └── location.ts     # Location state management\n│   ├── types/              # TypeScript type definitions\n│   │   └── airport.ts      # Core data types\n│   └── utils/              # Utility functions\n│       └── distance.ts     # Haversine distance calculations\n├── routes/                 # SvelteKit pages\n│   ├── +layout.svelte      # App layout and global styles\n│   └── +page.svelte        # Main application page\n└── app.html               # HTML template\n```\n\n## 🚦 Getting Started\n\n### Prerequisites\n- Node.js 18+ \n- npm or yarn\n\n### Installation\n\n1. Install dependencies:\n```bash\nnpm install\n```\n\n2. Start the development server:\n```bash\nnpm run dev\n```\n\n3. Open your browser and navigate to `http://localhost:5173`\n\n### Building for Production\n\n```bash\nnpm run build\n```\n\n### Type Checking\n\n```bash\nnpm run check\n```\n\n## 🌍 Data Sources\n\n### Airport Data\nCurrently using a curated list of major international airports. In a production environment, this would be replaced with:\n- **OurAirports Dataset**: https://ourairports.com/data/\n- **OpenFlights Airport Database**: https://openflights.org/data.html\n\n### Routing Data\n- **OSRM Demo Server**: Used for development (https://router.project-osrm.org)\n- **Production**: Should host your own OSRM instance with OpenStreetMap data\n\n## 🔧 Configuration\n\n### Environment Variables\n- None required for basic functionality\n- For production, configure your own OSRM server endpoint\n\n### Customization\n- **Check-in Times**: Modify buffer times in `src/lib/services/departure.ts`\n- **Safety Margin**: Adjust safety buffer in departure calculations\n- **Airport List**: Replace sample data with full OurAirports dataset\n- **Transport Modes**: Add or modify transport options in `src/lib/services/routing.ts`\n\n## 🎯 Future Enhancements\n\n- **Real Flight Data**: Integration with flight APIs (AviationStack, FlightAware)\n- **Live Traffic Data**: Real-time traffic conditions\n- **Airport-specific Buffers**: Custom check-in times for specific airports\n- **Public Transit**: Integration with transit APIs for better public transport routing\n- **Historical Data**: Learn from user feedback to improve predictions\n- **Notifications**: Push notifications for departure reminders\n- **Offline Support**: PWA capabilities for offline usage\n\n## 📜 Implementation Notes\n\nThis project demonstrates the implementation described in the \"Airport Math – Planning Your Departure\" guide, using open-source tools and datasets as recommended:\n\n- ✅ Browser geolocation API for user location\n- ✅ Distance-based airport discovery using Haversine formula\n- ✅ OSRM integration for routing and travel times\n- ✅ Configurable check-in buffers (2h/3h)\n- ✅ Modern Svelte/TypeScript architecture\n- ✅ Mobile-responsive design\n- ✅ Free and open-source stack\n\n## 🙏 Acknowledgments\n\n- **OurAirports**: For providing open airport data\n- **OpenStreetMap**: For global mapping data\n- **OSRM**: For open-source routing engine\n- **Svelte Team**: For the excellent framework\n- **Aviation Community**: For check-in time guidelines\n\n---\n\nBuilt with 💙 using modern web technologies and open-source data.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarksworm%2Fairport-math","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarksworm%2Fairport-math","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarksworm%2Fairport-math/lists"}