In this section, we'll be developing the text-based
search feature for our Travel Companion
application.
And in this video, we'll be discussing exactly
how we plan to achieve that.
Let's start with the user interface.
Here we'll need a text field for our search
box for the user to type in a city or country
that they want to visit.
Next, we'll have a set of checkboxes for the
user's preferences.
This will include items such as beaches, cuisine,
historical sites, and so on.
The user will only be able to select 3 of
these.
After that, just below the form, is where
we'll be displaying all the suggested destinations
returned by the Gemini API.
As we have seen in the walkthrough of the
application, these will be displayed in column
cards each displaying the following information.
The city or place suggested.
The price range to visit the spot, that is,
budget, moderate and luxury, the description
of the place, the best time to visit based
on weather conditions and area, and top attractions
in the suggested destination.
Each destination card will also contain a
check weather button that will retrieve and
display weather information for the selected
destination.
So that's the structure for the front end
of this feature.
Now let's discuss the back end.
At the back-end, our front-end form will be
calling an endpoint to request the destination
suggestions.
This will be a POST back-end that we will
name api-slash-suggest-by-location.
And this will take two parameters, location,
which is a string name of where the user wishes
to visit sent from the search field in the
front-end, and an optional list of preferences
sent as strings.
This endpoint will take this data, prepare
it into a prompt, and send it over to the
Gemini API.
The API will then return a structured JSON
output with all the data we need for the front-end
to display the results.
And that's the plan.
In the next video, we'll start developing
this feature by building the back-end endpoint.