How coegithub/airlinebookingrepo works
SkyBook is a flight-booking web app: travellers browse and save flights, build a trip, sign in, submit booking details with a mock payment, and view their bookings. The React client fetches the catalog and sends booking requests through a shared HTTP layer; the Express API validates identity and delegates persistent work to Postgres. The database transaction reserves seats and saves the booking atomically, while shared pricing rules calculate totals. The README documents the major capabilities and API; some server and page wiring is supported by the source index rather than sampled implementation excerpts.
Main entry points: StoreContext.jsx Trip and saved flights · db.js Catalog and booking store · api.js Catalog and orders API · App.jsx React app
Components 23
Flight browsing
- React app
src/App.jsx - Flight discovery
src/pages/Home.jsx - Flight details
src/pages/ProductDetail.jsx - Flight cards
src/components/ProductCard.jsx - Trip and saved flights
src/context/StoreContext.jsx
Trip and account
- Account session
src/context/AuthContext.jsx - Booking checkout
src/pages/Checkout.jsx - Trip cart
src/pages/Cart.jsx - Saved flights
src/pages/Wishlist.jsx - Booking history
src/pages/Orders.jsx - Booking details
src/pages/OrderDetail.jsx
API and identity
- Catalog and orders API
src/services/api.js - HTTP client
src/services/http.js - Authentication client
src/services/auth.js - Express server
server/index.js - Booking API
server/api.js - Account and sessions
server/identity.js
Booking data
- Catalog and booking store
server/db.js - Database connection
server/pool.js - Neon Postgres
- Flight catalog seed
shared/products.js - Fare calculations
shared/pricing.js
Other components
- Traveller
Connections 30
- Traveller → React app: uses
README.md - React app → Flight discovery: routes to
src/App.jsx - React app → Flight details: routes to
src/App.jsx - Flight discovery → Trip and saved flights: reads catalog
src/pages/Home.jsx - Flight details → Trip and saved flights: reads and updates
src/pages/ProductDetail.jsx - Flight discovery → Flight cards: renders
src/pages/Home.jsx - Flight details → Flight cards: renders related
src/pages/ProductDetail.jsx - Trip and saved flights → Catalog and orders API: fetches catalog
src/context/StoreContext.jsx - Catalog and orders API → HTTP client: sends requests
src/services/api.js - Trip cart → Trip and saved flights: reads trip
src/pages/Cart.jsx - Saved flights → Trip and saved flights: reads saved flights
src/pages/Wishlist.jsx - Booking checkout → Trip and saved flights: reads and clears trip
src/pages/Checkout.jsx - Booking checkout → Catalog and orders API: creates booking
src/pages/Checkout.jsx - Booking checkout → Fare calculations: shows totals
- Booking history → Catalog and orders API: loads bookings
src/pages/Orders.jsx - Booking details → Catalog and orders API: loads booking
src/pages/OrderDetail.jsx - Account session → Authentication client: manages session
src/context/AuthContext.jsx - Authentication client → HTTP client: sends requests
src/services/auth.js - React app → Account session: provides account state
src/main.jsx - Traveller → Booking checkout: submits booking
README.md - HTTP client → Express server: calls API
README.md - Express server → Booking API: mounts routes
server/index.js - Express server → Account and sessions: mounts auth
server/index.js - Booking API → Catalog and booking store: reads and writes
server/api.js - Account and sessions → Catalog and booking store: claims records
server/identity.js - Catalog and booking store → Database connection: queries
server/db.js - Database connection → Neon Postgres: connects
README.md - Catalog and booking store → Flight catalog seed: seeds catalog
server/db.js - Catalog and booking store → Fare calculations: calculates booking totals
server/db.js - Account and sessions → Neon Postgres: stores accounts and sessions
server/identity.js