The MERN stack—MongoDB, Express, React, and Node.js—is a widely used JavaScript framework for building modern, scalable web applications. Its flexibility makes it especially suitable for applications that require dynamic user interfaces and real-time updates.
Amazon Q Developer is a generative AI–powered coding assistant designed to improve developer productivity across every phase of the software development lifecycle (SDLC). In this two-part blog series, I document my experience using Amazon Q Developer as a coding assistant to build a scalable, containerized MERN stack web application on AWS. The solution described here establishes a solid foundation for building feature-rich applications.
Using the approach outlined in this post, I later extended the application to support real-time video conferencing using the Amazon Chime SDK and an AI-powered chatbot invoking foundation models through Amazon Bedrock.
How Amazon Q Developer Fits into the SDLC
In a traditional SDLC, significant time is spent researching architectures, evaluating solution patterns, writing boilerplate code, testing, reviewing changes, and configuring infrastructure. Amazon Q Developer accelerates each of these phases by providing context-aware, best-practice-driven guidance and code generation.
Trained on over 17 years of AWS experience, Amazon Q Developer produces responses aligned with AWS Well-Architected Framework principles. In this walkthrough, it is used throughout the plan, design, build, test, and review phases to demonstrate measurable productivity gains.
Overview
Prerequisites
To complete this walkthrough, you need the following:
- An AWS account to deploy solution components
- AWS CLI installed and configured
- Docker Desktop installed
- Access to Amazon Q Developer, using one of the following options:
- Free tier, requiring an AWS Builder ID
- Pro tier, set up through IAM Identity Center
- A supported IDE such as Visual Studio Code or JetBrains IDEs, with the Amazon Q Developer extension or plugin installed
Signing In to Amazon Q Developer
After installing the Amazon Q Developer extension and configuring your access tier, you can sign in directly from your IDE.
- The Free tier uses an AWS Builder ID for authentication.
- The Pro tier uses a sign-in URL provided through the AWS access portal.
Once authenticated, an interactive chat window appears. From here, you can:
- Add context using the active file or entire workspace
- Define rules for how Amazon Q Developer should generate responses
- Toggle agentic coding on or off
- Select a preferred foundation model (Claude Sonnet 4 in this case)
The Free tier provides limited agentic requests per month and access to the latest Claude models. The Pro tier expands on this with higher request limits, app transformation features, Identity Center support, and IP indemnity. This walkthrough uses the Pro tier.
Plan Phase: Defining the Solution Approach
During the planning phase, Amazon Q Developer is used to research and understand the architectural components of a scalable MERN stack application on AWS. Agentic coding is turned off at this stage.
Example planning prompt:
“Provide a high-level summary of a solution approach to deploying a scalable MERN stack application on AWS.”
Amazon Q Developer breaks the solution into the following components:
- React frontend application
- Node.js and Express backend running as a container on Amazon ECS Fargate
- MongoDB or Amazon DocumentDB as the database
- Core networking infrastructure
- Security controls
- Monitoring and operations
- CI/CD pipeline
- Performance considerations
This response serves as the architectural baseline for the next phases.
Design & Build Phase: Generating the Application
With the high-level architecture defined, the next step is to generate a detailed solution using Amazon Q Developer’s feature development capabilities. Agentic coding is enabled at this stage.
Example design 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.”
Amazon Q Developer first provides an architecture overview, then walks through the build process step by step. For each file it creates or modifies, it presents a diff view, allowing you to review and undo changes if needed. This review step is critical to ensure the generated code aligns with your requirements.
Amazon Q Developer also executes shell commands—such as creating frontend and backend directories—only after explicit approval.
During this phase, Amazon Q Developer:
- Creates authentication services and data models
- Generates Dockerfiles for containerization
- Builds the React frontend
- Creates AWS infrastructure components
Running the Application Locally
Although the initial deployment steps focused on AWS, the original requirement specified that the application should be built, tested, and run locally first. After prompting Amazon Q Developer to address this, it adjusted the setup to support local deployment.
Additional issues surfaced during review:
- Amazon Cognito environment variables were incorrectly configured for local development
- The local setup pointed to a MongoDB container instead of DocumentDB
These observations were shared with Amazon Q Developer, which then corrected the configuration. This highlights an important point: generated code should always be reviewed and challenged to ensure correctness.
Once fixed, Amazon Q Developer updated the documentation and offered deployment options. Choosing a deployment with real Amazon Cognito resources, it proceeded to provision and validate the setup.
The tool verified:
- All containers were running
- Application endpoints responded correctly
- The frontend, backend, and database communicated as expected
At this stage, the application could be accessed locally via http://localhost:3000, starting with the Sign In and Sign Up flows, followed by an authenticated landing page displaying available shops.
Test Phase: Generating Unit Tests
With the application running locally, Amazon Q Developer is used to improve code quality by generating unit tests.
Example prompt:
“Can you generate unit tests for the project?”
Amazon Q Developer creates comprehensive unit tests and provides instructions for running them. After execution, it summarizes the results, helping identify defects early in the development lifecycle.
Review Phase: Automated Code Review
To further improve the solution, Amazon Q Developer performs a full code review.
Example prompt:
“Can you do a code review of my project to identify and fix any code issues?”
The tool analyzes the project, identifies critical issues, applies fixes, and summarizes the changes along with recommended next steps.
Clean-Up
To avoid unnecessary costs, the Amazon Cognito resources created during this walkthrough should be removed after completion.
Conclusion
Amazon Q Developer significantly reduces the effort required across every phase of the SDLC—from planning and design to build, test, and review. In this post, you saw how Amazon Q Developer can be used as a coding assistant to build a scalable MERN stack web application on AWS, while maintaining architectural best practices.
You used Amazon Q Developer to:
- Define a scalable AWS architecture
- Generate application code from detailed prompts
- Customize and run the application locally
- Generate unit tests to improve code quality
- Conduct an automated code review
In Part 2 of this blog series, Amazon Q Developer will be used to extend the application with a chat user interface powered by an agentic workflow, deploy the solution to AWS using infrastructure as code (IaC), troubleshoot deployment issues, and generate comprehensive documentation.

