Commit Graph

22 Commits

Author SHA1 Message Date
0e2ba9fc13 feat: enhance metadata, add robots and sitemap routes, and implement custom 404 and OpenGraph images 2026-03-25 16:41:45 +05:30
56b12afebe Expand static ATC feed database to 635 airports across all continents (#18)
* Initial plan

* Expand ATC feeds to 635 airports covering all continents with verified LiveATC mount points

Co-authored-by: kewonit <108450560+kewonit@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kewonit/aeris/sessions/c2de9c60-f25b-4569-ac24-a5fa35514f32

* Fix KYKM App/Dep typo in channel description

Co-authored-by: kewonit <108450560+kewonit@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kewonit/aeris/sessions/c2de9c60-f25b-4569-ac24-a5fa35514f32

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kewonit <108450560+kewonit@users.noreply.github.com>
2026-03-24 17:55:57 +05:30
kew
eb1103f63f feat: 3D aircraft model overhaul and multi-source flight data proxy (Resolves #15) (#16)
* Refactor aircraft photo and hero banner components to reset loading state on photo change

- Updated Lightbox component to reset image loading state when navigating between photos.
- Modified HeroBanner component to reset loading state when the photo changes.

Clean up control panel search logic

- Removed unnecessary hasResults variable in SearchContent component.

Implement flight API client with fallback mechanism

- Added flight-api-client to handle fetching flight data from multiple sources (airplanes.live, adsb.lol, OpenSky).
- Introduced flight-api-parsing module to convert raw API responses into standardized FlightState objects.
- Created flight-api-types for shared types between API responses.

Refactor useFlights hook to utilize new flight API client

- Updated useFlights hook to fetch flights using the new flight API client.
- Removed credit management logic as it is no longer applicable with the new API structure.

Fix useFlightMonitors to fetch flight data by hex address

- Changed useFlightMonitors to use fetchFlightByHex instead of fetchFlightByIcao24.

Update geo utility function for better readability

- Refactored splitAtAntimeridian function to improve variable naming and clarity.

Enhance OpenSky types with additional fields

- Added typeCode and registration fields to FlightState type for better integration with readsb data.

* fix: correct 6 files that diverged during rebase (iata code, globe mode ref, terrain attribution, cache eviction, opensky parsing)

* fix: improve keyboard shortcuts help focus trapping

feat: add showAirspace option to MapAttribution component

fix: clear hideTimer on ScrollArea cleanup

refactor: change pendingFpvRef to MutableRefObject in useFlightMonitors

fix: handle sessionStorage availability in useFlightTrack

refactor: increase POLL_INTERVAL_MS in useFlights for better performance

fix: optimize keyboard shortcuts dialog check

refactor: optimize useMergedTrails by caching selected flight position

feat: extend Settings type with airspace options

refactor: improve airline logo normalization functions

refactor: enhance flight API client with serialized rate limiting

refactor: optimize registration country lookup with pre-built maps

refactor: enhance logo cache management with size limits

feat: update map attribution to include airspace option

fix: validate rawState in parseStateRow function

refactor: improve utility functions with clamp implementation

* feat: add ATC lookup functionality and GPU memory monitoring

- Implemented ATC lookup functions in `atc-lookup.ts` for converting IATA to ICAO codes, finding nearby ATC feeds, and looking up ATC feeds by code.
- Introduced `atc-types.ts` to define types and priorities for ATC feeds.
- Added GPU memory monitoring in `gpu-memory-monitor.ts` to track WebGL resource allocations and provide memory reports.
- Enhanced trail stitching logic in `trail-stitching.ts` by adding a function to clear the splined track cache and optimizing altitude checks.

* feat: enhance flight data handling and improve API resilience

- Implemented a maximum empty response streak guard in useFlights to prevent data loss during transient API failures.
- Added immediate fetch on network reconnect in useFlights to ensure timely data retrieval.
- Updated useMergedTrails to include timestamps for trail points.
- Removed smoothAnimations setting from useSettings as it is no longer needed.
- Enhanced useTrailHistory to preserve last-known trails during empty flight responses and added dynamic jump detection for tab resume scenarios.
- Improved flight API client with a circuit breaker mechanism to handle provider failures and prevent excessive retries.
- Updated flight API parsing to reject non-JSON responses from OpenSky and other providers.
- Enhanced trail smoothing and stitching logic to ensure better continuity at junctions between historical and live data.

* feat: migrate aircraft models to Cloudinary CDN and update mapping logic

* fix: adjust UI component styles and improve trail smoothing parameters

* fix: adjust base aircraft size for improved rendering

* feat: update changelog with recent enhancements and modify data source attribution

* fix: update model optimization details and remove Draco compression dependency

* feat: update changelog with recent code review fixes and fallback provider adjustments
2026-03-23 01:25:11 +05:30
kew
147b69b944 feat(map): enhance globe projection handling and improve altitude color representation (#14)
* feat(map): enhance globe projection handling and improve altitude color representation

- Implemented elevation-aware pixel projection for globe mode in `projectLngLatElevationPixelDelta`.
- Refactored north-up animation in `CameraController` to use `setBearing` for smoother transitions.
- Added native GeoJSON support for globe zoom in `FlightLayers`, including dynamic opacity adjustments based on zoom levels.
- Introduced globe-specific pitch and projection settings in `Map` component, ensuring consistent rendering.
- Enhanced UI control panel with a visual separator for better organization.
- Minor formatting adjustments in `altitudeToColor` function for improved readability.

* feat(map): refactor elevation-aware projection handling for improved accuracy

* feat(map): add dark terrain profile support and enhance map styling

* feat: implement trail stitching for merging historical and live flight data

- Added a new module `trail-stitching.ts` to handle the merging of sparse historical track data with high-frequency live trail data.
- Introduced constants for thresholds and parameters to improve code readability and maintainability.
- Implemented a main function `stitchHistoricalTrail` that processes flight tracks, applies smoothing, and merges live tail data.
- Included utility functions for spherical interpolation and cubic easing for altitude transitions.
- Ensured the final path is cleaned of spikes and sharp corners for a smoother representation.

* feat: add centripetal Catmull-Rom spline interpolation for 3D flight trails

- Implemented `catmullRomSpline3D` function to interpolate waypoints into a smooth 3D path.
- Added helper functions for segment density calculation, safe linear interpolation, and endpoint reflection.
- Included support for variable tension based on heading changes to enhance smoothness.
- Introduced utility functions for linear interpolation between elevated points.

* feat(map): enhance layer visibility handling for flight and selection layers

* feat: enhance control panel with new tabs and settings

- Added "Changelog" and "About" tabs to the control panel.
- Introduced new icons for the added tabs using lucide-react.
- Updated the styling of the control panel buttons and dialog.
- Improved accessibility with aria-labels for buttons.

feat: integrate hero banner in flight card

- Added a HeroBanner component to display aircraft photos in the FlightCard.
- Implemented loading and error states for the photo display.
- Enhanced the layout and styling of the FlightCard for better user experience.

fix: update keyboard shortcuts for search functionality

- Added shortcut "⌘K" to open search from anywhere in the application.
- Adjusted keyboard shortcut handling to prevent conflicts with input fields.

fix: optimize flight tracking cache management

- Introduced a maximum cache size for flight tracking to prevent memory growth.
- Implemented a cache eviction strategy for stale entries.

feat: add great-circle utilities for geographical calculations

- Implemented functions for calculating haversine distance, great-circle interpolation, and densifying paths.
- Added functionality to handle antimeridian crossings in geographical paths.

refactor: streamline map styles and terrain handling

- Consolidated terrain DEM source for both terrain mesh and hillshade.
- Adjusted hillshade layer properties for better performance and visual fidelity.

fix: improve bounding box calculations for flight queries

- Enhanced longitude calculations to account for converging meridians at higher latitudes.
- Ensured bounding box calculations are accurate across different latitudes.

* feat(map): refine globe mode functionality and update trail settings
2026-03-11 00:54:51 +05:30
kew
3a10da0486 feat: implement full flight history tracking and enhance trail rendering (#11)
* feat: implement full flight history tracking and enhance trail rendering

* feat: enhance flight tracking logic and improve path handling

* feat: implement airline logo caching and error handling in flight components

* feat: enhance flight tracking logic to improve waypoint handling and connection logic

* feat: refactor longitude handling and improve flight tracking logic

* feat: improve longitude handling and enhance airline logo failure tracking
2026-02-22 18:40:52 +05:30
kew
a08f1c7250 feat: add first person view (FPV) functionality and HUD (#9)
* feat: add first person view (FPV) functionality and HUD

- Updated FlightCard component to include FPV toggle button and state management.
- Introduced FpvHud component for displaying flight data in FPV mode.
- Enhanced useFlights hook to support FPV bounding box logic for fetching flights.
- Added keyboard shortcuts for toggling FPV mode.
- Updated settings to include FPV-related configurations (pitch, chase distance).
- Implemented major airports caching for improved performance.
- Added fetchFlightByIcao24 function for single aircraft state retrieval.

* Refactor CameraController and ControlPanel components; enhance flight search functionality

- Simplified CameraController by removing unused refs and effects, and centralized map interaction management.
- Updated ControlPanel to support flight lookup with new props and integrated flight search results.
- Enhanced SearchContent to include flight matching logic and improved user feedback for flight searches.
- Introduced caching for flight callsign lookups in OpenSky API integration to optimize performance.
- Removed unnecessary settings related to FPV pitch and free camera mode from use-settings hook.

* feat: enhance FPV functionality and improve flight data handling

- Added `projectLngLatElevationPixelDelta` function to calculate pixel deltas based on longitude, latitude, and elevation.
- Updated `CameraController` to utilize new FPV parameters and improve camera behavior during flight.
- Enhanced flight data handling in `FlightLayers` to ensure proper tracking and display of flight information.
- Improved UI components for better user experience, including adjustments to the FPV HUD and flight card.
- Added error handling for image loading in the control panel.
- Refactored altitude and speed calculations to ensure they handle non-finite values gracefully.
- Adjusted map attribution behavior for better responsiveness on different screen sizes.
2026-02-21 12:31:17 +05:30
kew
e262bd730d fix: add OpenStreetMap and data source attribution across all map styles (#8)
Resolves #7 — missing OpenStreetMap attribution.

- Add custom MapAttribution component (expanded by default on desktop,
  collapsed on mobile with outside-click-to-close)
- Add proper attribution strings to all raster tile sources (OSM, CARTO,
  Esri, OpenTopoMap, Mapzen)
- Add getAttributions() helper that returns correct credits per style
- Include OpenSky Network as flight data source attribution
- Include MapLibre as rendering engine attribution
- Replace hidden built-in MapLibre attribution with themed custom UI
2026-02-17 22:22:15 +05:30
kew
bf99d4843f Feat/airline logos opensky refresh (#6)
* feat: keyboard shortcuts, click-to-select, pulse/glow, smooth orbit resume

* feat: add camera controls and enhance keyboard shortcuts help; improve flight card accessibility

* feat: enhance flight layers and keyboard shortcuts; improve airline data structure

* feat: expand airline logos and refresh flight/OpenSky mapping

* feat: import expanded airport dataset

* perf: reduce trail recomputation and soften airport dots

* perf: speed up 9k airport search with index + cache

* docs: add community standards and contribution templates

* docs: enforce issue templates via config

* chore: ignore only .github/agents

* fix: improve airport visibility and stable map marker
2026-02-17 21:50:39 +05:30
5125107d5b Make airport markers minimal and de-cluttered for global airport density (#5)
* Initial plan

* chore: outline plan for global airport dataset update

Co-authored-by: kewonit <108450560+kewonit@users.noreply.github.com>

* feat: expand airport dataset to 9k+ global airports

Co-authored-by: kewonit <108450560+kewonit@users.noreply.github.com>

* feat: make airport dots subtle and resilient

Co-authored-by: kewonit <108450560+kewonit@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kewonit <108450560+kewonit@users.noreply.github.com>
2026-02-16 01:41:02 +05:30
kew
06956f8b59 feat: keyboard shortcuts, click-to-select, pulse/glow, smooth orbit resume (#4)
* feat: keyboard shortcuts, click-to-select, pulse/glow, smooth orbit resume

* feat: add camera controls and enhance keyboard shortcuts help; improve flight card accessibility

* feat: enhance flight layers and keyboard shortcuts; improve airline data structure
2026-02-15 21:50:48 +05:30
709b73cbbb feat: add random airport selection feature; update status bar with new button and styling 2026-02-15 17:44:21 +05:30
27a3ae042a feat: implement horizontal distance calculations and densify elevated paths; enhance flight layer rendering with improved trail visibility and color mapping 2026-02-15 11:21:36 +05:30
3b431e2c8d feat: add caching headers for models, update viewport meta tag, and enhance error handling; improve flight tracker layout and status bar styling 2026-02-15 01:34:44 +05:30
fdbc604919 feat: add trail thickness and distance settings; implement sliders in control panel and update settings context 2026-02-15 00:07:04 +05:30
293a54b332 fix: revert default city ID to 'sfo' in flight tracker component 2026-02-14 20:49:13 +05:30
1794a4b678 feat: enhance flight tracker with GitHub stars display and improve reset view functionality; update trail history sampling rate 2026-02-14 20:40:21 +05:30
2c60861407 feat: add north-up and reset view functionality to flight tracker and status bar; enhance trail synthesis in useTrailHistory 2026-02-14 20:27:40 +05:30
0f8012361f Update city radius values and add Miami; refine map styles and improve OpenSky code readability 2026-02-14 16:39:17 +05:30
kew
393cc5f901 fix: call OpenSky API directly from browser to bypass Vercel IP blocks (#1)
* fix: switch flights API to edge runtime, lower timeouts

- Switch to Edge Runtime (30s timeout on ALL Vercel plans, near-zero cold starts)
- Lower FETCH_TIMEOUT_MS from 20s to 8s (prevents Vercel killing the function)
- Lower TOKEN_TIMEOUT_MS from 5s to 3s
- Replace Buffer.from() with btoa() for edge compatibility
- Remove maxDuration (not needed for edge functions)

Fixes 502 Bad Gateway on Vercel deployments caused by Hobby plan's
10s function timeout being exceeded by the 20s fetch timeout.

* fix: revert edge runtime, keep reduced timeouts

Edge runtime caused 500 on Vercel. Reverted to Node.js serverless
with reduced timeouts only:
- FETCH_TIMEOUT_MS: 20s -> 8s
- TOKEN_TIMEOUT_MS: 5s -> 3s
- Restored Buffer.from() for basic auth

* fix: handle DOMException unavailability in Vercel runtime

- Fix TypeError: 'Right-hand side of instanceof is not an object'
  caused by DOMException not existing in Vercel's server runtime
- Use safe abort detection: check err.name === 'AbortError' on Error
  first, then conditionally check DOMException if available
- Restore TOKEN_TIMEOUT_MS to 5s (3s was too aggressive from Vercel)
- Keep FETCH_TIMEOUT_MS at 8s (down from original 20s)

* fix: deploy to Frankfurt, increase timeouts, add retry logic

- Set preferredRegion to 'fra1' (Frankfurt) — closest to OpenSky EU servers
- Increase FETCH_TIMEOUT_MS to 15s and TOKEN_TIMEOUT_MS to 8s
  (OpenSky is slow from cloud IPs, needs more time)
- Add retry logic: 1 retry with 500ms delay before giving up
- Keep safe DOMException handling for Vercel runtime compat

* feat: add Railway proxy for OpenSky API, proxy mode for Vercel route

OpenSky blocks/throttles requests from Vercel's IP ranges. This adds:

1. **Railway proxy** (`proxy/`) — standalone Node.js server that handles
   OpenSky API calls with auth, caching, and CORS. Zero dependencies.

2. **Proxy mode in Vercel route** — when OPENSKY_PROXY_URL env var is set,
   the Vercel /api/flights route forwards requests to the Railway proxy
   instead of calling OpenSky directly.

Setup:
- Deploy proxy/ to Railway with OPENSKY credentials
- Set OPENSKY_PROXY_URL in Vercel to the Railway URL
- Remove OPENSKY credentials from Vercel (only needed on Railway)

* refactor: call OpenSky directly from browser, remove server-side proxy

OpenSky supports CORS (Access-Control-Allow-Origin: *), so we can
call the API directly from the user's browser. This bypasses
Vercel's cloud-provider IPs that OpenSky blocks.

Changes:
- opensky.ts: fetch from opensky-network.org/api directly (was /api/flights)
- use-flights.ts: fix DOMException abort detection
- Remove src/app/api/flights/route.ts (server-side proxy)
- Remove proxy/ directory (Railway proxy)

The app is now fully static — no server-side API routes needed.

* chore: remove server-side API route (now browser-side)

* chore: remove Railway proxy (no longer needed)

* chore: remove proxy package.json

* chore: remove proxy README

* polish: production-grade cleanup, security hardening, remove redundant comments

- Remove redundant JSDoc blocks in opensky.ts, keep only @see link
- Add bounds-clamping for lat/lng parameters (defense-in-depth)
- Fix memory leak: map.on("movestart") listener now cleaned up on unmount
- Validate GA_ID format before interpolating into script tag (XSS defense)
- Remove duplicate canonical <link> tag (already set via metadata.alternates)
- Sanitize JSON-LD output with \u003c escaping to prevent </script> injection
- Use useRef instead of useState for mutable TrailStore class instance
- Fix unused useState import in use-trail-history
- Add Map.displayName for React DevTools
- Fix Tailwind lint: px-[2px] → px-0.5
- Remove unused OPENSKY credentials from .env.example

* chore: push remaining polished files (flight-tracker, use-flights, map)

- flight-tracker: movestart listener cleanup on unmount
- use-flights: clean up redundant comments, fix abort detection
- map: add displayName, remove redundant comment prefix

* chore: polish control-panel (clean comments, Tailwind lint fix)
2026-02-14 15:05:00 +05:30
4431c84ace feat: update OpenSky API integration and improve flight tracking
- Increased max duration for flight data requests from 10 to 30 seconds.
- Adjusted fetch timeouts and cache TTL to enhance performance.
- Implemented snapping of bounding box coordinates to a grid for better cache sharing.
- Enhanced flight data fetching logic to adapt polling intervals based on remaining API credits.
- Introduced a new adaptive polling mechanism with different tiers based on credit usage.
- Updated flight layers animation duration for smoother transitions.
- Added a new slider component for orbit speed control in the UI.
- Refactored flight card positioning logic to ensure it remains within viewport bounds.
- Improved control panel layout for better mobile usability.
- Adjusted default orbit speed settings for a more user-friendly experience.
2026-02-14 14:13:20 +05:30
08be8e1267 feat: enhance flight tracking with improved API handling, metadata, and performance optimizations 2026-02-14 13:14:43 +05:30
b3f20b7659 feat: add flight tracking components and hooks
- Introduced FlightCard component for displaying flight information with animations.
- Added ScrollArea component for custom scroll behavior.
- Implemented StatusBar component to show flight count and loading status.
- Created useFlights hook for fetching and managing flight data based on city selection.
- Developed useSettings hook for managing user settings with local storage persistence.
- Added useTrailHistory hook for managing flight trail data.
- Defined City type and CITIES constant for city data management.
- Implemented flight utility functions for altitude and speed conversions.
- Created map styles for different visual representations.
- Added OpenSky API integration for fetching flight data.
- Implemented utility functions for class name merging.
- Configured TypeScript settings for the project.
2026-02-14 12:26:44 +05:30