Tra quanto passa is a simple web application that shows the arrival times of buses in the city of Trento and trains information for some popular stations in Northeast Italy.
It also takes into consideration delays based on real-time data, for both buses and trains.
It's currently hosted on traquantopassa.in.
The application is built with the SvelteKit framework (previously Nuxt 3).
Create a .env file with the following content:
PUBLIC_BASE_URL=https://traquantopassa.in
API_BASE_URL=https://app-tpl.tndigit.it
API_USERNAME=
API_PASSWORD=
GOATCOUNTER_API_KEY=
Make sure to add missing credentials (Goatcounter is optional).
Install dependencies:
npm installStart the development server:
npm run devCode formatting is handled by Prettier and enforced in CI. To format the whole repository:
npm run formatTo check formatting and run ESLint, as CI does:
npm run lintTypeScript and Svelte compiler errors are caught by svelte-check:
npm run checkEditor configuration is committed so both editors run Prettier and ESLint on save:
- VS Code: install the recommended Prettier and ESLint extensions (see
.vscode/extensions.json). - WebStorm: works out of the box via
.idea/prettier.xmland.idea/jsLinters/eslint.xml. Both set a custom file pattern, because WebStorm's default omits.svelte.
Build the application:
npm ci
npm run buildStart the production server (you can pass configuration options with environment variables or the .env file):
npm start