A modern Android application that displays real-time GO Train information, built with Jetpack Compose and following clean architecture principles. This is the Android version of the GO Train Tracker iOS app.
-
Train Schedule Viewing
- View real-time train schedules between stations
- Filter trains by status (On-time, Delayed, Cancelled)
- Refresh schedules manually
- Beautiful Material Design 3 UI with animations
-
Station Management
- View all GO Train stations
- Set home station preferences
- Station search and filtering
- Local storage of station data
-
Union Station Integration
- Real-time Union Station departures
- Platform information
- Train status updates
-
Settings & Preferences
- Customize app appearance
- Manage notifications
- Set default stations
- Data refresh preferences
- Real-time train tracking with GPS
- Custom notifications for specific trains
- Journey planning with multiple stops
- Offline mode support
- Widget support for quick schedule viewing
- Dark mode support
- Accessibility improvements
The app follows clean architecture principles with distinct layers:
-
Data Layer
- Ktor-based API client for Metrolinx API integration
- Room database for local storage
- DTOs for API responses
- Repository implementations
-
Domain Layer
- Domain models (
TrainTrip
,GOTrainStation
) - Use cases for business logic
- Repository interfaces
- Error handling with Arrow.kt
- Domain models (
-
Presentation Layer
- MVVM architecture with ViewModels
- Jetpack Compose UI components
- Reusable UI components
- State management with Kotlin Flow
-
ViewModels
TrainScheduleViewModel
: Manages train schedule dataOnboardingViewModel
: Handles first-time setupMainTabViewModel
: Manages bottom navigation state
-
Screens
MainTabScreen
: Main screen with bottom navigationTrainScheduleScreen
: Train schedule displayTrainsFromStationScreen
: Station-specific departuresUnionStationDeparturesScreen
: Union Station arrivals/departuresSettingsScreen
: App configuration
-
Use Cases
GetAllGoTrainStationsUseCase
: Fetches all GO Train stationsGetScheduleBetweenStopsUseCase
: Gets train schedulesManageHomeStationUseCase
: Handles home station preferences
- Jetpack Compose for modern UI
- Koin for dependency injection
- Ktor for networking
- Arrow.kt for functional programming
- Kotlinx.datetime for date/time handling
- Room for local storage
- Kotlin Coroutines for async operations
- Material Design 3 for UI components
app/
├── data/
│ ├── api/ # API client and DTOs
│ ├── db/ # Room database
│ ├── local/ # Local data source
│ └── remote/ # Remote data source
├── domain/
│ ├── model/ # Domain models
│ ├── repository/ # Repository interfaces
│ └── usecase/ # Use cases
├── presentation/
│ ├── components/ # Reusable UI components
│ ├── feature/ # Feature-specific screens
│ ├── navigation/ # Navigation setup
│ ├── theme/ # App theme and styling
│ └── utils/ # Utility classes
└── di/ # Dependency injection
- Clone the repository
- Open the project in Android Studio
- Create a
local.properties
file with your GO Train API key:
MY_GO_TRAIN_API=your_api_key_here
- Build and run the app
Please read our Contributing Guidelines and Pull Request Rules before submitting any changes.
MIT License with Additional Restrictions
Copyright (c) 2024
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sublicense copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
- Commercial use, distribution, or publication of the Software or any derivative works is strictly prohibited without explicit written permission from the copyright holder.
- The Software is provided for educational and personal use only.
- Any derivative works must maintain the same license and restrictions.
- The Software may not be used in any commercial applications or services.
- The Software may not be redistributed or resold in any form.
- The Software may not be used to create competing products or services.
- The Software may not be used in any way that could damage the reputation of the original authors or the GO Train service.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
android kotlin jetpack-compose metrolinx clean-architecture go-train transit