This is a fully serverless GraphQL backend for interacting with the NYC MTA API. It runs in AWS and is deployed using CDK.
This was previously the backend for closingdoors.nyc.
UpdateFeedsService: A Fargate service that takes a periodic snapshot of the MTA's real-time data feeds and persists them to S3 for consumption by other services.mtaApi: The AppSync instance that resolves GraphQL requests.mtaNearestStation: a Lambda function that resolves thenearestStationsquery.mtaTrainTimes: a Lambda function that resolves thetrainTimesquery.mtaSystemMetadata: a DynamoDB table that resolves thesystemMetadataquery (see:mapping_templatesfolder).
The following environment variables are used:
CONTAINER_REGISTRY: the address of the container registry to push/pull themta-feed-fetcherDocker image.OUTPUT_APPSYNC_DETAILS: if true, output the AppSync URL and API key after deployment. These are considered secrets and are not output in builds hosted on GitHub.
Before deploying the infrastructure, the mta-feed-fetcher Docker image needs to be built and published:
cd docker./build_and_push
This only needs to be done once initially and then subsequently when the image changes.
npm install && npm run buildcdk deploy --all