Skip to content
This repository was archived by the owner on Oct 2, 2026. It is now read-only.

Latest commit

 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TreniTardi

release PHP 8.4 Laravel 12 Livewire 4 License: MIT

A mobile-first web app to monitor Italian train status in real time, powered by the ViaggiaTreno public API. No accounts, no database — just punch in a train number and get live updates.

What it does

  • Real-time train status via the ViaggiaTreno public API
  • Stop-by-stop breakdown with delays and platform info
  • Save favorite trains locally in your browser (no login needed)
  • Deep-linkable train pages — share a /status/{trainNumber} URL directly

Stack

  • Laravel 12 — application framework
  • Livewire 4 — reactive components (single-file, no build step for PHP)
  • Tailwind CSS 4 — styling
  • Alpine.js — client-side state (favorites via localStorage)
  • ViaggiaTreno API — the data source

Getting started

git clone git@github.com:marcocot/trenitardi.git
cd trenitardi
composer run setup
composer run dev

The app will be available at http://localhost:8000.

composer run setup handles everything: installing PHP/JS deps, copying .env, generating the app key, and building assets.

Running tests

php artisan test --compact

To check code style without fixing anything:

composer lint:check

To auto-fix style issues:

composer lint

Architecture notes

All data comes from two ViaggiaTreno API calls:

  1. /cercaNumeroTrenoTrenoAutocomplete/{trainNumber} — resolves the train ID and origin station
  2. /andamentoTreno/{trainId}/{trainNumber}/{timestamp} — returns the full status JSON

The TrainService handles both calls. DTOs in app/DTOs/ map the Italian API keys to typed English properties, validated with webmozart/assert. The Livewire component stores raw API data as ?array and exposes typed DTOs via #[Computed] properties.

Deployment

The app ships as a single Docker image published to registry.homelab.devncode.it/trenitardi-web by GitHub Actions on every GitHub release. Tags are multi-arch (linux/amd64, linux/arm64) and the versioning follows the release tag (v1.2.3 → 1.2.3, 1.2, latest).

Local image workflows are driven by just:

just build                 # build single-arch local image
just login                 # docker login (expects REGISTRY_USERNAME / REGISTRY_PASSWORD)
just push TAG=1.2.3        # buildx multi-arch push
just release v1.2.3        # tag + gh release (triggers CI publish)

The container listens on port 8080 and is designed to sit behind a reverse proxy (Traefik/nginx) that handles TLS.

Contributing

PRs are welcome. The release workflow (lint + tests) runs automatically on every pull request — make sure both jobs are green before requesting a review.

About

La vecchia web app di TreniTardi. Archiviata il 2 ottobre 2026: il progetto continua altrove.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages