Skip to content

Adds AWS Amplify Hosting to the site - #41

Open
gcardonag wants to merge 10 commits into
mainfrom
feature/amplify-deployment
Open

Adds AWS Amplify Hosting to the site#41
gcardonag wants to merge 10 commits into
mainfrom
feature/amplify-deployment

Conversation

@gcardonag

Copy link
Copy Markdown
Contributor

Adds AWS Amplify Hosting to the site

Problem

As the project matures and has the ability to be accessed with login credentials, we want to transition this to a hosted deployment model instead of a locally-run deployment model to enable more folks to serve as admins.

Solution

Allows others to use the site without requiring knowledge of how to host the dashboard locally.

Reference

Closes #33

Screenshots

image

gcardonag and others added 10 commits July 28, 2026 19:37
Configures SSR deployment to Amplify Hosting (CloudFront + S3 + Lambda
compute). Keeps server-side auth middleware and Supabase SSR intact.

- server.js: Express entry point wrapping React Router's request handler
  on port 3000 (Amplify compute standard)
- deploy-manifest.json: Routes /assets/* to S3 with immutable caching,
  all other paths to Lambda compute with static fallback
- bin/postbuild.sh: Assembles .amplify-hosting/ bundle; runs pnpm install
  --prod inside the compute directory so pnpm creates a self-contained
  node_modules/.pnpm virtual store (copying from the build root is unsafe
  as pnpm symlinks target the global content-addressable store)
- amplify.yml: Amplify CI spec — enables pnpm via corepack on Node 22,
  builds, then runs postbuild to produce the .amplify-hosting/ artifact

Requires SUPABASE_URL and SUPABASE_PUBLISHABLE_KEY set in the Amplify console.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
framework version specification
createRequestHandler is exported from @react-router/express, not
@react-router/node. Also adds express and @react-router/express as
direct dependencies — pnpm blocks importing packages that aren't
explicitly declared, even if they're available transitively.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Express 5 requires named wildcard parameters — bare * is no longer
valid in path-to-regexp. Replace with *splat.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Amplify's env var injection (env | grep >> .env) only writes values
during the build phase. React Router's Express server doesn't auto-load
.env at runtime the way Next.js does.

Fix: postbuild.sh now copies .env into the compute bundle if present,
and server.js loads it at startup with process.loadEnvFile (Node 22
built-in). The try/catch makes it a no-op in local dev where vars come
from the shell instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deploy admin site to AWS hosting

2 participants