Gatsby site scaffolded for AWS Amplify Hosting and ready for Amplify Gen2 backend (optional).
Node 20.x is required (Gatsby may fail on newer non-LTS versions).
nvm install 20
nvm use 20
npm ci
npm run developIf you don’t use nvm, you can run Node 20 via npx:
npx -y -p node@20.19.6 -c "npm ci"
npx -y -p node@20.19.6 -c "npm run develop"- Push this repo to GitHub (or another Git provider supported by Amplify Hosting).
- In AWS Console (region
us-east-1), create an Amplify app and connect the repo/branch. - Keep the default build settings, or use the build spec in
amplify.yml.
This repo includes a minimal Gen2 backend entrypoint at amplify/backend.ts that defines an empty backend.
To use local Gen2 workflows (no Gen 1 amplify CLI):
npx ampx sandbox --profile anthus --region us-east-1The backend defines a private S3 bucket + CloudFront distribution for public MP4 hosting. The site's src/pages/videos.js uses GATSBY_VIDEOS_BASE_URL to point at the CDN.
To retrieve the deployed backend configuration (bucket name, CloudFront URL, etc.):
npx ampx generate outputs --app-id dfkbdffs2viq8 --branch main --profile anthusThis creates amplify_outputs.json with:
custom.videosBucketName- S3 bucket for videoscustom.videosCdnUrl- CloudFront distribution URL
# Generate audio assets only (fast, for iteration on scripts/timing)
npm run babulus
# Render videos to videos/out/ (and copies to static/videos/ for local preview)
# This automatically runs babulus generation first.
npm run videos:render
# Upload rendered MP4s and poster images to S3
# Requires AWS_PROFILE with access to the S3 bucket (reads bucket name from amplify_outputs.json)
AWS_PROFILE=anthus npm run videos:uploadThe videos page automatically reads the CloudFront URL from amplify_outputs.json at build time. Commit amplify_outputs.json to your repository so it's available during the Amplify build.
Deploy this starter with one click on Netlify:
A quick look at the top-level files and directories you'll see in a typical Gatsby project.
.
├── node_modules
├── src
├── .gitignore
├── gatsby-browser.js
├── gatsby-config.js
├── gatsby-node.js
├── gatsby-ssr.js
├── LICENSE
├── package.json
└── README.md
-
/node_modules: This directory contains all of the modules of code that your project depends on (npm packages) are automatically installed. -
/src: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser) such as your site header or a page template.srcis a convention for “source code”. -
.gitignore: This file tells git which files it should not track / not maintain a version history for. -
gatsby-browser.js: This file is where Gatsby expects to find any usage of the Gatsby browser APIs (if any). These allow customization/extension of default Gatsby settings affecting the browser. -
gatsby-config.js: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. (Check out the config docs for more detail). -
gatsby-node.js: This file is where Gatsby expects to find any usage of the Gatsby Node APIs (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process. -
gatsby-ssr.js: This file is where Gatsby expects to find any usage of the Gatsby server-side rendering APIs (if any). These allow customization of default Gatsby settings affecting server-side rendering. -
LICENSE: This Gatsby starter is licensed under the 0BSD license. This means that you can see this file as a placeholder and replace it with your own license. -
package.json: A manifest file for Node.js projects, which includes things like metadata (the project’s name, author, etc). This manifest is how npm knows which packages to install for your project. -
README.md: A text file containing useful reference information about your project.
Looking for more guidance? Full documentation for Gatsby lives on the website. Here are some places to start:
-
For most developers, we recommend starting with our in-depth tutorial for creating a site with Gatsby. It starts with zero assumptions about your level of ability and walks through every step of the process.
-
To dive straight into code samples, head to our documentation. In particular, check out the Guides, API Reference, and Advanced Tutorials sections in the sidebar.
Build, Deploy, and Host On Netlify
The fastest way to combine your favorite tools and APIs to build the fastest sites, stores, and apps for the web. And also the best place to build, deploy, and host your Gatsby sites.