How fran-tor/flight-search works
Project Type and Purpose
• This is a full-stack flight search application that leverages the Amadeus API to allow users to search for flight information.
File Structure Analysis
• There are two main top-level directories: “backend” and “frontend”. This indicates a clear separation between server-side and client-side components.
– The FlightSearchApplication.java serves as the entry point.
– The “config” directory (including SSLConfig.java) signifies specific configuration setups, which might include secure communications.
– The “controllers” directory (e.g., FlightSearchController.java) handles incoming API requests.
– The “services” folder (e.g., FlightSearchService.java) encapsulates business logic.
– The “repositories” folder (e.g., AmadeusRepository.java) likely handles communication with the external Amadeus API.
Key Components & Their Roles
• Frontend:
– User Interface built with React and Material UI.
– Views such as SearchPage, FlightSearchApp, ResultsPage, and DetailsPage that display and manage flight search functionalities.
– API utility files (e.g., flights.ts) that facilitate communication with the backend.
– Assets including airlines, airports, and dummy flight search results for data simulations.
• Backend:
– Main Application: FlightSearchApplication.java (Spring Boot entry point).
– Controllers: FlightSearchController.java that exposes RESTful endpoints.
– Services: FlightSearchService.java manages the business logic of the flight search.
– Models: A set of Java classes (such as FlightDetails, FlightSegmentDetails, Amenity, etc.) representing the domain entities.
– Repositories: AmadeusRepository.java communicates with the Amadeus API, acting as the integration point.
– Configuration: SSLConfig.java suggests secured communication setups.
• External Services:
– Amadeus API integration is central to this application, requiring API keys provided by the user during setup.
• Deployment:
– Docker and Docker Compose are used to containerize and orchestrate both frontend and backend services.
– Separate dockerfiles exist for both sub-projects, ensuring environment consistency for both development and production.