How palak216/skysafe works
SkySafe is a full-stack flight booking platform. Travelers search in natural language or by route, review offers, prepare a selected offer as inventory, and book or cancel; authenticated users and administrators also use account, booking-history, dashboard, and flight-management flows. The graph preserves those documented capabilities and separates parsing, validation, providers, ranking, booking, and persistence. Some subsystem links rely on README documentation because their implementation files were not excerpted.
Main entry points: App.jsx Route Shell · aiFlight.controller.js AI Search Controller · app.js Express API · api.js API Client
Components 34
Traveler and Admin UI
- Route Shell
client/src/App.jsx - Search Page
client/src/pages/Home.jsx - Search Form
client/src/components/SearchForm.jsx - Flight Services
client/src/services/flightService.js - AI Search Service
client/src/services/aiFlightService.js - Booking Page
client/src/pages/Booking.jsx - Booking Service
client/src/services/bookingService.js - Booking History
client/src/pages/MyBookings.jsx - Auth Context
client/src/context/AuthContext.jsx - Auth Service
client/src/services/authService.js - Route Guard
client/src/components/ProtectedRoute.jsx - Admin Dashboard
client/src/pages/AdminDashboard.jsx - Flight Management
client/src/pages/FlightManagement.jsx - Admin Service
client/src/services/adminService.js - API Client
client/src/services/api.js
API and Identity
- Express API
server/app.js - Auth Routes
server/routes/auth.routes.js - JWT Middleware
server/middleware/auth.middleware.js - Account Controller
server/controllers/auth.controller.js - User Records
server/models/User.js
Flight Search
- AI Search Controller
server/controllers/aiFlight.controller.js - AI Search Routes
server/routes/aiFlight.routes.js - Query Parser
server/services/aiFlightHelper.js - Airport Normalizer
server/utils/airportCodes.js - Query Validator
server/services/queryValidator.js - Provider Selector
server/services/flightProviders/index.js - Amadeus Provider
server/services/flightProviders/amadeusProvider.js - Mock Provider
server/services/flightProviders/mockProvider.js - Offer Ranking
server/services/rankingService.js
Booking and Inventory
- Flight Routes
server/routes/flight.routes.js - Flight Controller
server/controllers/flight.controller.js - Booking Routes
server/routes/booking.routes.js
Other components
- Traveler
- Administrator
Connections 42
- Traveler → Route Shell: uses
- Administrator → Route Shell: uses
- Route Shell → Search Page: routes to
client/src/App.jsx - Route Shell → Booking Page: routes to
client/src/App.jsx - Route Shell → Booking History: routes to
client/src/App.jsx - Route Shell → Admin Dashboard: routes to
client/src/App.jsx - Route Shell → Flight Management: routes to
client/src/App.jsx - Route Shell → Route Guard: guards routes
client/src/App.jsx - Search Page → Search Form: renders
client/src/pages/Home.jsx - Search Form → Flight Services: calls
client/src/components/SearchForm.jsx - Search Form → AI Search Service: calls
client/src/components/SearchForm.jsx - Booking Page → Flight Services: calls
client/src/pages/Booking.jsx - Booking Page → Booking Service: calls
client/src/pages/Booking.jsx - Booking History → Booking Service: calls
client/src/pages/MyBookings.jsx - Auth Context → Auth Service: loads profile
client/src/context/AuthContext.jsx - Route Guard → Auth Context: checks identity
client/src/components/ProtectedRoute.jsx - Admin Dashboard → Admin Service: loads metrics
client/src/pages/AdminDashboard.jsx - Flight Management → Admin Service: manages flights
client/src/pages/FlightManagement.jsx - Auth Service → API Client: sends requests
client/src/services/authService.js - Flight Services → API Client: sends requests
client/src/services/flightService.js - AI Search Service → API Client: sends requests
client/src/services/aiFlightService.js - Admin Service → API Client: sends requests
client/src/services/adminService.js - API Client → Express API: calls API
- Express API → Auth Routes: mounts
server/app.js - Express API → AI Search Routes: mounts
server/app.js - Express API → Flight Routes: mounts
server/app.js - Express API → Booking Routes: mounts
server/app.js - Auth Routes → Account Controller: dispatches
server/routes/auth.routes.js - Auth Routes → JWT Middleware: protects profile
server/routes/auth.routes.js - Auth Routes → User Records: reads profile
server/routes/auth.routes.js - AI Search Routes → AI Search Controller: dispatches
server/routes/aiFlight.routes.js - AI Search Controller → Query Parser: parses query
server/controllers/aiFlight.controller.js - Query Parser → Airport Normalizer: normalizes places
server/services/aiFlightHelper.js - AI Search Controller → Query Validator: validates query
server/controllers/aiFlight.controller.js - Query Validator → Airport Normalizer: resolves codes
server/services/queryValidator.js - AI Search Controller → Provider Selector: searches offers
server/controllers/aiFlight.controller.js - Provider Selector → Amadeus Provider: selects provider
server/services/flightProviders/index.js - Provider Selector → Mock Provider: falls back
server/services/flightProviders/index.js - AI Search Controller → Offer Ranking: ranks offers
server/controllers/aiFlight.controller.js - Flight Routes → Flight Controller: dispatches
server/routes/flight.routes.js - Flight Routes → AI Search Controller: bridges offers
server/routes/flight.routes.js - Booking Routes → JWT Middleware: protects booking
server/routes/booking.routes.js