mirror of
https://github.com/furyhawk/bus_sg_app.git
synced 2026-07-21 02:06:48 +00:00
9d1d93d113737e75207ccdae35c0075dc6f9d742
Bus SG App
A lightweight bus transport web app that uses the gateway OpenAPI contract at:
The frontend is built with SvelteKit. It dynamically loads transport endpoints from the OpenAPI spec and calls them through a SvelteKit server hook proxy.
Stack
- SvelteKit + Vite + Svelte 5
- Bun for package management and scripts
Run
- Ensure your API gateway is running at http://localhost:8067.
- Install dependencies:
bun install
- Start this app in development:
bun run dev
- Open:
Build and preview
bun run build
bun run preview
You can also use bun run start to run preview mode.
Project structure
src/
app.css
app.html
hooks.server.js
routes/
+layout.svelte
+page.svelte
svelte.config.js
vite.config.js
package.json
Features
- Dynamic endpoint explorer built from OpenAPI paths under /api/v1/*
- Bus-focused endpoint filtering (Bus and Passenger Volume tags)
- Quick bus-arrival panel that uses your current location to resolve the nearest bus stop automatically
- Map view for current location and nearest resolved bus stop
- Optional ServiceNo filter for arrival checks
- JSON response viewer
- Arrival board card view when the response includes Services
- Server-side proxying for
/api/*and/openapi.json
Config
Environment variables:
API_ORIGIN(default:http://localhost:8067)
Example:
API_ORIGIN=http://localhost:8067 bun run dev -- --port 3001
Cleanup note
Legacy files from the earlier custom Node static server version were removed.
Languages
Svelte
46.7%
CSS
32%
Swift
8.6%
JavaScript
6.6%
Java
3%
Other
3.1%