- Generate travel Itineraries based on user preferences.
- A web app on which user can enter their preferences and receive multiple travel options based on their inputs.
- Deployed at https://atlan-travel-itinerary.vercel.app/
- Frontend - React
- Backend - Spring Boot, Containerised using Docker
- Database - Neo4j Graph DB
- Hosting - Vercel and Render (Free tier so very slow)
Frontend - https://github.com/rajxsv/travelItinerary Backend - https://github.com/rajxsv/travelitinerarybackend
- The frontend takes in user inputs from these mentioned fields or using a prompt to ai chat bot
- Fetches routes based on user preferences by using cypher query on graph db sorted acc to preferences.
- User can now select the desired route and view details
The query finds paths between cities based on user input (budget, duration, and interests). It matches cities, attractions, accommodations, and restaurants. Then, it filters by budget, duration, and user interests, calculates total costs and time for the trip (including travel), and returns valid paths within the user's constraints (total cost and trip time).
Another query does not take startCity into account and rather finds all the relationships where the user interests exists and then creates paths which takes into account all the cities with user interests.
GraphDBs excel at traversing relationships (e.g., city connections) quickly, making multi-hop queries (up to 6 hops) faster than SQL, which would require complex joins. The "upto 6 hops" parameter was chosen as a balance between number of cities in the db and possible number of paths. Although, this number can be increased as much as possible giving us redundant and repeated paths as well.
In GraphDB, relationships (like CONNECTED_TO
, HAS_ATTRACTION
) are first-class citizens, making it easier to model and query interconnected data, unlike SQL where relations are implied through joins. Even while getting all the interests we don't really need to be concerned about the exact cities but rather only their activities, accommodations etc as a separate entity.
GraphDB scales better for complex, interconnected data (e.g., cities, attractions, routes), avoiding the overhead of numerous joins or subqueries required in relational databases.
Neo4j allows writing query through its cypher query language, for the exact query refer to the backend code in the file CityController.java. Neo4j and Cypher - https://neo4j.com/docs/cypher-manual/current/introduction/cypher-neo4j/
- URL:
/v1/findAllInterests
- Method:
GET
- Description: Retrieves all unique interest types from activities, restaurants, accommodations, and attractions.
- Response: Returns a list of interest types such as activity types, cuisines, accommodation types, and attraction names.
- URL:
/v1/findOptimalTripsWithStartCity
- Method:
GET
- Description: Retrieves optimal trips starting from a specific city based on user budget, interests, and trip duration constraints.
- Query Parameters:
userMaxBudget
: Maximum budget allowed for the trip.maxTripDuration
: Maximum duration allowed for the trip.userInterests
: List of user-selected interests.userBudget
: User's budget level (e.g., low, medium, high).startCityName
: Name of the city where the trip starts.
- Response: Returns details of cities along the path, including city names, attractions, accommodations, restaurants, activities, total trip cost, and total trip duration.
- URL:
/v1/findOptimalTrips
- Method:
GET
- Description: Retrieves optimal trips based on user budget, interests, and trip duration without specifying a start city.
- Query Parameters:
userMaxBudget
: Maximum budget allowed for the trip.maxTripDuration
: Maximum duration allowed for the trip.userInterests
: List of user-selected interests.userBudget
: User's budget level (e.g., low, medium, high).
- Response: Returns details of cities along the path, including city names, attractions, accommodations, restaurants, activities, total trip cost, and total trip duration.
- URL:
*
- Method:
GET
- Description: Handles undefined routes and returns an error message.
- Response: Displays a message indicating an invalid route.
-
Clone the Frontend Repository:
git clone https://github.com/rajxsv/travelItinerary.git
cd travelItinerary
-
Install Dependencies: Make sure you have Node.js installed. Run the following command to install the necessary packages:
npm install
-
Run the Development Server: After installing dependencies, start the development server with:
npm run dev
The application will be running athttp://localhost:5173
by default. -
Build for Production: To create a production build, run:
npm run build
-
Clone the Backend Repository:
git clone https://github.com/rajxsv/itineraryBackend.git
cd itineraryBackend
-
Configure Application Properties: Update the
application.properties
file insrc/main/resources/
with the correct credentials and database details for Neo4j:spring.neo4j.uri=your_db_uri
spring.neo4j.authentication.username=neo4j
spring.neo4j.authentication.password=your_password
-
Build the Project: Ensure Maven is installed and build the project:
mvn clean install
-
Run the Spring Boot Application: After building, run the Spring Boot server:
mvn spring-boot:run
The backend will be running athttp://localhost:8080
.