Close Menu

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Hawaii’s Cruise Tourism Faces Challenges with New Emission Reduction Proposal

    August 16, 2025

    Using too much AI at work? Psychologist warns it is like ‘junk food’, leading to ‘relational diabetes’, ETHealthworld

    August 16, 2025

    Build a scalable containerized web application on AWS using the MERN stack with Amazon Q Developer – Part 1

    August 16, 2025
    Facebook X (Twitter) Instagram
    • Demos
    • Buy Now
    Facebook X (Twitter) Instagram YouTube
    14 Trends14 Trends
    Demo
    • Home
    • Features
      • View All On Demos
    • Buy Now
    14 Trends14 Trends
    Home » Build a scalable containerized web application on AWS using the MERN stack with Amazon Q Developer – Part 1
    AI AWS

    Build a scalable containerized web application on AWS using the MERN stack with Amazon Q Developer – Part 1

    adminBy adminAugust 16, 2025No Comments10 Mins Read0 Views
    Facebook Twitter Pinterest LinkedIn Telegram Tumblr Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    The MERN (MongoDB, Express, React, Node.js) stack is a popular JavaScript web development framework. The combination of technologies is well-suited for building scalable, modern web applications, especially those requiring real-time updates and dynamic user interfaces. Amazon Q Developer is a generative AI-powered assistant that improves developer efficiency across the different phases of the software development lifecycle (SDLC). In this two-part blog series, I capture the experience and demonstrate the productivity gains you can achieve by using Amazon Q Developer as a coding assistant to build a scalable MERN stack web application on AWS. The solution forms a solid foundation for you to build a feature rich web application. In my case, using the process outlined in this blog, I extended the MERN stack web application to include real-time video conferencing (using Amazon Chime SDK) and an AI chatbot (invoking Amazon Bedrock foundation models).

    Typically, in the plan phase of the SDLC, time is spent researching approaches and identifying common solution patterns that can deliver on requirements. Using Amazon Q Developer, you can speed up this process by prompting for an approach to deploy a scalable MERN stack web application on AWS. Trained on over 17 years of AWS experience building in the cloud, Amazon Q Developer responses are based on AWS well-architected patterns and best practices. In the design phase, I use the responses from Amazon Q Developer to craft a detailed requirements prompt to generate the code for your MERN stack web application. Then in the build phase, I extend the code to implement a working solution, generate unit tests and conduct an automated code review.

    In part 2 of this blog series, I will use Amazon Q Developer to extend the base MERN stack web application to include a chat user interface (which invokes an agentic workflow based on the Strands Agent SDK and Amazon Bedrock), deploy the solution to AWS using infrastructure as code (IaC), troubleshoot issues and generate the documentation for our solution.

    Walkthrough

    Prerequisites

    To complete the walkthrough in this post, you must have the following:

    Sign in to Amazon Q Developer (in your IDE)

    After setting up Amazon Q Developer access tier and installing the Amazon Q extension for your IDE, you can sign in to Amazon Q Developer by using the IDE.

    1. The first sign-in flow shows the authentication process for the Free tier using an AWS Builder ID.

    Diagram showing Amazon Q Developer sign-in process for Visual Studio Code using Free tier

    1. The second sign-in flow shows the authentication process for the Pro tier using a sign-in URL to the AWS access portal (provided by your AWS administrator).

    Diagram showing Amazon Q Developer sign-in process for Visual Studio Code using Pro tier

    1. After successful authentication, you’ll be presented with an initial chat window to start a conversation with Amazon Q Developer. In the chat input at the bottom, you have options to add additional context for Amazon Q Developer to provide responses such as using the active file or the entire workspace, defining rules for Amazon Q Developer to follow when it generates responses, toggling agentic coding on and off, and selecting your preferred foundation model (Claude Sonnet 4 in our case).

    Diagram showing Amazon Q Developer chat window

    With Free Tier, you have access to limited agentic requests per month, access to the latest Claude models and use of Amazon Q Developer in the IDE or CLI. In this post, I use the Pro Tier, which in addition to Free Tier features, also provides increased limits of agentic requests and app transformation, Identity center support and IP indemnity.

    Plan

    In the planning phase, you can prompt for a solution approach to better understand the different components that will make up the MERN stack web application. You would toggle agentic coding off in this phase as you research and understand the best approach. Example planning phase prompt:

    “Provide a high-level summary of a solution approach to deploying a scalable MERN stack application on AWS.”

    The response from Amazon Q Developer (also shown in the following screenshot) breaks down the solution into the following components:

    • Frontend React application
    • Backend NodeJS and Express containerized app running on Amazon ECS Fargate
    • Database using MongoDB or Amazon DocumentDB
    • Core network infrastructure
    • Security
    • Monitoring and operations
    • Continuous integration and delivery (CI/CD) pipeline
    • Performance

    Diagram showing the Amazon Q Developer response to the solution approach prompt

    Design & Build

    After reviewing the solution approach, you can create a more detailed prompt about the web application requirements, which will be used in the feature development capability of Amazon Q Developer to generate the solution components. Turn agentic coding on before submitting the prompt. Example design phase prompt:

    “Build a scalable containerized web application using the MERN stack on AWS, with login and sign-up pages integrated with Amazon Cognito, a landing page that retrieves a list of shops from DocumentDB. I don’t intend to use AWS Amplify. It needs to be a modular design with components that can scale independently, running as containers using ECS and Fargate, highly available across two Availability Zones. I need to build, test and run the MERN stack locally before pushing the solution to AWS.”

    As shown in the following screenshots, Amazon Q Developer will provide an architecture overview of the solution before going through the build process step by step. I will provide a select number of screenshots for illustration but note that the steps generated by Amazon Q Developer will vary for your solution prompt.

    Diagram showing the Amazon Q Developer response to the solution approach prompt

    For each file that it creates or updates, Amazon Q Developer gives you the option to review the difference and undo the changes. This is an important step to understand whether the generated code meets your requirements. For example, the snippet below shows an update the Navbar component.

    Diagram showing the update to the Navbar component.

    When viewing the diff, you can see that Amazon Q Developer has added a new button class to fix a display issue.

    Diagram showing the diff of Amazon Q Developer adding a new button class to fix a display issue

    Amazon Q Developer can also execute shell commands. In this case, create the backend and frontend directory. You have the option to ‘Reject’ or ‘Run’ the command.

    Diagram showing the option to ‘Reject’ or ‘Run’ the shell command to create the backend and frontend directories

    Here’s a snippet of Amazon Q Developer creating the authentication service, data model and Dockerfile for the solution.

    Diagram showing Amazon Q Developer creating the authentication service, data model and Dockerfile for the solution.

    Another snippet of Amazon Q Developer creating the React frontend.

    Diagram showing Amazon Q Developer creating the React frontend.

    A snippet of Amazon Q Developer creating the AWS infrastructure components.

    Diagram showing Amazon Q Developer creating the AWS infrastructure components

    Amazon Q Developer then prompts to execute the deployment.

    Diagram showing the option to ‘Reject’ or ‘Run’ the shell command to make the deploy script executable.

    But I noticed that it hasn’t followed my initial prompt to “build, test and run the MERN stack locally before pushing the solution to AWS”, so I provide the following prompt:

    “In my initial prompt, I asked to build, test and run the MERN stack locally before pushing the solution to AWS.

    Amazon Q Developer acknowledges my observation and makes the necessary changes for local deployment.

    Diagram showing Amazon Q Developer creating files to run locally.

    Next, Amazon Q Developer will build, test and run the MERN stack locally as shown below.

    Diagram showing Amazon Q Developer setting up and running the application locally.

    When reviewing the .env file changes, I noticed that the Amazon Cognito properties are not properly set, so provide the following prompt:

    “When reviewing your .env file changes, I noticed that setting to COGNITO_USER_POOL_ID and COGNITO_CLIENT_ID to local-development is incorrect, as I should be connecting to Amazon Cognito in AWS. And this hasn't been created yet. Additionally, the local deployment has been configured to connect to the local MongoDB container instead of DocumentDB.”

    Amazon Q Developer again acknowledges my observation and attempts to fix the issues. These two issues highlight that to effectively use Amazon Q Developer, it’s important to review and challenge the responses provided.

    Diagram showing Amazon Q Developer fixing Cognito and database issues.

    After fixing the issues, Amazon Q Developer updates the README.md to reflect the updated approach and asks if I want to do a quick deployment with mocked authentication or an actual deployment with Amazon Cognito resources.

    Diagram showing Amazon Q Developer summarizing fixes made and options for next step.

    I choose option B, with real Amazon Cognito resources, so Amazon Q Developer deploys the resources as shown below.

    Diagram showing Amazon Q Developer executing the setup-aws-cognito.sh script

    Amazon Q Developer now checks that the frontend, backend and MongoDB containers are running.

    Diagram showing the output of the container status

    Amazon Q Developer also tests that the application is running by executing curl commands to the application endpoints.

    Diagram showing Amazon Q Developer testing application endpoints.

    After successfully running the commands, Amazon Q Developer provides a summary of the results, with details on how to access and test the application.

    Diagram showing application testing results.

    Here’s a diagram showing the locally deployed solution.

    Diagram showing the MERN stack solution components deployed locally.

    Now that the frontend, backend, and MongoDB containers are running, you can access the frontend application Sign In page on http://localhost:3000.

    Diagram showing the Sign In page for the application.

    Before logging in, you need to create a user. Choose the Sign Up link to enter an email and password.

    Diagram showing the Sign Up page for the application.

    After attempting to sign up, I noticed that Amazon Q Developer hasn’t generated the corresponding frontend screen to enter the confirmation code, so I prompt it to fix the issue. Again, the generated code isn’t always perfect, but it’s a good starting point.

    Diagram showing the Sign Up verification code page

    After authentication, you’ll be routed to the shops page as shown.

    Diagram showing the authenticated landing page with available shops.

    Test

    Now that you’ve built and can run the MERN stack web application locally, you can use Amazon Q Developer to generate unit tests to find defects and improve code quality. I provide the following prompt:

    “Can you generate unit tests for the project?”

    Amazon Q Developer will then create comprehensive unit tests for the application.

    Diagram showing Amazon Q Developer creating unit tests for the application

    At completion, Amazon Q Developer will provide a summary of the unit tests generated:

    Diagram showing a summary of the unit tests generated.

    Amazon Q Developer also provides instructions for executing the tests:

    Diagram showing Amazon Q Developer instructions to run the tests.

    After executing the unit tests, Amazon Q Developer provides a summary of the results.

    Diagram showing the Amazon Q Developer unit tests summary.

    Review

    We can now conduct a code review of the MERN stack application by prompting the following:

    “Can you do a code review of my project to identify and fix any code issues?”

    Amazon Q Developer will perform a code review and identify issues that require attention.

    Diagram showing Amazon Q Developer performing a comprehensive code review.

    After completing the review, Amazon Q Developer will provide a summary of the critical issues fixed, along with next steps.

    Diagram showing a summary of the critical issues fixed as part of the code review by Amazon Q Developer.

    Clean up

    To avoid incurring future charges, remove the Amazon Cognito resources that you created.

    Conclusion

    In a traditional SDLC, a lot of time is spent in the different phases researching approaches that can deliver on requirements: iterating over design changes, writing, testing and reviewing code, and configuring infrastructure. Amazon Q Developer is a generative AI-powered assistant that improves developer efficiency across the phases of the SDLC. In this post, you learned about the experience and saw productivity gains you can realize by using Amazon Q Developer as a coding assistant to build a scalable MERN stack web application on AWS.

    In the plan phase, you used Amazon Q Developer to prompt for a solution approach to deploy a scalable MERN stack web application on AWS. Then in the design phase, you used the initial responses from Amazon Q Developer to craft a detailed requirements prompt and generated the code for your MERN stack web application. In the build phase, you customized the code and deployed a working solution locally. In the test phase, Amazon Q Developer generated the unit tests for you to identify bugs early to improve code quality. Finally, in the review phase, you conducted a code review and remediated issues identified.

    In part 2 of this blog series, you will use Amazon Q Developer to extend the base MERN stack web application to include a chat user interface (which invokes an agentic workflow based on the Strands Agent SDK and Amazon Bedrock), deploy the solution to AWS using infrastructure as code (IaC), troubleshoot issues and generate the documentation for our solution.


    About the Author

    Bill Chan is an Enterprise Solutions Architect working with large enterprises to craft highly scalable, flexible, and resilient cloud architectures. He helps organizations understand best practices around advanced cloud-based solutions, and how to migrate existing workloads to the cloud. He enjoys relaxing with family and shooting hoops.



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    admin
    • Website

    Related Posts

    Introducing Amazon Bedrock AgentCore Gateway: Transforming enterprise AI agent tool development

    August 15, 2025

    Scalable intelligent document processing using Amazon Bedrock Data Automation

    August 15, 2025

    Securely launch and scale your agents and tools on Amazon Bedrock AgentCore Runtime

    August 14, 2025

    Build a conversational natural language interface for Amazon Athena queries using Amazon Nova

    August 13, 2025

    Train and deploy AI models at trillion-parameter scale with Amazon SageMaker HyperPod support for P6e-GB200 UltraServers

    August 12, 2025

    Demystifying Amazon Bedrock Pricing for a Chatbot Assistant

    August 12, 2025
    Leave A Reply Cancel Reply

    Demo
    Top Posts

    ChatGPT’s viral Studio Ghibli-style images highlight AI copyright concerns

    March 28, 20254 Views

    Best Cyber Forensics Software in 2025: Top Tools for Windows Forensics and Beyond

    February 28, 20253 Views

    An ex-politician faces at least 20 years in prison in killing of Las Vegas reporter

    October 16, 20243 Views

    Laws, norms, and ethics for AI in health

    May 1, 20252 Views
    Don't Miss

    Hawaii’s Cruise Tourism Faces Challenges with New Emission Reduction Proposal

    August 16, 2025

    Home » CRUISE NEWS » Hawaii’s Cruise Tourism Faces Challenges with New Emission Reduction Proposal…

    Using too much AI at work? Psychologist warns it is like ‘junk food’, leading to ‘relational diabetes’, ETHealthworld

    August 16, 2025

    Build a scalable containerized web application on AWS using the MERN stack with Amazon Q Developer – Part 1

    August 16, 2025

    Prime Minister Modi Lauds Ayushman Bharat’s Impact on Healthcare Access, ETHealthworld

    August 16, 2025
    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    • YouTube
    • Vimeo

    Subscribe to Updates

    Get the latest creative news from SmartMag about art & design.

    Demo
    Top Posts

    ChatGPT’s viral Studio Ghibli-style images highlight AI copyright concerns

    March 28, 20254 Views

    Best Cyber Forensics Software in 2025: Top Tools for Windows Forensics and Beyond

    February 28, 20253 Views

    An ex-politician faces at least 20 years in prison in killing of Las Vegas reporter

    October 16, 20243 Views
    Stay In Touch
    • Facebook
    • YouTube
    • TikTok
    • WhatsApp
    • Twitter
    • Instagram
    Latest Reviews
    Demo
    About Us
    About Us

    Your source for the lifestyle news. This demo is crafted specifically to exhibit the use of the theme as a lifestyle site. Visit our main page for more demos.

    We're accepting new partnerships right now.

    Email Us: info@example.com
    Contact: +1-320-0123-451

    Facebook X (Twitter) Pinterest YouTube WhatsApp
    Our Picks

    Hawaii’s Cruise Tourism Faces Challenges with New Emission Reduction Proposal

    August 16, 2025

    Using too much AI at work? Psychologist warns it is like ‘junk food’, leading to ‘relational diabetes’, ETHealthworld

    August 16, 2025

    Build a scalable containerized web application on AWS using the MERN stack with Amazon Q Developer – Part 1

    August 16, 2025
    Most Popular

    ChatGPT’s viral Studio Ghibli-style images highlight AI copyright concerns

    March 28, 20254 Views

    Best Cyber Forensics Software in 2025: Top Tools for Windows Forensics and Beyond

    February 28, 20253 Views

    An ex-politician faces at least 20 years in prison in killing of Las Vegas reporter

    October 16, 20243 Views

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    14 Trends
    Facebook X (Twitter) Instagram Pinterest YouTube Dribbble
    • Home
    • Buy Now
    © 2025 ThemeSphere. Designed by ThemeSphere.

    Type above and press Enter to search. Press Esc to cancel.