Hi! This is a complete rewrite of TransportVic, now that I've lived in Melbourne for a longer time and actually know the system through.
Loading in MTM timetables
Loading in bus timetables
Loading in V/Line train timetables
Loading in Regional coach timetables
Loading in tram timetables, batching in place too
Showing live MTM departures when the services are running as timetabled
Predicting MTM City Loop configuration when services are running as timetabled
Show proper destination names for MTM departures that match station announcements
Showing live V/Line departures when the services are running as timetabled
Showing live V/Line departures when the services are NOT running as timetabled in GTFS, but falling back to NSP Run IDs.
Showing live V/Line departures when there's completely no timetable match, this queries the trip stops and loads it in.
Has the ability for live V/Line cancellations/alterations - this sets up an email server to get emails from V/Line Inform
Showing live MTM departures when there's completely no timetable match (17:02 FSS ex Westall), also queries trip stops and loads it in.
Looks for trips being formed next in City Loop stations, and joins it the the departure stops-at
Showing Regional coach timetables.
Offline mode
Couple of mockup displays
GeoJSON visualiser, cos why not
Checks disruptions whenever requesting for metro train departures - looks for suspended regions and adds a message / marks isRailReplacementBus
(need to rename to isBusReplacement
)
Stop merging in place
Shows trip timings for MTM
Shows trip timings for V/Line
Homepage done up together with webapp
/nearby
if opened as a webappBus timings
Tram timings
Standard npm i -d
Create a config.json looking like
{
"useHTTPS": false, // tells the server if you want to use the HTTPS server (runs on port 443)
"sslCertPath": "", // where to find the SSL certs for HTTPS. Ignored if useHTTPS is false
"httpPort": 8000, // The port to run the HTTP server on. Acts only as a redirect server if userHTTPS is true
"databaseURL": "mongodb://localhost:27017", // MongoDB database URL. This should work fine
"databaseName": "TransportVic", // MongoDB database name
"webrootPath": "", // Location of the let's encrypt webroot
"useLetsEncrypt": false, // Whether to use let's encrypt to automatically renew certs
"certbotFlags": "", // Any extra flags to pass to the certbot renew call. For example using dns challenge
"ptvKeys": [{
"key": "", // Your PTV dev key.
"devID": "" // Your PTV dev id. If left blank PTV api calls will not work and will fallback to gtfs timetable. This makes data less accurate
}],
"devMode": true // Enables/Disables compression of data and other stuff
}
with the appropriate fields filled Create a modules.json with this filled
{
"Next4": {
"bus": true,
"tram": true,
"metro": true,
"vline": true,
"coach": true,
"ferry": true
},
"tracker": {
"bus": true,
"vline": true
},
"mockups": {
"pidsview": true
},
"routes": {
"bus": true
},
"stopPreview": true,
"jmssScreen": true,
"vlineMail": true
}
And enable the modules you want. The example here has everything enabled. Keep in mind that GTFS loading is controlled by the Next4 entry, and that other modules such as trackers or routes do not check that the relevant module is enabled as well.
You'll have to download additional data from Spatial Datamart Victoria and save it to /spatial-datamart
shp2json
to generate geojsonRun modules/optimise-svg.js
to run through all the raw svg files and remove unneeded fields from them
Run update-gtfs.sh
to pull the latest GTFS data from PTV
Run node load-gtfs/metro-trains/extra/download-metro-timetables.js
and the v/line counterpart (do this just once unless the NSP/WTTs get updated)
Create a blank load-gtfs/stats.json
. (I'll make this automatic)
Run load-gtfs/load-all.sh
to load it all into the database (takes around 20min)
You'll need to populate urls.json
with magic values (sorry I can't help you with that unless maybe I know you or something. but eh it mostly runs fine without that file and can fallback to offline mode without it)
You should be good to go!