TrackMyVan is a mobile application to provide real-time tracking, notifications, and safety updates for school van transport services in Sri Lanka. It consists of two client applications (Driver and Parent apps) connected to a cloud-based Firebase backend for real-time data synchronization.
The architecture follows a client-server model with two React Native applications:
- Driver Mobile App: For van drivers to manage trips and share location.
- Parent Mobile App: For parents to track their child's location and attendance.
- Backend Layer: Firebase Authentication, Realtime Database, Firestore, Storage.
- Google Maps Platform: Mapping and geocoding services.
- Open Routing Service: Route Optimization.
- Device GPS: Hardware-level location services.
- Framework: React Native 0.81.5 (Expo SDK 54.0.0)
- Language: TypeScript
- Navigation: Expo Router
- Maps: React Native Maps
- Styling: NativeWind + TailwindCSS
- Database: Firebase Realtime Database (Location/Trip Data) & Firestore (User/Student Data)
- Authentication: Firebase Authentication
- Logic: Node.js runtime (Cloud Functions/Client SDK)
- API Communication: Axios (Driver-App), Firebase SDK 10.7.0
- Visual Studio Code
- Expo CLI
- Git
- Real-Time Tracking: Drivers update location every 5 seconds; Parents view live updates.
- Route Optimization: Uses OpenRouteService for optimized paths.
- Authentication: Secure login for Parents and Drivers.
- Trip Management: Start/End trips, mark attendance (Picked Up/Dropped Off).
- Notifications: Automated status updates for parents.
- Dashboard for trip summary.
- Map view for navigation.
- Student list for attendance.
- Settings & Messages.
- Real-time map view of the child.
- Attendance logs.
- Driver communication (Messages).
- Child profile management.
"student_uid": {
"age": "string",
"grade": "string",
"name": "string",
"status": "string",
"driverId": "string", // Foreign Key to Driver
"parentId": "string", // Foreign Key to Parent
"homeLocation": { "latitude": "number", "longitude": "number" },
"schoolLocation": { "latitude": "number", "longitude": "number" }
}drivers/{driver_id}: Name, Email, Phone, Role.parents/{parent_id}: Name, Email, Phone, Role.
"trip_id": {
"date": "string",
"driverId": "string",
"status": "string",
"startTime": "Timestamp",
"endTime": "Timestamp",
"children": [{ "childId": "string", "status": "string" }]
}Stores optimized route geometry and waypoints for navigation.
Stores chat messages between drivers and parents.
{
"bearing": "number",
"lat": "number",
"lng": "number",
"speed": "number",
"timestamp": "number (Epoch)"
}-
Real-Time Synchronization:
- Used Firebase Realtime Database with
onValuelisteners for instant location updates (5s interval). - Subscription management to prevent memory leaks.
- Used Firebase Realtime Database with
-
Network Reliability:
- Implemented exponential backoff for API calls (3 attempts, 1s -> 5s delay).
- Graceful UI fallbacks for offline states.
- Rate limiting via custom
RateLimiterclass for OpenRouteService (40req/min).
-
Battery Optimization:
- Location updates configured with time (5s) and distance (10m) thresholds to balance accuracy and power consumption.