The application uses Amazon Bedrock to generate AI-powered chat features and enhance user experiences.
Below illustrates the architecture and process flow for running a React Native mobile application backend in the AWS Cloud.
Flow of a mobile chat application using AWS services.
- Users access the application from their mobile devices.
- The mobile client React chat application interfaces with Amazon API Gateway.
- Amazon API Gateway interacts with AWS Lambda to post and fetch the data.
- AWS Lambda interacts with one of the Amazon Bedrock models and returns the generated response in a JSON format.
- The processed data is then returned to the frontend for display, facilitating content or chat presentation.
Before you get started, make sure you have the following installed:
- Create an AWS Account if you don’t have one. Note that AWS Amplify is part of the AWS Free Tier.
- Configure your AWS account to use with Amplify.
- Node.js v18.17 or later
- npm v9 or later
- git v2.14.1 or later
- Expo CLI
- Expo Go is a sandbox that enables you to quickly experiment with building native Android and iOS apps. It’s the fastest way to get started.
The following packages should be updated for best compatibility with the installed expo version:
[email protected] - expected version: ~5.3.3
Your project may not work correctly until you install the expected versions of the packages.
Run the below command to update typescript to the expected version.
$ npm i typescript@~5.3.3
Run the below command to create an app (Uses Expo's TypeScript template).
$ npx create-expo-app amazon_bedrock_expo_chat_app -t expo-template-blank-typescript
Navigate to the root folder of your application and execute the following command to start the application.
cd amazon_bedrock_expo_chat_app
npm run ios
When prompted, enter i to open the App in iOS simulator.
Press i │ open iOS simulator
Upon successful execution, you will see your new application running in the iOS Simulator, as shown below.