Skip to content

Commit

Permalink
Setting up production url deployment (#5)
Browse files Browse the repository at this point in the history
* Setting up production url deployment

* Adding goatcounter
  • Loading branch information
devinmatte authored Jun 4, 2024
1 parent 8837ac1 commit 4b5e0fd
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 36 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
10 changes: 5 additions & 5 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 13 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<!-- GoatCounter -->
<script
data-goatcounter="https://transitmatters-pride.goatcounter.com/count"
async
src="//gc.zgo.at/count.js"
></script>
<!-- End GoatCounter -->
<link rel="icon" type="image/svg+xml" href="./pride-logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
Expand All @@ -11,6 +18,11 @@
content="black-translucent"
/>
<meta name="author" content="TransitMatters" />
<meta
name="description"
content="Live tracking of MBTA's pride bus brought to you by the TransitMatters Labs team"
/>
<link rel="manifest" href="/manifest.json" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@transitmatters" />
<meta name="twitter:title" content="MBTA Pride Bus Tracker" />
Expand Down
27 changes: 9 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
16 changes: 16 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 1 addition & 1 deletion server/.chalice/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions server/cloudformation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/MapLayers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const MapLayers = ({
}
>
<Marker position={position} size={[24, 24]}>
<img className="h-6" src={"pride-logo.png"} />
<img className="h-6" src={"pride-logo.png"} alt="MBTA Pride Logo" />
</Marker>
</MarkerLayer>
{formattedPolyline && (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const Footer = ({ busStatus, stopName, status, routeId }: any) => {

<div className="w-32 md:w-42 lg:w-46 pl-1 md:pl-2 flex flex-row items-center ">
<a href="https://transitmatters.org ">
<img src={"Logo_wordmark.png"} />
<img src={"Logo_wordmark.png"} alt="TransitMatters Logo" />
</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const Title = () => {
<h1 className="text-md font-bold italic text-grey-100">by</h1>
<div className="w-32 md:w-64 lg:w-52 pl-1 md:pl-2 flex flex-row">
<a href="https://transitmatters.org">
<img src={"Logo_wordmark.png"} />
<img src={"Logo_wordmark.png"} alt="TransitMatters Logo" />
</a>
</div>
</div>
Expand Down

0 comments on commit 4b5e0fd

Please sign in to comment.