An offline-resilient, beautifully crafted onboard mobile app for Trenord commuters across Lombardy.
Watch the complete onboard experience in actionโincluding ticket onboarding, live map telemetry, podcast playback, offline mini-games, and vehicle motion cues:
Click animation to view or download the full high-definition video walkthrough (MP4).
Trenord Infotainment turns daily train commutes into a smooth, connected, and relaxing journey. Built with a local-first, offline-ready architecture, the app stays snappy and fully usable even during alpine tunnel dead-zones or crowded mobile network handoffs.
| Feature | Description |
|---|---|
| ๐๏ธ Ticket Gate & Auth | Fast optical ticket barcode scanning or manual train code entry with instant schedule & stop onboarding. |
| ๐ Live Journey Tracking | Real-time velocity estimation, dynamic delay projection, tunnel dead-reckoning, and OSM polyline tracks. |
| ๐ Proactive Notifications | Automated push alerts for schedule delays, platform reassignments, and upcoming destination arrival. |
| ๐ Anti-Motion Sickness | Hardware-accelerated 60 FPS inertial cues counteracting train sway to relieve reading discomfort. |
| ๐ฎ 100% Offline Arcade | Battery-efficient mini-games (Commuter Sudoku & Trenord Hop) playable anywhere with zero data needed. |
| ๐ง Background Audio | Podcast streaming with persistent lockscreen scrubber and variable speeds (1xโ2x) via expo-audio. |
| ๐ฆ๏ธ Destination Intel | Live weather forecasts, European AQI air quality gauges, UV alerts, destination news, and cultural POIs. |
| ๐ฑ Universal Responsive | Multi-column tablet spatial layouts ( |
| ๐จ Shake to Report | Emergency and onboard issue reporting triggered instantly by a physical device shake gesture. |
Passengers start by scanning their physical ticket barcode / PNR booking code or entering a train number (e.g. 24869). The app automatically authenticates with the B2B timetable service, resolves the complete stop sequence, and sets up real-time telemetry:
Direct integration with the Trenord Cloud B2B platform and onboard device sensors provides live journey telemetry:
- Interactive Railway Polylines: Real-time track geometry rendered from OpenStreetMap with dynamic train location tracking.
- Smart Delay & Platform Allocation: Live arrival recalculation with station dwell times, track reassignments, and platform updates.
- Tunnel Dead-Reckoning Velocity: High-frequency GPS velocity estimations that seamlessly fall back to inertial dead-reckoning during alpine tunnel signal blackouts.
- Next-Stop HUD & Carriage Occupancy: At-a-glance speedometer, live delay badge, next stop countdowns, and real-time carriage crowding indicators.
The dashboard surfaces critical journey metrics along with destination-specific content:
- Live Status Card: High-contrast indicator for on-time/delay status, current station, and estimated destination arrival.
- Contextual Feeds: Destination municipality news and quick-access discovery cards with pedestrian walking distances.
Reading on a moving train often triggers visual-vestibular conflict. The app features a lightweight, unobtrusive motion cue overlay:
- 40 Inertial Particles: Edge-aligned visual dots smoothly drift in opposition to train acceleration and track curves.
- Native 60 FPS UI Thread: Driven by React Native Reanimated worklets without adding overhead to the JavaScript thread.
Zero-latency casual entertainment and media designed to work seamlessly onboard without internet connectivity:
- Commuter Sudoku: Clean 9x9 grid with Easy, Medium, and Hard puzzles, pencil note-taking, error highlighting, timer, and persistent auto-save.
- Trenord Hop (60 FPS): Retro endless train-crossing runner featuring pixel rolling stock, conductor obstacle, coin collection, haptics, and dynamic audio.
- Background Audio Player: Native playback powered by
expo-audiowith lockscreen media controls, draggable scrubber, and speed controls.
- Hyperlocal Weather & Air Quality: Real-time destination weather, ambient temperature, condition codes, and European Air Quality Index (AQI) ratings.
- Interactive POI Map Sheet: Explore cultural landmarks, museums, and historical architecture with categorized map pins.
- Digital News Magazine: Masonry-grid article reader keeping commuters informed with destination-pertinent municipal, regional, and national headlines.
- Proactive Train Status Notifications: Timely push notifications alerting passengers to upcoming stops, schedule delay adjustments, and track reassignments.
- Notifications Timeline Sheet: Comprehensive chronological timeline of upcoming and past alerts for journey events and weather warnings.
- Dynamic Dark & Light Themes: Adaptive color tokens with system auto-detection and static StyleSheet pre-compilation for instant zero-overhead transitions.
- Travel Comfort & Storage Controls: Direct toggles for motion cues, language localization (IT / EN), and local offline cache management.
Built mobile-first, Trenord Infotainment dynamically adapts to wide tablet topologies (
- Simultaneous Multi-Column Composition: On tablet displays, the Journey tab bifurcates into side-by-side railway polyline map and stop timeline panels, while the Home dashboard displays concurrent telemetry widgets and discovery carousels.
-
Scanability & Bounded Constraints: Form cards and modal sheets enforce centered constraints (
$\le 700,\mathrm{px}$ ), preventing excessive line lengths on wide screens. - Zero-State Duplication: Orientation changes and window resizes execute as render-time layout updates without resetting media playback or game progress.
flowchart TB
subgraph UI ["Presentation Layer (Expo Router)"]
Tabs["Tab Shell: /(tabs) (Home, Journey, Media, Settings)"]
Modals["SlideSheet Modals: Weather, POI Map, News, Report Issue"]
Games["Arcade Shell: /game-page (Sudoku, Trenord Hop)"]
Cues["VehicleMotionCues (60 FPS Reanimated Worklet)"]
end
subgraph State ["Domain State (Zustand 5)"]
Stores["11 Stores: Journey, Weather, News, Media, Podcast, Audio, Games, Settings..."]
Storage["AsyncStorage Engine (createJSONStorage)"]
end
subgraph Native ["Device & Hardware Bridges"]
Sensors["expo-sensors (Accelerometer)"]
Location["expo-location (GPS Velocity & Dead-Reckoning)"]
Audio["expo-audio (Native Sound & Audio Director)"]
Haptics["expo-haptics (Tactile Feedback)"]
end
subgraph Edge ["Network & Edge Proxy"]
Proxy["Expo Edge Serverless Proxy (/api/proxy)"]
TrenordAPI["Trenord Cloud B2B API (OAuth RS256 JWT)"]
External["Open-Meteo, CurrentsAPI, Listen Notes, TMDB, OSM"]
end
UI --> State
State --> Storage
UI --> Native
State --> Proxy
Proxy --> TrenordAPI
Proxy --> External
Note
For the complete modular system design and architecture specifications, visit docs/architecture/.
-
Requirements:
- Node.js
$\ge 18$ -
pnpm
$\ge 9$ (pnpmis strictly required; do not usenpmoryarn)
- Node.js
-
Installation:
pnpm install
-
Start Development Server:
pnpm start
Tip
Web Development & CORS: Running pnpm web automatically routes external API calls through the local serverless proxy (/api/proxy+api.ts), eliminating CORS restrictions during local browser testing.
The codebase features 142 test suites (921 unit tests) covering all domain state stores, math utilities, kinematics, and UI views with a 100% pass rate (>90% line coverage).
# Run complete test suite
pnpm test
# Run tests with coverage report
pnpm test:cov
# Run strict TypeScript type check
pnpm typecheck
# Lint codebase
pnpm lint
# Format with Prettier
pnpm formatThe codebase strictly adheres to SOLID design principles:
- SRP: Data fetching, kinematics math, and UI rendering are strictly decoupled into dedicated custom hooks and reusable components.
- OCP & LSP: UI primitives and native API mocks follow extensible typed contracts.
- ISP & DIP: State stores and services depend on minimal, well-defined abstractions.
For in-depth architectural guides, refer to:
01-c4-context-and-containers.mdโ System Context & Container Topology02-screens-and-navigation.mdโ Screen Registry & Modal Routes03-state-management-and-domain.mdโ Zustand Store Inventory & Models04-sensors-kinematics-and-native.mdโ Motion Cues, GPS & Audio Engine05-apis-networking-and-proxy.mdโ API Catalog, OAuth JWT & Proxy Specs06-cross-cutting-concerns.mdโ i18n Localization, Theming & Logging07-solid-principles-and-patterns.mdโ Design Patterns & SOLID Proofs08-testing-and-cicd.mdโ Test Inventory & Verification Gates09-appendix-technical-debt.mdโ Technical Debt Log & Roadmap
If you are developing inside WSL while running Android Studio and emulators on Windows:
-
Set Windows Android SDK in WSL (
~/.bashrc):export ANDROID_HOME=/mnt/c/Users/<WINDOWS_USER>/AppData/Local/Android/Sdk export ANDROID_SDK_ROOT=$ANDROID_HOME export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$ANDROID_HOME/cmdline-tools/latest/bin
-
Create ADB Symlink:
cd "$ANDROID_HOME/platform-tools" ln -s adb.exe adb
-
Launch Emulator from CLI:
# List available emulators "$ANDROID_HOME/emulator/emulator.exe" -list-avds # Start emulator "$ANDROID_HOME/emulator/emulator.exe" -avd <AVD_NAME> # Verify connection "$ANDROID_HOME/platform-tools/adb" devices
Local Android builds (gradle) inside WSL require a Linux Android SDK, while pnpm start uses the Windows SDK for emulator communication.
mkdir -p ~/android-sdk/cmdline-tools
cd ~/android-sdk/cmdline-tools
wget -q https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
unzip -q commandlinetools-linux-11076708_latest.zip
mv cmdline-tools latest
export ANDROID_HOME=$HOME/android-sdk
export ANDROID_SDK_ROOT=$ANDROID_HOME
yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "platform-tools" "platforms;android-36" "build-tools;36.0.0" "ndk;27.1.12297006"eas-build-android() {
local ndk_dir=$(ls -d $HOME/android-sdk/ndk/* 2>/dev/null | tail -n 1)
ANDROID_HOME=$HOME/android-sdk \
ANDROID_SDK_ROOT=$HOME/android-sdk \
ANDROID_NDK_HOME=${ANDROID_NDK_HOME:-$ndk_dir} \
eas build --platform android --local "$@"
}Run source ~/.bashrc to reload.
-
Development Build (Dev Client APK):
eas-build-android --profile development
-
Release / Preview Package (Standalone Release APK):
eas-build-android --profile preview
-
Production Release Package (App Bundle / AAB):
eas-build-android --profile production
# Update dependencies within version ranges
pnpm update
# Align Expo packages to SDK version
pnpm dlx expo install --check
pnpm dlx expo install --fix --pnpm
# Diagnose project health
npx expo-doctorBuilt with โค๏ธ for Trenord commuters across Lombardy.
Crafted by @Bert0ns โข @toto04 โข @Suzani-Luca






















