Skip to content

mridul-hossain/context_aware_travel_app

Repository files navigation

🧭 Context-Aware Intelligent Travel Companion

📖 Project Overview

Travel Companion is a Python-based mobile application designed to assist users in planning and managing their travel experiences while visiting Montreal. The application utilizes context-awareness, knowledge representation, and adaptive user interfaces to provide personalized recommendations.

By integrating real-time data (Location, Weather, Time) with a semantic Ontology, the app dynamically suggests restaurants, attractions, and activities that fit the user's immediate environment and personal preferences.


📱 Features & Capabilities

1. Dynamic Context Awareness

The application detects and adapts to four key user contexts:

  • 📍 Location: Uses Geopy to detect the user's current coordinates to provide nearby recommendations.
  • ⏰ Time of Day: Automatically detects the current time to suggest appropriate meal phases (Breakfast, Lunch, Dinner) or activities.
  • 🌤️ Weather: Fetches real-time forecasts via the OpenWeather API to influence activity suitability (e.g., suggesting indoor museums during rain).
  • 👤 User Preferences: Adapts to user inputs regarding cuisine types, preferred activities (indoor/outdoor), and attraction interests.

2. Intelligent Reasoning (Ontology)

  • Knowledge Representation: Uses Protégé and Owlready2 to model travel knowledge.
  • Smart Filtering: The system reasons against the ontology to filter out activities unsuitable for the current weather (e.g., excluding parks during snow) or time (e.g., excluding closed venues at night).

3. Adaptive User Interface & Real-Time Updates

  • Live Notifications: The app monitors context changes in the background. If the time shifts from "Lunch" to "Afternoon," the app notifies the user and refreshes recommendations.
  • Preference Management: Users can update their profile preferences at any time, instantly triggering new, adaptive recommendations.

🛠️ Tech Stack

Component Tool / Library Usage
UI Framework KivyMD (Python) Material Design mobile interface.
Logic/Backend Python Core application logic.
Knowledge Base Owlready2 Loading and querying the .owl ontology file.
Data Source Google Places API Fetching real-world restaurants and attractions.
Weather OpenWeatherMap API Real-time weather conditions.
Database SQLite Local storage for user profiles and preferences.
Auth Google OAuth 2.0 Secure user sign-in.

✅ Implementation of Requirements

This project fulfills the core requirements as follows:

Requirement Implementation Detail
User Contexts Implemented in context_module.py (Location/Weather) and main.py (Time logic).
Meal Recommendations main.py calculates the current "Meal Phase" and queries Google Places for cuisines matching the user's DB profile.
Weather-Based Recs ontology_module.py checks the is_good_for_weather property in the ontology to validate suggestions against current conditions.
Time Constraints The app prevents recommendations for inappropriate times (e.g., parks at 4 AM) via ontology reasoning.
LLM Assistance Large Language Models were used as assistive systems during development.

📂 Project Structure

  • main.py: Entry point. Handles UI navigation, the dashboard lifecycle, and the background clock scheduler for real-time updates.
  • context_module.py: Interface for external APIs (Geopy, OpenWeather, Google Maps).
  • ontology_module.py: Loads the travel_ontology.owl file and performs semantic reasoning to filter recommendations.
  • auth_module.py: Manages the Google Login flow.
  • database_setup.py: Initializes the SQLite database for local storage.
  • app_layout.kv: Kivy design file containing the UI layout and styles.

⚙️ Setup & Installation

  1. Install Dependencies:

    pip install kivymd google-auth-oauthlib requests geopy owlready2 python-dotenv
  2. Environment Variables: Create a .env file in the root directory and add your API keys:

    OPENWEATHER_API_KEY=your_key_here
    GOOGLE_MAPS_API_KEY=your_key_here
  3. Authentication: Place your Google Cloud client_secret.json file in the assets/ folder.

  4. Run the Application:

    python main.py

🧪 Testing Notes

  • Time Travel Mode: For demonstration purposes, a manual time variable (HOUR) is implemented in main.py to simulate time passing (e.g., switching from Lunch to Dinner) to test adaptive notifications without waiting for real-time hours.

About

Concordia University-Academic Project (SOEN 7761)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages