Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

54 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

TrailGuide Logo

TrailGuide

A Flutter application for hiking and outdoor adventures that enables offline location tracking, communication, and emergency alerts through Peer-to-Peer networking.

Designed with an Offline-First architecture, TrailGuide establishes direct Peer-to-Peer (P2P) connections between nearby devices without requiring an internet connection or centralized server, making it ideal for remote and low-signal environments.

Platform Flutter Dart Architecture BLoC Isar


๐Ÿ“– Project Overview

TrailGuide is a Flutter-based mobile application designed to improve safety and communication during hiking trips and outdoor activities where internet connectivity is unavailable.

The application leverages the Android Nearby Connections API over Bluetooth and Wi-Fi Direct to establish an offline Peer-to-Peer network, enabling real-time sharing of GPS locations, compass directions, and emergency messages among group members.

Trip history, routes, and statistics are stored locally using Isar Database, allowing the application to operate entirely offline while ensuring user privacy.


โœจ Technical Highlights

  • ๐Ÿ“ก Offline Peer-to-Peer Communication
  • ๐Ÿงญ Real-time GPS Tracking & Smart Radar
  • ๐Ÿšจ Emergency SOS Broadcasting
  • โš ๏ธ Automatic Proximity Alerts
  • ๐Ÿ—บ๏ธ Offline Trip History Logging
  • ๐Ÿ’พ Local Storage with Isar Database
  • ๐Ÿ›๏ธ Clean Architecture with BLoC Pattern

๐Ÿš€ App Showcase

๐Ÿ“ Dashboard

Displays GPS status, provides quick flashlight access, and introduces the application's core features.


๐Ÿ“ก Offline Radar Tracking

Once users join the same room, TrailGuide displays each member's position in real time by combining GPS coordinates with compass heading to calculate distance and direction.


๐Ÿšจ Emergency SOS & Safety Alerts

TrailGuide continuously monitors the distance between group members. When someone moves beyond the predefined safety range, an automatic proximity alert is triggered.

In emergency situations, users can broadcast an SOS signal that immediately notifies every connected device with both visual and vibration alerts.

ย ย ย 


๐Ÿ—บ๏ธ Trip History

At the end of each trip, TrailGuide automatically records travel statisticsโ€”including duration, total distance, route information, and participant detailsโ€”into the local database for future reference.


๐ŸŒŸ Features

Feature Description
๐Ÿ“ก Offline P2P Communication Direct device-to-device communication via Bluetooth and Wi-Fi Direct without internet access
๐Ÿงญ Smart Radar Real-time radar visualization using GPS coordinates and compass heading
โš ๏ธ Proximity Alert Automatically warns users when teammates move beyond the safe distance threshold
๐Ÿšจ SOS Broadcast Instantly broadcasts emergency alerts to every connected group member
๐Ÿ’“ Keep-Alive Monitoring Continuously monitors peer connectivity using a Ping/Pong mechanism
๐Ÿ—บ๏ธ Trip History Automatically records hiking statistics and routes using Isar Database
๐Ÿ“ท Profile Image Sync Compresses and transfers profile images efficiently over the P2P network

๐Ÿ› ๏ธ Tech Stack

Category Technology
Language Dart, Kotlin (Native Bridge)
Framework Flutter
Architecture Clean Architecture
State Management BLoC, Cubit
Database Isar
GPS Geolocator
Compass Flutter Compass
Flashlight Torch Light
Routing GoRouter
P2P Communication Android Nearby Connections API
Native Integration MethodChannel & EventChannel

๐Ÿ›๏ธ Architecture

TrailGuide follows Clean Architecture, clearly separating the Presentation, Domain, and Data layers. Native Android functionality is exposed to Flutter through platform channels, allowing direct access to the Nearby Connections API.

Architecture Diagram

                 Flutter UI
                      โ”‚
                      โ–ผ
              BLoC / Cubit
                      โ”‚
                      โ–ผ
               Domain Use Cases
          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
          โ–ผ                     โ–ผ
   P2P Repository       History Repository
          โ”‚                     โ”‚
          โ–ผ                     โ–ผ
 Nearby Data Source     Isar Data Source
          โ”‚
          โ–ผ
 Android Nearby API
(MethodChannel / EventChannel)

๐Ÿ“‚ Project Structure

lib
โ”‚
โ”œโ”€โ”€ core
โ”‚   โ”œโ”€โ”€ config
โ”‚   โ”œโ”€โ”€ constants
โ”‚   โ”œโ”€โ”€ error
โ”‚   โ”œโ”€โ”€ theme
โ”‚   โ””โ”€โ”€ utils
โ”‚
โ”œโ”€โ”€ features
โ”‚   โ”œโ”€โ”€ history
โ”‚   โ”œโ”€โ”€ onboarding
โ”‚   โ”œโ”€โ”€ p2p
โ”‚   โ”œโ”€โ”€ profile
โ”‚   โ”œโ”€โ”€ settings
โ”‚   โ””โ”€โ”€ tracking
โ”‚
โ””โ”€โ”€ main.dart
Folder Responsibility
core Shared utilities, application configuration, themes, and common components
history Trip history management using Isar
onboarding User profile setup and onboarding flow
p2p Peer-to-Peer communication and room management
profile User profile features
settings Application settings
tracking GPS tracking and location calculations

๐Ÿ”„ P2P Data Flow

๐Ÿ“ฑ Device A (Host)                   ๐Ÿ“ฑ Device B (Member)
        โ”‚                                    โ”‚
 ๐Ÿ“ก Start Advertising                 ๐Ÿ“ก Start Discovery
        โ”‚                                    โ”‚
        โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ๐Ÿค Handshake & PIN โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
        โ”‚                                    โ”‚
 ๐Ÿ“ Send GPS (LOC:HOST,Lat,Lng) โ”€โ”€โ”€โ”€โ”€โ–ถ ๐Ÿ“ Receive GPS Data
        โ”‚                                    โ”‚
 ๐Ÿงฎ LocationCalculator                ๐Ÿงฎ LocationCalculator
 (Distance & Bearing)                 (Distance & Bearing)
        โ”‚                                    โ”‚
 ๐Ÿงญ Merge Compass + GPS               ๐Ÿงญ Merge Compass + GPS
        โ”‚                                    โ”‚
 ๐ŸŽฏ Update Radar UI                   ๐ŸŽฏ Update Radar UI

โš™๏ธ Engineering Challenges

Challenge Solution Result
Unexpected P2P disconnections Keep-Alive (Ping/Pong) mechanism Automatically detects disconnected peers
Compass instability and sensor noise Low-pass filtering Smoother and more accurate radar rotation
Flutter-to-Android communication EventChannel streaming Real-time bidirectional data transfer
Large profile image size Image compression + Base64 encoding Faster P2P transmission with reduced bandwidth usage
Continuous GPS tracking Stream processing with Isar Efficient route recording and local persistence

๐Ÿš€ Getting Started

git clone https://github.com/MarkCnw/TrailGuide.git
cd TrailGuide
flutter pub get
flutter run

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages