From 4b5e0fd71c27e65ae9408f10960a706a50a24824 Mon Sep 17 00:00:00 2001 From: Devin Matte Date: Tue, 4 Jun 2024 19:37:52 -0400 Subject: [PATCH] Setting up production url deployment (#5) * Setting up production url deployment * Adding goatcounter --- .github/workflows/deploy.yml | 1 + deploy.sh | 10 +++++----- index.html | 14 +++++++++++++- package-lock.json | 27 +++++++++------------------ package.json | 7 +++---- public/manifest.json | 16 ++++++++++++++++ server/.chalice/config.json | 2 +- server/cloudformation.json | 8 ++++---- src/MapLayers.tsx | 2 +- src/components/Footer.tsx | 2 +- src/components/Title.tsx | 2 +- 11 files changed, 55 insertions(+), 36 deletions(-) create mode 100644 public/manifest.json diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 70fdcdd..7609e06 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,6 +17,7 @@ jobs: AWS_DEFAULT_REGION: us-east-1 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + TM_PRIDEBUS_CERN_ARN: ${{ secrets.TM_PRIDEBUS_CERN_ARN }} TM_LABS_WILDCARD_CERT_ARN: ${{ secrets.TM_LABS_WILDCARD_CERT_ARN }} MBTA_V3_API_KEY: ${{ secrets.MBTA_V3_API_KEY }} DD_API_KEY: ${{ secrets.DD_API_KEY }} diff --git a/deploy.sh b/deploy.sh index 04ac600..073fc44 100755 --- a/deploy.sh +++ b/deploy.sh @@ -7,18 +7,18 @@ export AWS_REGION=us-east-1 export AWS_DEFAULT_REGION=us-east-1 export AWS_PAGER="" -if [[ -z "$DD_API_KEY" || -z "$TM_LABS_WILDCARD_CERT_ARN" || -z "$MBTA_V3_API_KEY" ]]; then - echo "Must provide DD_API_KEY, TM_LABS_WILDCARD_CERT_ARN and MBTA_V3_API_KEY in environment" 1>&2 +if [[ -z "$DD_API_KEY" || -z "$TM_PRIDEBUS_CERN_ARN" || -z "$TM_LABS_WILDCARD_CERT_ARN" || -z "$MBTA_V3_API_KEY" ]]; then + echo "Must provide DD_API_KEY, TM_PRIDEBUS_CERN_ARN, TM_LABS_WILDCARD_CERT_ARN and MBTA_V3_API_KEY in environment" 1>&2 exit 1 fi STACK_NAME=pride-bus CHALICE_STAGE=production -FRONTEND_HOSTNAME="pride-bus.labs.transitmatters.org" -FRONTEND_ZONE="labs.transitmatters.org" +FRONTEND_HOSTNAME="pridebus.transitmatters.org" +FRONTEND_ZONE="pridebus.transitmatters.org" FRONTEND_BUCKET="$FRONTEND_HOSTNAME" -FRONTEND_CERT_ARN="$TM_LABS_WILDCARD_CERT_ARN" +FRONTEND_CERT_ARN="$TM_PRIDEBUS_CERN_ARN" BACKEND_HOSTNAME="pride-bus-api.labs.transitmatters.org" BACKEND_ZONE="labs.transitmatters.org" diff --git a/index.html b/index.html index 5e2ae7e..854195c 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,14 @@ - + + + + @@ -11,6 +18,11 @@ content="black-translucent" /> + + diff --git a/package-lock.json b/package-lock.json index dca9517..3603d28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@heroicons/react": "^2.1.3", "@mapbox/polyline": "^1.2.1", - "@tanstack/react-query": "^5.40.0", + "@tanstack/react-query": "^5.40.1", "@types/react-scroll": "^1.8.10", "leaflet": "^1.9.4", "leaflet-hotline": "^0.4.0", @@ -21,12 +21,11 @@ "react-leaflet": "^4.2.1", "react-leaflet-hotline": "^1.5.0", "react-leaflet-marker": "^2.1.0", - "react-scroll": "^1.9.0", - "vite-express": "^0.16.0" + "react-scroll": "^1.9.0" }, "devDependencies": { "@types/leaflet": "^1.9.12", - "@types/node": "^20.14.0", + "@types/node": "^20.14.1", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@typescript-eslint/eslint-plugin": "^7.12.0", @@ -1343,9 +1342,9 @@ } }, "node_modules/@tanstack/react-query": { - "version": "5.40.0", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.40.0.tgz", - "integrity": "sha512-iv/W0Axc4aXhFzkrByToE1JQqayxTPNotCoSCnarR/A1vDIHaoKpg7FTIfP3Ev2mbKn1yrxq0ZKYUdLEJxs6Tg==", + "version": "5.40.1", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.40.1.tgz", + "integrity": "sha512-gOcmu+gpFd2taHrrgMM9RemLYYEDYfsCqszxCC0xtx+csDa4R8t7Hr7SfWXQP13S2sF+mOxySo/+FNXJFYBqcA==", "dependencies": { "@tanstack/query-core": "5.40.0" }, @@ -1429,9 +1428,9 @@ "integrity": "sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==" }, "node_modules/@types/node": { - "version": "20.14.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.0.tgz", - "integrity": "sha512-5cHBxFGJx6L4s56Bubp4fglrEpmyJypsqI6RgzMfBHWUJQGWAAi8cWcgetEbZXHYXo9C2Fa4EEds/uSyS4cxmA==", + "version": "20.14.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.1.tgz", + "integrity": "sha512-T2MzSGEu+ysB/FkWfqmhV3PLyQlowdptmmgD20C6QxsS8Fmv5SjpZ1ayXaEC0S21/h5UJ9iA6W/5vSNU5l00OA==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -6687,14 +6686,6 @@ } } }, - "node_modules/vite-express": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/vite-express/-/vite-express-0.16.0.tgz", - "integrity": "sha512-+o2e5+SaH2sGFJJzUY2tLuDnWbFWIG9qimv4KHNaQ/S9qf223S7cBQt6YmqkmQ20OYDCeXT/HUV8z7pPJu0R4g==", - "dependencies": { - "picocolors": "^1.0.0" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index 98d0ca6..62449c0 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "dependencies": { "@heroicons/react": "^2.1.3", "@mapbox/polyline": "^1.2.1", - "@tanstack/react-query": "^5.40.0", + "@tanstack/react-query": "^5.40.1", "@types/react-scroll": "^1.8.10", "leaflet": "^1.9.4", "leaflet-hotline": "^0.4.0", @@ -31,12 +31,11 @@ "react-leaflet": "^4.2.1", "react-leaflet-hotline": "^1.5.0", "react-leaflet-marker": "^2.1.0", - "react-scroll": "^1.9.0", - "vite-express": "^0.16.0" + "react-scroll": "^1.9.0" }, "devDependencies": { "@types/leaflet": "^1.9.12", - "@types/node": "^20.14.0", + "@types/node": "^20.14.1", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@typescript-eslint/eslint-plugin": "^7.12.0", diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 0000000..5309da9 --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,16 @@ +{ + "short_name": "Pride Bus", + "name": "Transitmatters Pride Bus Tracker", + "description": "Live tracking of MBTA's pride bus brought to you by the TransitMatters Labs team", + "icons": [ + { + "src": "pride-logo.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/server/.chalice/config.json b/server/.chalice/config.json index 83102cf..b560bf1 100644 --- a/server/.chalice/config.json +++ b/server/.chalice/config.json @@ -20,7 +20,7 @@ "DD_TRACE_ENABLED": "true", "DD_PROFILING_ENABLED": "true", "DD_ENV": "prod", - "TM_CORS_HOST": "pride-bus.labs.transitmatters.org" + "TM_CORS_HOST": "pridebus.transitmatters.org" }, "tags": { "service": "pride-bus", diff --git a/server/cloudformation.json b/server/cloudformation.json index b7a62df..faa5a62 100644 --- a/server/cloudformation.json +++ b/server/cloudformation.json @@ -2,17 +2,17 @@ "Parameters": { "TMFrontendHostname": { "Type": "String", - "Default": "pride-bus.labs.transitmatters.org", + "Default": "pridebus.transitmatters.org", "AllowedValues": [ - "pride-bus.transitmatters.org", - "pride-bus.labs.transitmatters.org" + "pridebus.transitmatters.org", + "pridebus.labs.transitmatters.org" ], "Description": "The frontend hostname for the pride bus tracker" }, "TMFrontendZone": { "Type": "String", "Default": "labs.transitmatters.org", - "AllowedPattern": "^labs\\.transitmatters\\.org$", + "AllowedPattern": "^pridebus\\.transitmatters\\.org$|^labs\\.transitmatters\\.org$", "Description": "The frontend's DNS zone file name. Most likely labs.transitmatters.org." }, "TMBackendZone": { diff --git a/src/MapLayers.tsx b/src/MapLayers.tsx index 93f0def..259e81e 100644 --- a/src/MapLayers.tsx +++ b/src/MapLayers.tsx @@ -36,7 +36,7 @@ export const MapLayers = ({ } > - + MBTA Pride Logo {formattedPolyline && ( diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 1b9f235..997f7e7 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -76,7 +76,7 @@ export const Footer = ({ busStatus, stopName, status, routeId }: any) => {
- + TransitMatters Logo
diff --git a/src/components/Title.tsx b/src/components/Title.tsx index d7f0c58..462d09a 100644 --- a/src/components/Title.tsx +++ b/src/components/Title.tsx @@ -15,7 +15,7 @@ export const Title = () => {

by

- + TransitMatters Logo