Explore Developer Center's New Chatbot! MongoDB AI Chatbot can be accessed at the top of your navigation to answer all your MongoDB questions.

Join us at AWS re:Invent 2024! Learn how to use MongoDB for AI use cases.
MongoDB Developer
Atlas
plus
Sign in to follow topics
MongoDB Developer Centerchevron-right
Developer Topicschevron-right
Productschevron-right
Atlaschevron-right

Fullstack Application Development with AWS Amplify, AppSync, and MongoDB Atlas

Anuj Panchal, Igor Alekseev3 min read • Published Nov 27, 2024 • Updated Nov 27, 2024
Atlas
Facebook Icontwitter iconlinkedin icon
Rate this tutorial
star-empty
star-empty
star-empty
star-empty
star-empty
In today’s fast-paced digital landscape, turning innovative ideas into fully functional applications quickly and efficiently is essential for developers, startups, and business consultants. This repository is designed to empower you to do just that. By leveraging AWS Amplify for seamless front-end development, AWS AppSync for robust and scalable backend services, and MongoDB Atlas for a flexible and powerful database solutions, developers can build comprehensive, low-code solutions while drastically reducing coding time and maintaining high standards of performance and scalability.
This tutorial and repository provides a starter template for building applications with React and AWS Amplify, seamlessly connecting to MongoDB Atlas. It simplifies the setup for authentication, API integration, and database capabilities. With a foundational React application pre-integrated with AWS Amplify, this template is optimized for scalability and performance, making it perfect for developers, startups, and business consultants seeking to jumpstart their projects with pre-configured AWS services like Cognito, AppSync, and MongoDB Atlas

AWS Amplify

AWS Amplify simplifies the creation of full-stack applications with minimal configuration. It provides a set of tools and services that integrate seamlessly with popular frameworks like React, Angular, and Vue, enabling developers to easily set up scalable backends, manage authentication, and deploy applications with a few simple commands. Amplify recently launched "Amplify Gen 2" which enhances support for CI/CD workflows, improves the developer experience with the Amplify CLI, and expands capabilities for backend infrastructure as code. These updates facilitate easier management and deployment of cloud resources, integration of serverless functions, and connection to MongoDB Atlas data sources through AWS AppSync and Lambda, thus significantly reducing the time and effort required to build and scale modern applications

AWS AppSync

AWS AppSync is a fully managed service that simplifies the development of GraphQL APIs by automatically handling data fetching, real-time updates, and offline synchronization. It seamlessly integrates with various data sources, including MongoDB Atlas, allowing developers to build scalable and flexible applications with ease. AppSync’s features include built-in support for real-time data updates and offline access, reducing the complexity of managing data interactions and enhancing application performance

MongoDB Atlas

MongoDB Atlas is a fully managed cloud database service known for its operational excellence and scalability. It offers advanced features like automated backups, scaling, and monitoring, ensuring high availability and performance. Notably, Atlas includes Vector Search capabilities, which are optimized for Generative AI use cases, enabling efficient search and retrieval of high-dimensional data. This feature enhances the ability to perform complex queries and data analysis, making it ideal for applications requiring sophisticated data interactions and AI-driven insights

Application Features

In this blog we implement a Todo Application that supports authentication by leveraging Amazon Cognito. The application frontend is written in React, while the backend is a GraphQL API powered by AWS AppSync and AWS Lambda. The persistence layer is provided by MongoDB Atlas. For the application’s CI/CD and hosting we rely on out-of-the-box capabilities for AWS Amplify.

Reference Architecture

Reference Architecture

Prerequisites

In order to deploy the application you need to have MongoDB Atlas Cluster created and an AWS Account.

Deploying to AWS

Step 1

Create a fork of this repository: https://github.com/mongodb-partners/amplify_appsync_mongodb_atlas_startup.git

Step 2

Set up the MongoDB Atlas cluster. Follow the link to the setup the MongoDB Atlas cluster, Database, User and Network access.

Step 3

Obtain a connection URL
Obtain Connection URL

Step 4

Deploy the To-do Application in AWS Amplify. Open the AWS Amplify console and select the Github option
Deploy to Amplify
Authenticate to GitHub and select the repository you created earlier by forking.
Authenticate to Github
Set all other options to default and deploy
Set options and deploy
Configure the Environment Variables. Note the deployments will not succeed until the environment variables are set.
Configure Environment Variables

Step 4

Test the deployed application
Test Deployed App
Verify objects are being stored in the MongoDB Atlas Collection
Verify Objects in Atlas

Conclusion

In this tutorial we showed how to deploy an application using MongoDB Atlas and AWS Amplify. If you have ideas on how to enhance the application, please submit a pull request for this repository. Try out Amplify and MongoDB Atlas.
Top Comments in Forums
There are no comments on this article yet.
Start the Conversation

Facebook Icontwitter iconlinkedin icon
Rate this tutorial
star-empty
star-empty
star-empty
star-empty
star-empty
Related
Article

Coronavirus Map and Live Data Tracker with MongoDB Charts


Nov 15, 2023 | 3 min read
News & Announcements

Deprecating MongoDB Atlas GraphQL and Hosting Services


Mar 12, 2024 | 2 min read
Code Example

MergeURL - Python Example App


Jul 07, 2022 | 3 min read
Article

Best Practices and a Tutorial for Using Google Cloud Functions with MongoDB Atlas


Jun 13, 2023 | 13 min read
Table of Contents