This repository contains a collection of sample applications demonstrating various AWS Amplify Gen 2 features and integration patterns. These samples are designed to help you understand how to implement common use cases with Amplify Gen 2, a powerful toolkit for building full-stack applications on AWS.
Amplify Gen 2 is the next generation of AWS Amplify, providing a more streamlined developer experience with:
- TypeScript-first development
- Infrastructure as TypeScript (IaC using AWS CDK)
- Enhanced type safety across your full-stack application
- A more modular and composable architecture
This repository includes the following sample applications, each demonstrating specific Amplify Gen 2 capabilities:
- batch-get-item: Demonstrates how to perform batch operations with Amplify Data
- single-table-design: Shows DynamoDB single-table design patterns with Amplify Gen 2
- access-api-from-lambda: How to access Amplify GraphQL APIs from Lambda functions
- connect-to-postgres: Connecting to PostgreSQL databases with Amplify Gen 2
- eventbridge: Integrating EventBridge with Amplify for event-driven architectures
- oidc-auth-provider: Using OpenID Connect providers (Auth0) with Amplify Gen 2
- working-with-files: File upload and management workflows
- upload-confirmation: Confirming file uploads with notifications
- sharp: Image processing with the Sharp library
- bedrock: Integrating with Amazon Bedrock for generative AI
- polly: Text-to-speech conversion with Amazon Polly
- rekognition: Image analysis with Amazon Rekognition
- translate: Language translation with Amazon Translate
- Node.js (v18 or later)
- AWS Account
- Amplify CLI Gen 2
-
Clone this repository:
git clone https://github.com/chrisbonifacio/amplify-gen2-samples.git cd amplify-gen2-samples -
Navigate to the sample project you want to explore:
cd <sample-name>
-
Install dependencies:
npm install
-
Initialize your sandbox environment:
npx ampx sandbox
-
Start the development server:
npm run dev
The samples demonstrate various patterns for working with data:
- Creating, reading, updating, and deleting data using Amplify Data
- Custom resolvers with JavaScript utility functions
- Batch operations and optimization techniques
- Integration with relational databases
You'll find examples of:
- Email/password authentication
- Social provider authentication
- Custom OIDC providers
- Authorization rules and patterns
Explore patterns for:
- Uploading and retrieving files
- Processing images and other file types
- Event-triggered file processing
- Storage authorization rules
Discover how to leverage AWS AI services:
- Text generation with Amazon Bedrock
- Image analysis with Rekognition
- Language translation
- Text-to-speech with Polly
When you're ready to deploy a sample to your AWS account:
npx ampx sandboxWe welcome contributions to improve these samples or add new ones. Please follow the standard GitHub flow:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This repository is licensed under the MIT-0 License. See the LICENSE file for details.
We hope these samples help you get started with AWS Amplify Gen 2! If you have questions or encounter issues, please open an issue in this repository or reach out to the AWS Amplify team through the community channels.