This might be a bit outside the wheelhouse but wha...
# general
a
This might be a bit outside the wheelhouse but what is everyone using to build out their front end and how are you choosing to host it? ReactJS and S3? NextJS and Vercel? I’ve never understood the “static vs dynamic” argument. Is the frontend considered static if all it’s doing is hitting backend APIs via a serverless backend?
r
We use Vuejs deployed either via S3 and cloudfront or most often via Netlify. There's no webserver involved the client side is javascript that dynamically generates the html. The retrieval of data is all via API requests, in our case to API Gateway endpoints. In our apps server side rendering isn't needed, that's an option too but needs a server running. Worth looking at https://jamstack.org/ for a description
a
Oh so this is Jamstack! I’d heard of it but always thought it wasn’t what I was looking for. Looks like if I’ve got a serverless backend then my front end is static. And therefore I can consider ALL the great static hosting solutions: Netlify, Amplify, even GitHub Pages? 🤔
r
Yep 😊
o
React + Webpack + S3 + Cloudfront - think this is a pretty common stack (alas not enough vowels for a buzzy acronym)>
A big reason we host in S3 + cloudfront is that the cloudfront distribution also points to API Gateway, so that the UI and API are being served from the same domain, to reduce latency from CORS.
Hosting both on the same domain means browsers don’t send an OPTIONS pre-flight request before every API call (this can also be mitigated with pre-flight caching)
r
Smart
m
Hey @Andrew W I've been using react, s3, and cloudfront for static sites and hosting. The S3 Deployment construct might be of interest https://docs.aws.amazon.com/cdk/api/latest/docs/aws-s3-deployment-readme.html.
a
@Mike McCall — It does look interesting. And I’ll keep it on my radar. Unfortunately this if for a production-grade application so I’m hesitant to adopt anything that is in an experimental phase. For now I’m going with a React app and utilizing Amplify.
m
For sure! Amplify is good. Are you using it for IaC or using cdk (sst) with amplify?
a
That will depend — I’m working with an AWS partner following the Well-Architected Design pattern and will be going along with their methodology. They may be CDK but I’ll ask if they’re SST or SLS, Architect, etc.
m
Cool. Would love to hear what you all settle on and why.
r
We use amplify for auth (not via CLI scaffolding), frontend is in netlify auto triggered from github, super simple and effective
m
Nice we are doing something similar. cdk backend, import cdk outputs into aws-exports and using amplify for frontend utilities and hosting. Basically using amplify for everything but IaC.