I have long fancied myself a “backend engineer” and part of my checklist of personal growth after joining the AWS Amplify team was to force myself to get familiar with “frontend” development.

ReactJS seemed an obvious and safe first step, so I started with react-boilerplate which accurately warns is not for beginners. I learned that lesson the hard way.

The end result is scaffolding for a web application with the following backend components out of the box:

  • Authentication
  • Authentication verification link
  • MFA (optional)
  • Lambda hooks for pre-signup (email whitelist/blacklist), post-signup, and post-confirmation
  • Hosting with S3+Cloudfront via Amplify Console

Not to be confused with https://www.npmjs.com/package/aws-amplify-react which is built and maintained by the amazing AmplifyJS team at AWS, this repository has even stronger opinions on how to use React for bootstrapping an application. aws-amplify-react is merely a bridge between Amplify and AWS to be used within React.

Get Started

Check out the repository here: https://github.com/litwicki/amplify-react

The setup script will setup most of your environment, but you’ll want to make sure you have an AWS account with at least a default profile setup for when you amplify configure your environment.

Setup

npm run setup
npm start

Now that you’ve installed all the basics for the application, link it to the AWS account for provisioning resources.

amplify configure

Developing

This scaffolding project was built on top of react-boilerplate which has extensive documentation on how to build, test, and manage the application code.

It’s very likely this is tremendous overkill for your application, and that’s okay.


Header image from https://www.kristijanklepac.info/aws-cognito-login-with-react-and-aws-amplify/

Categories: Random