transitmatters / t-performance-dash

TransitMatters performance visualizer for the MBTA
https://dashboard.transitmatters.org/
MIT License
52 stars 17 forks source link

Easier setup #865

Open PatrickCleary opened 1 year ago

PatrickCleary commented 1 year ago

It would be nice to allow for potential contributors to get the dashboard up & running w/o AWS/DD/MBTA creds.

Could set it up so the dashboard hits prod endpoints unless a flag is present (or vice versa).

PatrickCleary commented 1 year ago

I started working on this.

I tried to set it up so localhost would hit the beta API. This causes CORS issues. So I started working on the Chalice CORS config on the beta APIs to accept the Beta URL as well as localhost URLS.

Chalice doesn't have built in support for multiple origins. See: https://aws.github.io/chalice/tutorials/basicrestapi.html#cors-support

Worked on setting that up but facing issues.

I alos just realized it says "May not work on all clients" so maybe since this is for developers only we can just use an array of origins? idk.

PatrickCleary commented 1 year ago

https://github.com/transitmatters/t-performance-dash/tree/CORS-localhost

sutt commented 1 year ago

Is there a way to sync with an existing database of historical data? Or do you just start scraping current trips when you launch the app?

rudiejd commented 11 months ago

in order to get this set up without actually deploying a lambda, I had to create my own copy of the DeliveredTripMetrics dynamo table in personal AWS and run the populate_delivered_trip_metrics function from the data ingestion repository: https://github.com/transitmatters/data-ingestion/blob/main/ingestor/app.py#L129

then repeat for the other tables. it seems like maybe the repo could ship with a dynamodb localstack setup with some of these tables preloaded

PatrickCleary commented 10 months ago

Further issues with AWS:

https://transitmatters.slack.com/archives/GSJ6F35DW/p1705183252687999