Welcome to the Travel Recommender documentation. This document provides an overview of the project, installation instructions, usage guidelines, and information about project structure and testing.
Caption: This image represents the expected frontend result of the Travel Recommender.
The Travel Recommender is a FastAPI-based web application that recommends travel destinations based on user input, including the destination country and season.
To run the Travel Recommender locally, follow these steps:
-
Clone the repository: git clone https://github.com/EjDadivas/travelRecommendation.git
-
Change into the project directory: cd travelRecommendation
-
Install dependencies using pip: pip install -r requirements.txt
-
Run the application: uvicorn main:app --host localhost --port 3000 --reload --access-log
-
Access the application in your web browser at http://localhost:3000
- Access the application in your web browser at
/travel-recommendations
. - Provide the following query parameters to get travel recommendations:
country
(string): Name of the country (e.g., "Canada").season
(string): Season (e.g., "Winter", "Summer", "Spring", "Autumn").- If no parameters are provided, the application will display a homepage.
- The endpoint validates input parameters and displays travel recommendations or errors.
Example JSON Response
Here is an example of the JSON response you can expect from the Travel Recommender API when making a successful request:
{
"country": "Bahamas",
"season": "Summer",
"recommendations": [
{
"location": "Nassau",
"activity": "Visit Paradise Island",
"map_link": "https://goo.gl/maps/VdX82PdSmxhpb6FX7"
},
{
"location": "Exuma",
"activity": "Swim with the pigs",
"map_link": "https://goo.gl/maps/Z5KJnoFxh9ktarkX9"
},
{
"location": "Andros Island",
"activity": "Explore Blue Holes",
"map_link": "https://goo.gl/maps/yXnhTrgHZxt6zhLR9"
}
]
}
Configure the application by setting environment variables, including the OpenAI API key, in a .env
file.
The project structure is organized as follows:
main.py
: The main FastAPI application.api
folder: Contains API-related modules.routes.py
: Defines API routes and endpoints.utils.py
: Contains utility functions for input validation and recommendation generation.tests
folder: Contains unit tests for the project.
static
folder: Contains static assets such as CSS styles and images.templates
folder: Contains HTML templates used for rendering web pages, includinghome.html
.