How raghunandan0/travel-itinerary-hub works
Project Type & Purpose
• This is a frontend-only, Vite-powered, React/TypeScript web application (“Travel Itinerary Hub”) that lets users design and preview travel itineraries in the browser.
High-Level File/Module Structure
• src/main.tsx: Application entry point, renders <App/> into the DOM.
• src/App.{tsx,jsx}: Root component that orchestrates the UI.
• src/components: Feature components (TravelForm, ItineraryDisplay, FlightSummary, HotelBookings, LoadingSpinner, Header, Footer).
• src/ui: Reusable primitives (Button, Card, Input).
• src/utils: Business logic modules (itineraryGenerator, pdfGenerator, destinationImages).
• tailwind.config.js & index.css: Styling setup.
• vite.config.ts: Build/dev server config.
Main Components & Relationships
• Browser ↔ Vite Dev Server (or Static Host)
• Serves index.html + compiled JS/CSS.
• React App (src/main.tsx → <App/>)
• <Header/> + <Footer/> wrap the main content.
• <TravelForm/> collects user inputs.
• <ItineraryDisplay/> renders the generated plan and exposes “Export to PDF” (via pdfGenerator).
• <FlightSummary/>, <HotelBookings/> show individual itinerary sections.
• <LoadingSpinner/> shows while itineraryGenerator runs.
• Utils
• itineraryGenerator.ts produces day-by-day items.
• pdfGenerator.ts packages the displayed itinerary into a downloadable PDF.
• destinationImages.ts resolves image assets for each location.
Architectural Patterns & Design Principles
• Component-based UI with clear separation of:
• “Container” components (App, ItineraryDisplay) vs “Presentational” UI primitives (ui/Button, ui/Card, ui/Input).
• Business logic isolated in src/utils.
• CSS-in-JS replaced by Tailwind utility classes (config in tailwind.config.js).
• Vite for fast HMR and build.