A simple web application that allows users to chat with a Generative AI Foundation Model (Claude 3.7 Sonnet), powered by Amazon Bedrock and AWS Amplify.
- Real-time chat conversation with Claude FM
- Maintains conversation context for more coherent interactions
- AWS Amplify for fullstack single web app development
- React.js for frontend development
- Amazon API Gateway for REST API endpoints
- AWS Lambda (Python) for serverless backend processing
- Amazon Bedrock with Claude 3.7 Sonnet FM
- Node.js and npm installed
- AWS Amplify package
- AWS account with appropriate permissions
- AWS CLI configured
- Access to Amazon Bedrock FM models (e.g., Claude 3.7 Sonnet)
- In the AWS Console, navigate to Amazon Bedrock and request access to Claude 3.7 Sonnet if you haven't already.
git clone https://github.com/MardiantoS/chat-ai-bedrock.git
cd chat-ai-bedrocknpm installIf you haven't installed AWS Amplify packages and/or configured it, run below:
npm install -g @aws-amplify/cli
amplify configureafterwards, run this:
amplify initFollow the prompts to configure your Amplify project.
amplify pushnpm startclaude-chat-app/
├── amplify/ # AWS Amplify configuration and backend code
│ └── backend/
│ ├── api/ # API Gateway configuration
│ └── function/ # Lambda function code
├── public/ # Public assets
├── src/
│ ├── App.js # Main application component
│ ├── App.css # Application styles
│ └── index.js # Application entry point
│
├── .gitignore # Git ignore file
├── package.json # NPM dependencies
└── README.md # Project documentation
To deploy the application to AWS Amplify Hosting:
Make sure to run, if you haven't already
amplify hosting addthen
amplify publishThe application uses AWS Amplify to manage the backend resources. The configuration is stored in src/aws-exports.js which is generated by the Amplify CLI.
- Ensure proper IAM permissions are set for the Lambda function
- Consider implementing user authentication for production use
- Set up appropriate rate limiting on your API Gateway
- Monitor usage to control costs
- User authentication page
- Storage for persistent conversation history
- Streaming responses
- File upload capabilities
- Custom instructions for Claude
This project is licensed under the MIT License - see the LICENSE file for details.
If you use this code in your projects or research, please include the following citation:
Mardianto Hadiputro. (2025). AI Chat Application with Amazon Bedrock. GitHub. https://github.com/MardiantoS/chat-ai-bedrock
- Amazon Web Services for the infrastructure
- Anthropic for the Claude Foundation Model
