transitmatters / new-train-tracker Goto Github PK
View Code? Open in Web Editor NEWTracking the MBTA's new Orange, Red, and Green trains
Home Page: http://traintracker.transitmatters.org/
License: MIT License
Tracking the MBTA's new Orange, Red, and Green trains
Home Page: http://traintracker.transitmatters.org/
License: MIT License
Similar to what is being done on newtrains.today and more also
@mathcolo If you have any details as to what exactly needs to be done feel free to drop them here for whoever ends up picking this up.
Setup TravisCI auto-build/test/deploy for the site.
A user wrote in to point out that the ancient PCC cars are being retrofitted with new components, which may be of interest to the same folks who are interested in hunting down new trains. New or not, this will be a good addition as fleet delivery wears on and the NTT becomes just the "train tracker" with Blue, Silver, etc.
We could possibly tack this onto the bottom of the Ashmont strip map, though that's technically harder (and maybe not as appropriate for the use case) than just putting it into its own tab.
The changes to tally the new vehicles seen don't account for the logging of the silverline that's happening.
Separating the processing from the tallying would be ideal.
3918, 3909, 3864, 3639 all have googley eyes, let's add a little ๐ emoji to them somehow
To match recent changes made to the NTT
new-train-tracker/server/mbta_api.py
Line 36 in fa5dcf9
Should include list of npm commands and things to look out for if setting up a new instance of the project, maybe some troubleshooting tips...
create_history_db.py
secrets.py
with environment variables?It could be cool to be able to click on two stations and see the average travel time between them, especially if you're trying to schedule when you should leave to catch one of the new trains
Healthcheck doesn't work anymore since moving to chalice. Should fix it so it stops erroring out
NTT page refreshes should send you back to the same line/mode you were already viewing. No need for URL state though, I don't think...
The current deploy-on-lightsail.yml
Ansible playbook can only be used to update existing deployments of the Train Tracker. It wouldn't be a bad idea to have a separate playbook designed for performing fresh deployments of the app.
The v3 api provides info about how busy the trains are. On the new orange and red line trains the data is given per car. We should show that on the map for the curious folks
NTT would ideally have a healthcheck (like the data dashboard) that UptimeRobot could hit. This could check things such as
We should update to the latest node release of node 20.x
We can calculate new-trip totals in https://github.com/transitmatters/data-ingestion/, so we shouldn't need the full postgres database in this app.
We don't want to lose last-seen times though, so perhaps another solution is in order. (memory? file? s3?)
Even once they're south of the fork, the trains list destination as Ashmont/Braintree instead of either/or.
@z0glen made a delightful change to permit NTT to run without an adjacent PostgreSQL server. That included a secrets.py modification, which the CD job overwrote on merge with the instance copy. I added Zach's change to said copy, but ideally the key would be patched in (or read from env? or elsewhere?)
We should determine if EC2 is necessary for modern NTT
It seems as though we may be able to get away with NTT being a Chalice app instead of a flask one
This could reduce overhead, costs, and generally make it more similar to all our other apps
If this is wrong, we can close this
We're getting 429 from the MBTA, which is causing the service to crash occasionally
We can fix this a few different ways:
Right now the bucket is made manually, we should have it created and managed via cloudformation
When clicking on a car to see last update / predictions, the popover jerks to expand after the request to the backend finishes. This should be a smoother animation
We have an apple-touch-icon.png
file in the repo which is supposed to be used when the NTT is added to the Home Screen. This...isn't working, and I can't figure out why. There's probably something I'm not doing correctly with the image itself or the link
tag in template.html
.
GLX is currently planned to open in December for the Union Branch and May for the Medford Branch. We need to extend the GL code to take into account these new stations. @idreyn If you have any details as to what exactly needs to be done feel free to drop them here for whoever ends up picking this up.
If we replace CloudFront with...something else... (ALB?), we can eliminate NTT's public IPv4 address.
Ideally we would like to stop paying for a public ipv4 address dedicated to the EC2 instance
The cron task (cd /home/ubuntu/new-train-tracker && /home/ubuntu/.local/bin/pipenv run python3 -m server.history.update_history_db >> /home/ubuntu/new-train-database-updates.log
) and the mbta_api call (new-train-tracker/server/mbta_api.py: print(f"Writing problematic API response to {log_path}")
) both generate log files that don't have timestamps. It would be great to add timestamps to these for diagnosing issues.
Just like Gobble, we should add Datadog monitoring and tracing
This would be very helpful for when there's several trains bunched up in one rendered location, and you have to keep selecting the location to scroll through the trains, and it doesn't always scroll through all of them.
Alternatively/simultaneously, it would be nice to color code the sub-lines and expand a bunch of overlapping trains when one is selected.
This code is calling the v3 MBTA api X times and blocking return until response on all X calls
Instead we should have a separate API call that get called when the vehicle is selected in the frontend to return the extra info
Since we're considering using the Data Dashboard infrastructure for the history data, we can eventually wind down this repo's dependency on a locally-hosted Postgres database. As a first step, let's make our Postgres dependency opt-in โ so that the app will build and run without a database available, and provide dummy/fallback data in its absence.
Currently, deploy-playbook.yml
is hardcoded to deploy whatever is on the org main
branch - this is good for CD, but we should extend the playbook and deploy.sh
to make it easier to deploy local changes without having to manually edit the playbook
[ ] Specify API key an with environment variable
[ ] Via the file secrets.py
[ ] Make the API calls not fail if an API key isn't present via env var or secrets.py
Similar to how we've done this for other TM projects
To reproduce:
The strip map line will go translucent. This is a visual cue we use for the non-selected branch of GL and RL and should never happen on the OL.
Because we're running on EC2 we should be able to update to Python 3.11 or 3.12 today
Every other product at TM is using Python 3.10 now, we should at least get NTT in-line. Soon we'll be on 3.11 and 3.12
Favicon is the old logo, needs to be the new logo (see Data Dashboard)
Right now no trains are showing on New Train Tracker for the Orange and Red Lines. We could embed a link to an article or even just add some text explaining why that is the case.
I wonder if this is due to Ashmont shuttling? We received this to labs@.
Hi,
Earlier today (Friday, 20-October-2023) the redline new trains tracker said there were two new trains on the line. Now, when I look, (after 5:30 PM same day), it says there are no new trains, and that a new red line train was last seen 6 days ago.That looks like a bug....
Thanks
The NTT currently lacks a footer - we should add one similar to the DD with links and a dynamic version tag
Right now, clicking on a train on a branch displays all of the branch stations, but they render under the map, making the display cluttered. We should instead zoom into the branch
After merging #155
ValidationError: Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema.", " -
The NTT working directory now contains last_seen.json
for the "last seen" times. We should back that up automatically, in case something happens to the server.
We use Google Analytics for the data dashboard, so let's hook that up here too.
A lot of my friends who are train enthusiasts use Stefan on MBTA for tracking trains . They mentioned that the only things missing from making NTT an alternative to this tool are update date and expected arrival time, which the other tool provides.
No mystery here, see actions/checkout#760
I'll add the workaround used by others for now
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.