Developed by:
Dhruvil Shah dshah4@ncsu.edu
Neeraj Shukla nshukla2@ncsu.edu
Poorvaja Penmetsa ppenmet@ncsu.edu
Sreemoyee Ray sray9@ncsu.edu
Sameer Adhikari sadhika2@ncsu.edu
The purpose of this document is to provide information about the TripSage web application to the current and future software developers. This document explains the high-level technical and functional requirements of the app. It details the features, design aspects, and future work on the website for further developments. It is used to describe this web application's intended capabilities, appearance, and interactions with users in detail. This also acts as a kind of guideline and continuing reference point as the developers write the programming code to extend the application's features.
This Functional and Technical Requirements Document outlines the functional, performance and other system requirements for theTripSage application. The scope of this work includes the initial features of the web application. Suggested features that can be added are provided in section 4.0. Use cases for the suggested features can be found in section 2.3
Low level technical requirements and implementation details of suggested features are out of the scope of this document.
API: Application Programming Interface, a set of protocols or standards for communicating with web based applications
CSS3: Cascading Style Sheets; language used to describe the presentation of a document written in markup language, e.g., HTML
Django: A python based web framework used for development of web applications
HTML: Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser
Javascript: Javascript is a text-based programming language which is used to make web pages interactive
Ajax: Ajax is a set of web development techniques using many web technologies on the client side to create asynchronous web applications
Google Geolocation API: It returns a location and accuracy radius based on information about cell towers and WiFi nodes that the mobile client can detect
Travelling to a new country can be stressful. Couple that with COVID, almost impossible. But the mental health benefits of travelling to new and exciting places doesn't have to be so risky and expensive.
TripSage is a website that plans trips for users inside their home country. Simply, pick a destination state and cities, and you'll be directed to your ideal trip. We have plans to include tags for: COVID -19 hotspots, whether the location is indoors, and the general population at that location to make sure users can practice safe travelling.
A new way of life doesn't have to mean you can't travel.
Explore the new way of travelling with TripSage.
TripSage is the ultimate itinerary planner to help users in their travel plans. This application will allow a user to plan their trip according to their vacation preferences. Whether you are travelling with your kids, want an adventurous trip with your friends group or want a weekend to relax and unwind, TripSage will create the perfect itinerary for you. It will guide the user with the best time to visit their preferred places, the latest Covid -- 19 updates and the best route to travel, all while adhering to the user's budget.
The scope of TripSage can be defined using the following functionalities in a broad sense
- Users can login to the website
- Flow 1:
- Accept the inputs [Appendix-A] from the user.
- Display/suggest places to visit with the tags
- Best time tovisit
- Covid warnings
- Type of the place (Adventurous, Sightseeing, good for food, sport, etc)
- Users can pick the places to visit from these suggestions and press next.
- TripSage will generate itineraries using the places users want to visit.
- Tripsage will suggest the cheapest route to the user
- Flow 2:
- Accept the inputs [Appendix-A] from the user.
- From the type of trip the user wants, TripSage generates an itinerary using the places to visit from the destination cities the user is planning to visit.
- Tripsage will suggest the cheapest route to the user
Why Django?
The purpose behind choosing Django was two-fold. We wanted to challenge ourselves with this project, but set realistic expectations. So, instead of learning a new language for web development, we decided to use a Python framework, a language our entire team (and many others) are comfortable with.
Also, Django follows MVT(model-view-template) architecture which can be used independently making it reliable, flexible and simple. Moreover, it has its own server and the learning curve is pretty minimum. Compared to Flask, Django is used for applications that serve more than just one requirement. We envision and designed TripSage to include many features, making Django the better choice.
General set of features designed for TripSage:
-
User account creation
-
Saving a trip
-
Sharing a trip with other users
-
Type of Trip: Suggestions for places to visit as per user's preferred type of vacation like relaxed, adventurous, travelling with kids.
-
Travel Dates: Suggestions based on the user's preferred travel dates
-
Mode of Transportation: Suggestions based on the user's preferred transportation mode like flight, car or bus.
-
Budget: Adjustable budget to suit every user's needs
-
Route: Suggests the best route for the trip
-
Best Time to Visit: Suitable months, time of the day
-
Covid -- 19 Statistics:
a. Specified as "High", "Medium", "Low" based on the population at the specified location and whether the location is indoors or outdoors.
Planning a New Trip
Saving a Trip
Sharing a Trip
Editing a Trip
The TripSage application is built with Django, an open source web application framework, written in Python. The location data displayed in the itinerary is fetched using Google Geolocation API. Alternatively, in a different version, data will be stored in a SQLite3, also open source. The user interface is developed in HTML5, CSS3, JavaScript and Ajax. The backend is coded in Python. The application is compatible with all web browsers. The application code uses Git version control, and all commits will be archived in a designated repository.
TripSage is developed with Django, a high-level Python web application framework that enables the rapid development of web applications. It follows the MTV (Model Template View) architecture:
-
User requests for Django based website
-
URL calls corresponding function in views.py (mapping found in urls.py)
a. view can take a request and return a response
b. view interacts with Model and Template
-
Template is combination of static HTML and Django Syntax (Python)
-
Model is a class representing table/collection in models.py
Following is the list of Models in TripSage and a brief description of
each:
City: To store cities
Trip: To store the trips generated from the itinerary planner
Places: Locations/spots within cities that will be displayed as part of the itinerary
Destinations: The cities that can be destinations
Contains: To store the mapping between Places and Cities
Tags: Different tags which will be used to tag Places
Tagged_as: To store the mapping between Places and Tags
(Legend: Italics + Bold: Directories, Bold: Files, Italics: Functions, Plain: Descriptions )
TripSage/
tripHome/
models.py - Describes tables for database. Each function describes a table in the database (check documentation for more information)
views.py - A View is a python function or classe that takes a request and provides a response. It can render the HTML pages, call APIs, push and retrieve
data from tables in the database
getResponse -
1. Calls Google Geolocation API to fetch locations as per user's trip preference
2. Checks results for duplicates and standard number of places for each activity according to the dictionary type_places_map
3. Stores results in JSON object
resultsPage - renders results.html
index - renders index.html
urls.py - maps url patterns to functions in views.py
templates/
index.html - extends to base_generic.html
base_generic.html - landing page
result.html - results page
static/
js/
custom.js Functionality for base_generic.html.
saveData() - saves data from landing page and redirects to results.html
resultsPage.js - Functionality for results.html. Connects results.html to getResponse in views.py
showData() - JS for results.html
The diagram below shows the flow of control from when a user enters their trip details on the landing page of tripHome to seeing their results The bold text signifies start and end states.
Our team uses VSCode or Pycharm.
Linter:
VSCode, Pycharm: pylint
Style Checker:
VSCode, Pycharm: pylint (pep8)
Code Formatter:
Black
The TripSage application currently supports the following functionalities:
Allow user to create a Trip using Flow#2 where, the user only inputs the destination city/cities to visit and Type/types of trip along with the estimated Trip time.
The website uses Google Maps api to fetch the appropriate places for the given destination along with their ratings and displays the list of places.
The following functionalities have not been implemented yet:
1.User Login: Update models.py [Left to acquaint Team 2 about the database structure] to include User [EmailId, Password] and Trips_Planned [EmailId, TripId]. Implement authentication page and retrieve Trips saved by User.
2. Sharing Trips: Allow users to share trips they created with other users.
3. Implementation of an algorithm to create an itinerary from the places retrieved using the api. The algorithm will be a Constraint Satisfaction Problem, constrained by best time to visit a place and the location of a place. However, details of exact implementation are left for the next team.
4. Implementation of functionality using Google Maps [or any other api (decision left for next team)] to determine the cheapest Travel route based on the destinations and number of people.
5. Implementation of Trip Creation using Flow#1, where a user already has a trip planned to the exact dot, including the places, they want to visit and only need our assistance to schedule and get the cheapest travel route.
While showing the suggestions itself, users can remove suggested places, modifying the itinerary dynamically.
Dynamic computation of Popularity and covid tags based on the no of trips generated for the particular place on a given date.
[Inputs from User:]{.underline}
-
Trip Name
-
No of people in the trip
-
Source City
-
Destination Cities
-
Start Date
-
End date
-
Places to visits -- optional, but have to enter if not entered the "type of the trip"
-
Type of the trip -- optional, but have to enter if not entered the list of places to visit
- Sygic Travel https://travel.sygic.com/en
Tell Sygic where you\'re going and for how many days. Based on that, the app will create a custom itinerary of the top attractions in that place, along with where you should go on which day.
- Inspirock https://www.inspirock.com
A very close Itinerary planner with suggestion algorithm inbuilt into the website, with the only feature missing is the ability to suggest a cheapest route.
- Django
Check out the basics: Writing your first Django app, part1 - https://docs.djangoproject.com/en/3.1/intro/tutorial01/
The first three parts of this 7 part tutorial cover most of the material needed for our project.
For a more in-depth look at server-side development using Django: Server-side website programming - Learn web development \|MDN - https://developer.mozilla.org/en-US/docs/Learn/Server-side
2. AJAX
Check out the basics of ajax at https://api.jquery.com/jquery.ajax/.
The site covers all the basics of ajax about writing asynchronous calls and provides in depth information about its parameters.
For ajax documentation, please visit https://api.jquery.com/category/ajax/
- Google Map API
The Places API lets you search for place information using a variety of categories, including establishments, prominent points of interest, and geographic locations. You can search for places either by proximity or a text string. A Place Search returns a list of places along with summary information about each place; additional information is available via a Place Details query.
The Find Place request is an HTTP URL of the following form: https://maps.googleapis.com/maps/api/place/findplacefromtext/output?parameters where output may be either of the following values: json (recommended) indicates output in JavaScript Object Notation (JSON) xml indicates output as XML We need to generate a key (from google cloud services) which can authenticate the request we send to Google Maps place API. Since, we connect/authorize the key using our gmail account, we use one of the gmail accounts from our group. For the extension, we can provide our key/can help generate a key for you.








.png)