How karthik5718/flight-tracker works
Purpose and entry points
This is a full-stack flight-information and tracking system with separate Django REST backend and React/Vite frontend. The backend process starts through backend/manage.py, with WSGI/ASGI deployment entry points at backend/core/wsgi.py and backend/core/asgi.py. The browser application starts at frontend/src/main.jsx and composes routes/UI in frontend/src/App.jsx.
Backend API composition
Django’s project-level URL boundary is split between general project routing and API routing in backend/core/urls.py and backend/core/api_urls.py. Feature apps expose their own endpoints through backend/accounts/urls.py, backend/airports/urls.py, backend/flights/urls.py, backend/tracking/urls.py, and backend/weather/urls.py. Views are the HTTP orchestration layer, serializing domain data and invoking adapters/services.
Identity and access control
The accounts domain manages users and air-traffic-controller profiles via backend/accounts/models.py, request/response representations in backend/accounts/serializers.py, and authorization rules in backend/accounts/permissions.py. On the frontend, authentication state is centralized in frontend/src/context/AuthContext.jsx; protected navigation is separated into ordinary-user and ATC-specific guards in frontend/src/components/ProtectedRoute.jsx and frontend/src/components/ATCProtectedRoute.jsx.
Flight, airport, and position domains
Persistent Django models organize the core aviation data: airports in backend/airports/models.py, flights in backend/flights/models.py, and live/historical flight positions in backend/tracking/models.py. Their serializers and views form the API-facing transformation boundary, for example backend/flights/serializers.py, backend/flights/views.py, and backend/tracking/views.py. Flight tracking is therefore distinct from flight metadata, allowing position updates to evolve independently of airport or flight records.
External data integration and caching
Provider-specific service modules isolate third-party API calls: AeroDataBox airport data in backend/airports/services/aerodatabox.py, AirLabs flight data in backend/flights/services/airlabs.py, and Open-Meteo weather data in backend/weather/services/open_meteo.py. Adapter modules—such as backend/airports/adapters.py, backend/flights/adapters.py, and backend/weather/adapters.py—are the normalization boundary between provider payloads and application-facing data. Shared cache behavior is centralized in backend/core/cache.py, likely protecting remote calls and repeat reads.
Frontend operational views
The UI is organized around authenticated workflows: tracking in frontend/src/pages/Tracking.jsx, airport information in frontend/src/pages/Airport.jsx, and controller operations in frontend/src/pages/ATCDashboard.jsx. Mapping and flight visualization are componentized in frontend/src/components/Map.jsx, frontend/src/components/AircraftMarker.jsx, and frontend/src/components/FlightDetailsPanel.jsx. frontend/src/components/Layout.jsx and frontend/src/components/Navbar.jsx provide the shared application shell.
Runtime and infrastructure boundaries
The backend uses Django settings layered as base, development, and production modules at backend/core/settings/base.py, backend/core/settings/dev.py, and backend/core/settings/prod.py; database schema evolution is represented by per-app migrations. The frontend is a Vite-managed React application (frontend/vite.config.js, frontend/package.json). Environment files exist separately for backend and frontend, while external aviation and weather services remain behind backend service boundaries rather than being called directly from browser components.
Components 21
Django backend
REST API, domain data, and provider integrations.
- Django runtime · Starts the backend and supports WSGI/ASGI deployment.
backend/manage.py - Layered settings · Base settings are specialized for development and production.
backend/core/settings/base.py - Project URL routing
backend/core/urls.py - API URL routing
backend/core/api_urls.py - Feature endpoints · Accounts, airports, flights, tracking, and weather routes.
backend/flights/urls.py - API views · Serialize domain data and invoke services.
backend/flights/views.py - Identity and access · Users, controller profiles, serializers, and permissions.
backend/accounts/models.py - Aviation records · Airport and flight metadata models.
backend/flights/models.py - Flight positions · Live and historical position records remain separate from flight metadata.
backend/tracking/models.py - Provider adapters · Converts provider payloads into application-facing data.
backend/flights/adapters.py - Provider services · Isolates third-party API calls.
backend/flights/services/airlabs.py - Shared cache · Protects remote calls and repeat reads.
backend/core/cache.py
React frontend
Authenticated browser workflows.
- Browser entry
frontend/src/main.jsx - App routes and UI
frontend/src/App.jsx - Authentication state · Centralizes client authentication state.
frontend/src/context/AuthContext.jsx - Route guards · Separates user and ATC-protected navigation.
frontend/src/components/ProtectedRoute.jsx - Operational pages · Tracking, airport information, and ATC operations.
frontend/src/pages/Tracking.jsx - Map visualization · Map, aircraft markers, and flight details panel.
frontend/src/components/Map.jsx
External providers
Aviation and weather data sources.
- AeroDataBox
backend/airports/services/aerodatabox.py - AirLabs
backend/flights/services/airlabs.py - Open-Meteo
backend/weather/services/open_meteo.py
Connections 22
- Django runtime → Layered settings: loads
- Django runtime → Project URL routing: serves
- Project URL routing → API URL routing: delegates API routes
- API URL routing → Feature endpoints: includes
- Feature endpoints → API views: dispatches
- API views → Identity and access: authenticates and authorizes
- API views → Aviation records: reads and writes
- API views → Flight positions: reads and writes
- API views → Provider adapters: uses external data
- Provider adapters → Provider services: normalizes responses from
- Provider services → Shared cache: uses
- Provider services → AeroDataBox: airport data
- Provider services → AirLabs: flight data
- Provider services → Open-Meteo: weather data
- Browser entry → App routes and UI: mounts
- App routes and UI → Authentication state: consumes
- App routes and UI → Route guards: applies
- Route guards → Operational pages: allows
- Operational pages → Map visualization: renders tracking UI
- App routes and UI → API URL routing: calls REST API
- Authentication state → Identity and access: uses account API
- Map visualization → Flight positions: displays positions via API