A powerful, real-time transit tracking application for Bordeaux MΓ©tropole's public transportation network (TBM). Monitor buses, trams, and BRT lines with live GPS tracking, service alerts, and comprehensive network information.
- Live Vehicle Positions: GPS-based tracking of all TBM vehicles in real-time
- Accurate Arrival Times: Precise ETAs using GTFS-RT data
- Auto-Refresh Mode: Continuous 30-second updates for monitoring
- Delay Indicators: Visual status indicators for on-time, delayed, or early arrivals
- 700+ Stops: Complete coverage of all TBM network stops
- 100+ Lines: All tram, bus, and BRT lines with route information
- Service Alerts: Real-time notifications about disruptions and changes
- Line Colors: Authentic TBM branding with official line colors
- 15-Day GTFS Cache: Reduces bandwidth and speeds up loading
- Intelligent Refresh: Automatic updates only when needed
- Offline Fallback: Uses cached data when network is unavailable
- Optimized Performance: Separate static and dynamic data management
- Colorized Output: Line codes displayed in official TBM colors
- Intuitive Navigation: Simple numbered menu system
- Smart Search: Partial name matching for stops and lines
- Rich Information Display: Detailed vehicle, stop, and line information
- Rust 1.70+: Install from rustup.rs
- Internet Connection: Required for initial data download and real-time updates
# Clone the repository
git clone https://github.com/Cyclolysisss/NVT.git
cd NVT
# Build the project
cargo build --release
# Run the application
cargo run --releaseDownload the latest pre-built binary from the Releases page.
# Linux/macOS
chmod +x nvt
./nvt
# Windows
nvt.exe-
Launch the application
cargo run --release
-
Select a line (Option 1)
- Enter line code (e.g.,
A,C,1,23) - Or enter full name (e.g.,
Tram A)
- Enter line code (e.g.,
-
Select a stop (Option 2)
- Enter partial or full stop name
- Choose from multiple matches if needed
-
View real-time arrivals (Option 3)
- See next vehicles with live ETAs
- Auto-refreshes every 30 seconds
- Press Enter to exit refresh mode
π MENU OPTIONS
1οΈβ£ Select a line
2οΈβ£ Select a stop
3οΈβ£ Show next vehicles in real-time π
4οΈβ£ Browse all stops
5οΈβ£ Browse all lines
6οΈβ£ Show cache statistics π
0οΈβ£ Quit application
β Select Option: 1
π Enter line name or code: A
β Line selected: A - Tram A
π― Destinations:
β Outbound : La Gardette Bassens Carbon Blanc
β Inbound : Le Haillan Rostand
β Select Option: 2
π Enter stop name: hotel de ville
β Stop selected: HΓ΄tel de Ville
π Lines serving this stop: A B
β Select Option: 3
π AUTO-REFRESH MODE - Update #1
π
Monday, October 21, 2025 at 15:34:28 CEST
1. A Tram A
π― Direction: La Gardette Bassens Carbon Blanc
β° Time: 15:37:30 (π’ 3 min)
β±οΈ Status: π’ On time
π Source: Real-time GPS tracking
π Vehicle ID: 1234
Select a line first, then view only vehicles on that line at any stop.
Automatically displays active and future alerts for selected stops and lines.
View cache statistics to monitor data freshness and performance.
The application uses official TBM (Transports Bordeaux MΓ©tropole) data sources:
- Stops Discovery:
https://bdx.mecatran.com/utw/ws/siri/2.0/bordeaux/stoppoints-discovery.json - Lines Discovery:
https://bdx.mecatran.com/utw/ws/siri/2.0/bordeaux/lines-discovery.json
- Vehicle Positions: Real-time GPS locations
- Trip Updates: Arrival/departure predictions
- Service Alerts: Network disruptions and changes
- Routes: Line colors and route information
- Stops: Comprehensive stop database
| Data Type | Update Interval | Cache Duration |
|---|---|---|
| Vehicle Positions | 30 seconds | N/A (real-time) |
| Trip Updates | 30 seconds | N/A (real-time) |
| Service Alerts | 30 seconds | N/A (real-time) |
| Stops/Lines Metadata | 1 hour | 1 hour |
| GTFS Static Data | On-demand | 15 days |
NVT/
βββ src/
β βββ main.rs # Application entry point & error handling
β βββ nvt_models.rs # Data models & API fetching
β βββ nvt_views.rs # User interface & display logic
β βββ nvt_controllers.rs # Business logic & app flow
βββ Cargo.toml # Dependencies & metadata
βββ README.md
- API Integration: Fetches data from TBM endpoints
- Data Structures:
Stop,Line,RealTimeInfo,AlertInfo - Caching System: Intelligent cache management
- GTFS Processing: Handles GTFS-RT protobuf decoding
- UI Components: Menus, prompts, and formatted output
- Color Rendering: ANSI color codes for line branding
- Information Display: Vehicle, stop, and line information
- Error Messages: User-friendly error handling
- Application Flow: Main menu loop and navigation
- Selection Handling: Line and stop selection logic
- Auto-Refresh: Real-time update mechanism
- Input Processing: User input validation and parsing
- MVC Architecture: Separation of concerns (Models, Views, Controllers)
- Caching Strategy: Two-tier cache (static + dynamic)
- Error Handling: Custom
Resulttype withNVTErrorenum - Lazy Loading: Data fetched only when needed
The GTFS cache is stored in the system cache directory:
- Linux:
~/.cache/tbm_nvt/gtfs_cache.json - macOS:
~/Library/Caches/tbm_nvt/gtfs_cache.json - Windows:
%LOCALAPPDATA%\tbm_nvt\gtfs_cache.json
API endpoints and keys are configured in nvt_models.rs:
const API_KEY: &'static str = "opendata-bordeaux-metropole-flux-gtfs-rt";
const BASE_URL: &'static str = "https://bdx.mecatran.com/utw/ws";const REQUEST_TIMEOUT_SECS: u64 = 15; // API request timeout
const STATIC_DATA_MAX_AGE: u64 = 3600; // 1 hour
const DYNAMIC_DATA_MAX_AGE: u64 = 30; // 30 seconds[dependencies]
reqwest = { version = "0.11", features = ["blocking"] } # HTTP client
serde = { version = "1.0", features = ["derive"] } # Serialization
serde_json = "1.0" # JSON parsing
gtfs-rt = "0.4" # GTFS-RT decoder
prost = "0.12" # Protobuf support
chrono = "0.4" # Date/time handling
chrono-tz = "0.8" # Timezone support
csv = "1.3" # CSV parsing
zip = "0.6" # GTFS archive extraction
dirs = "5.0" # System directoriesContributions are welcome! Please follow these guidelines:
- Check existing issues first
- Provide detailed error messages
- Include steps to reproduce
- Mention your OS and Rust version
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Rust standard conventions
- Run
cargo fmtbefore committing - Ensure
cargo clippypasses - Add documentation for public functions
- TBM (Transports Bordeaux MΓ©tropole): For providing open data APIs
- Bordeaux MΓ©tropole: For supporting open data initiatives
- Mecatran: For hosting and maintaining the TBM data feeds
- Rust Community: For excellent libraries and documentation
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- TBM Official Site: infotbm.com
- Open Data Portal: transport.data.gouv.fr
- Offline mode with cached data and schedulded trips
- Trip planning functionality
- Favorite stops/lines
- Notifications for specific arrivals
- Export data to CSV/JSON
- Historical data analysis
- Multi-city support
- Requires internet connection for real-time updates
- French language data (stop/line names)
- Limited to TBM network (Bordeaux area)
- Lines Supported: 100+
- Stops Covered: 700+
- Update Frequency: Every 30 seconds
- Cache Duration: 15 days (GTFS static)
- API Response Time: ~1-3 seconds
If you find this project useful, please consider giving it a star! β
Made with β€οΈ by Cyclolysisss
This project is NOT affiliated with TBM or Bordeaux MΓ©tropole in ANY WAY.