Taiwan Railway (TRA/台鐵) real-time train schedule PWA for commuters.
The app shows real-time train schedules between stations, automatically suggests the next departing train, and provides a quick share feature to send arrival time messages. Perfect for daily commuters who need a simple way to coordinate rides.
The UI is currently in Traditional Chinese, tailored for Taiwanese commuters. Internationalization (i18n) support is planned for future releases.
Live App: hsi-on-track.vercel.app
OnTrack is a Progressive Web App — install it for a native app-like experience:
iOS (Safari):
- Open the app in Safari
- Tap the Share button (bottom center)
- Select "Add to Home Screen"
Android (Chrome):
- Open the app in Chrome
- Tap the ⋮ menu (top right)
- Select "Add to Home screen" or "Install app"
- Real-time train schedules from TDX (Transport Data eXchange)
- Auto-detect nearest station using geolocation
- Smart suggestion of next departing trains
- Quick message sharing
- PWA support for mobile installation
Install to run locally (requires Node.js 20.x)
- Clone the repository:
git clone https://github.com/Hsiii/OnTrack.git
- Navigate to the project directory:
cd OnTrack - Install dependencies:
npm install
- Set up environment variables:
Create a
.envfile with your TDX API credentials:VITE_TDX_CLIENT_ID=your_client_id VITE_TDX_CLIENT_SECRET=your_client_secret - Run the development server:
vercel dev
- Generate a production build:
npm run build
- Preview the site:
npm run preview
- Frontend: React 19 + TypeScript
- Build Tool: Vite 7
- Styling: pure CSS
- API: TDX Taiwan Railway API with Vercel serverless functions
- Deployment: Vercel
台鐵時刻表 • Taiwan Railway • TRA • 火車時刻查詢 • train schedule • PWA
