2024–2025
Train reservation WebView
Vexere.com · Full-stack Developer · New train revenue channel with no native app rewrite
Problem
The agent app only booked buses. Train tickets needed a mobile UI inside the existing native shell: search, seat maps, exclusive seat locks, round trips, and timers that stay honest when the app is backgrounded.
What I owned
The first version of the train WebView: routes, seats, passenger details, and reservation, talking to the routing engine and the order service.
Architecture
The native app injects agent identity, then loads the WebView. Requests are signed so the backend can trust the session. Redux-Saga owns the async path: fetch routes, lock seats, watch timers, release on timeout, and coordinate outbound plus return legs.
Seat locks use a countdown. Mobile setInterval pauses when the app is backgrounded, so the timer runs in a Web Worker and a saga turns worker messages into release actions when time is up.
Vietnam Railways discount copy arrives in Vietnamese. Known templates are mapped to English with regex; anything else falls back to a translation API.
Outcome
Agents got train booking through a URL in the existing app. Sales had a new channel without a native rewrite.