The MERN stack—MongoDB, Express.js, React, and Node.js—is popular for its end-to-end JavaScript solution. This combination enables developers to build full-stack web applications efficiently. Its simplicity, flexibility, and vast ecosystem of tools and libraries make it a favorite for modern web development. This project showcases the deployment of a MERN app on AWS infrastructure, using MongoDB Atlas for the database, Elastic Beanstalk for the backend, and AWS Amplify for the frontend.
AWS Elastic Beanstalk is a fully managed service that simplifies the process of deploying, managing, and scaling web applications and services. It allows developers to focus on writing code without worrying about the underlying infrastructure. Elastic Beanstalk supports a wide range of programming languages, including Node.js, Python, Java, Ruby, and PHP. When an application is uploaded, Elastic Beanstalk automatically handles provisioning resources like Amazon EC2 instances, load balancers, auto-scaling, and health monitoring. It also provides full control over the AWS environment, enabling easy customization and scaling while maintaining simplicity and automation for deployment and management.
AWS Amplify is a comprehensive platform that simplifies the development and deployment of web and mobile applications. It provides a set of tools and services that enable front-end developers to build, ship, and scale full-stack apps quickly. Amplify supports frameworks like React, Angular, Vue, and mobile platforms like iOS and Android.
AWS Amplify is ideal for frontend development because it offers several features that streamline the process:

This is simple CRUD app based on the MERN stack which lets us store information about a book. This app is a fork of https://github.com/mohammad-taheri1/Book-Store-MERN-Stack.
Adding environment variables:
export const PORT = process.env.PORT || 5555;
export const mongoDBURL = process.env.MONGOURL;
API ENDPOINTS:
`${import.meta.env.VITE_API_URL}/books`