In this video I show how to set up a NextJS app that uses AWS Amplify Gen 2 as the backend. You'll see demonstrated...
- auth configuration in amplify/auth/resource.ts that creates an "Admins" group and specifies that users will sign in using an email address
- a schema in amplify/data/resource.ts for a Product model
- permissions that allow authenticated and unauthenticated users to read the Product data
- permissions that allow members of the Admins group to create, update and delete Product items
- configuration of an S3 bucket for storing product images
- in utils/amplify-utils.ts the creation of a cookie-based client for accessing data, and determining for determining signed-in and admin status, from server-side-rendered pages
- utils/middleware.ts middleware for limiting access to admin/ pages to admin users
- customizing "connected forms" generated by Amplify from the data schema
- using Amplify's Authenticator client component and context provider
- an admin context provider and custom hook so that client components can determine whether of not a user is an admin
- use of Amplify's StorageManager and StorageImage React components
** MISTAKES **
- I noticed a small error: in the video I say that you can cd into the directory where you want your connected forms to be generated and type "npx ampx generate forms". Actually, you should be in project root directory (where you have the package.json) and type "npx ampx generate forms --out-dir TARGET-DIRECTORY", e.g., "npx ampx generate forms --out-dir src/ui-components".
GitHub Repo: github.com/ony...
Негізгі бет Getting Started with NextJS and AWS Amplify Gen 2 Part 1
Пікірлер: 2