Module 2: Creating a Basic Web Application
In this module, you'll use Amazon Q Developer to create a Basic Web application. You'll learn how to leverage Amazon Q to generate code, explain concepts, and help you build a functional web application.
Prerequisites
- Completed Module 1: Setting Up Amazon Q Developer
Step 1: Amazon Q Developer CLI
- Input prompt to create Sudoku web application in Terminal
create simple html sudoku web application

- Press
t
ory
to allow Q execute the command to create file

- Amazon Q Developer CLI will able to
- 3.1 Create html file which you can see in Project Explorer.
- 3.2 Describe the application details and usages.

- Open html file and click on
Show Preview

- You will able to see web page and able to play Sudoku

- Delete all files
!rm -rf *
- Exit Q chat
# Exit Q chat
/quit
# Re-enter Q Chat
q chat
Step 2: Amazon Q Developer IDE
- Input prompt to create Sudoku web application in
VSCode IDE
create simple html sudoku web application

- Amazon Q will start planing and generating the web applicaiton

- Amazon Q Developer CLI will able to
- 3.1 Create html file which you can see in Project Explorer.
- 3.2 Describe the application details and usages.

- After Amazon Q finished generate the file. You can open html file, click on
Show Preview
. You will able to see web page and able to play Sudoku

Step 3: Generate Documentation (README)
- In IDE, we will use Q Developer agentic capabilities to create documentation by typing
/doc
in IDE
/doc

- Select
Create a README

- Accept the file to create

- Review the result

Note:
You also can create README via CLI by prompt. But you may need to add context first
- Add Context files to CLI
/context add *
- Prompt: Create readme
Could you create a README file for this application?
(Optional) Step 4: Testing and Debugging with Amazon Q
- Open your
index.html
file in a web browser to test your Sudoku application - If you encounter any issues, use Amazon Q in VS Code or in the terminal to help debug:
"Why isn't this code working as expected?"
describe your issue...
- Use Amazon Q's suggestions to fix any bugs or improve functionality
(Optional) Step 5: Adding Final Touches
- Use Amazon Q to help you add final touches to your application:
Ask Amazon Q:
"How can I improve the user experience of my Sudoku game?"
"Can you help me add a timer feature to my Sudoku game?"
"How can I save the game state so users can continue later?"
- Implement the suggestions that you find valuable
(Optional) Example Prompts for Amazon Q
Here are some example prompts you can use with Amazon Q to help with specific aspects of your Sudoku application:
- "How do I generate a valid Sudoku puzzle in JavaScript?"
- "Write a function to check if a Sudoku solution is valid"
- "How can I highlight conflicting numbers in my Sudoku grid?"
- "Create a function to save the current game state to localStorage"
- "How do I implement different difficulty levels for my Sudoku game?"