mirror of
https://github.com/furyhawk/bus_sg_app.git
synced 2026-07-21 02:06:48 +00:00
- Add main application styles in app.css - Create basic HTML structure in app.html - Implement server-side hooks for API proxying in hooks.server.js - Set up layout component in +layout.svelte - Develop main page with endpoint explorer and arrival check functionality in +page.svelte - Configure SvelteKit with adapter in svelte.config.js - Set up Vite configuration for SvelteKit in vite.config.js
1.2 KiB
1.2 KiB
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.
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.
Features
- Dynamic endpoint explorer built from OpenAPI paths under /api/v1/*
- Bus-focused endpoint filtering (Bus and Passenger Volume tags)
- Quick bus-arrival panel with BusStopCode and optional ServiceNo
- JSON response viewer
- Arrival board card view when the response includes Services
- Server-side proxying for
/api/*and/openapi.json
Config
Environment variables:
PORT(default:3000)API_ORIGIN(default:http://localhost:8067)
Example:
API_ORIGIN=http://localhost:8067 PORT=3001 bun run dev -- --port 3001