<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yusra Liaqat</title>
    <description>The latest articles on DEV Community by Yusra Liaqat (@yusraliaqat).</description>
    <link>https://dev.to/yusraliaqat</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2754974%2F7e712f62-7c4d-4e0e-bc15-c4f1d5898f71.jpg</url>
      <title>DEV Community: Yusra Liaqat</title>
      <link>https://dev.to/yusraliaqat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yusraliaqat"/>
    <language>en</language>
    <item>
      <title>Building a Web-Based Riddle Game with Amazon Q CLI: My Journey with 'Riddle Me This'</title>
      <dc:creator>Yusra Liaqat</dc:creator>
      <pubDate>Sun, 22 Jun 2025 16:48:54 +0000</pubDate>
      <link>https://dev.to/yusraliaqat/building-a-web-based-riddle-game-with-amazon-q-cli-my-journey-with-riddle-me-this-588f</link>
      <guid>https://dev.to/yusraliaqat/building-a-web-based-riddle-game-with-amazon-q-cli-my-journey-with-riddle-me-this-588f</guid>
      <description>&lt;h1&gt;
  
  
  Building a Web-Based Riddle Game with Amazon Q CLI: My Journey with "Riddle Me This"
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Recently, I embarked on a fun project to build a riddle game called &lt;strong&gt;"Riddle Me This"&lt;/strong&gt; using Amazon Q CLI as my AI assistant. In this article, I’ll walk you through how I created both a console-based and web-based version of the game, the prompts I used, and what I learned along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Amazon Q CLI?
&lt;/h2&gt;

&lt;p&gt;Amazon Q is an AI assistant built by AWS that helps with coding tasks, infrastructure management, and software development. The CLI version allows you to interact with Amazon Q directly from your terminal, making it a powerful tool for developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Overview: Riddle Me This
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;"Riddle Me This"&lt;/strong&gt; is an interactive riddle game with two versions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A text-based console application&lt;/li&gt;
&lt;li&gt;A web-based application using Flask and HTML/CSS/JavaScript&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The game presents players with riddles, tracks their scores, provides hints after failed attempts, and maintains a leaderboard of high scores.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up the Environment
&lt;/h2&gt;

&lt;p&gt;First, I set up my development environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Create a project directory&lt;/span&gt;
&lt;span class="nb"&gt;mkdir &lt;/span&gt;riddle-me-this
&lt;span class="nb"&gt;cd &lt;/span&gt;riddle-me-this

&lt;span class="c"&gt;# Initialize a virtual environment&lt;/span&gt;
python &lt;span class="nt"&gt;-m&lt;/span&gt; venv venv
&lt;span class="nb"&gt;source &lt;/span&gt;venv/bin/activate  &lt;span class="c"&gt;# On Linux/macOS&lt;/span&gt;

&lt;span class="c"&gt;# Install Flask for the web version&lt;/span&gt;
pip &lt;span class="nb"&gt;install &lt;/span&gt;flask
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Using Amazon Q CLI to Build the Game
&lt;/h2&gt;

&lt;p&gt;I used Amazon Q CLI to help me build the game by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;q chat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This opened an interactive chat session where I could describe what I wanted to build and get code suggestions.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Prompts I Used
&lt;/h3&gt;

&lt;p&gt;Here are some of the key prompts I used with Amazon Q:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Initial console version:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Create a simple text-based game called "Riddle Me This" in Python. The game should present riddles to the player, check answers, implement scoring, timing, hints after failed attempts, and store high scores.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Web-based version:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Create a GUI version of the "Riddle Me This" game in Python with Flask for the backend and HTML/CSS/Javascript for the frontend. The main page should display riddles, provide input for answers, show hints after failed attempts, and track scores and time.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;When I encountered installation issues:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;error: externally-managed-environment&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Amazon Q provided solutions for handling this error by suggesting virtual environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Console Version
&lt;/h3&gt;

&lt;p&gt;The console version includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A collection of riddles with questions, answers, and hints&lt;/li&gt;
&lt;li&gt;Player name input&lt;/li&gt;
&lt;li&gt;Scoring system (1 point per correct answer)&lt;/li&gt;
&lt;li&gt;Timer for each riddle and total game time&lt;/li&gt;
&lt;li&gt;Hints after 2 failed attempts&lt;/li&gt;
&lt;li&gt;High score system stored in a CSV file&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Web Version
&lt;/h3&gt;

&lt;p&gt;The web version expanded on this with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Flask backend&lt;/li&gt;
&lt;li&gt;Responsive HTML/CSS frontend&lt;/li&gt;
&lt;li&gt;Welcome page for player name input&lt;/li&gt;
&lt;li&gt;Game page for displaying riddles and accepting answers&lt;/li&gt;
&lt;li&gt;Game over page showing final score&lt;/li&gt;
&lt;li&gt;High scores leaderboard&lt;/li&gt;
&lt;li&gt;Timer displayed on the game interface&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Project Structure
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;riddle-me-this/
├── app.py                 # Flask application
├── high_scores.csv        # High scores data file
├── riddle_me_this.py      # Original console version
├── static/
│   └── css/
│       └── style.css      # CSS styles
└── templates/
    ├── game.html          # Game page template
    ├── game_over.html     # Game over page template
    ├── highscores.html    # High scores page template
    └── welcome.html       # Welcome page template
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;Through this project, I learned:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;AI-Assisted Development:&lt;/strong&gt; Amazon Q CLI significantly accelerated my development process by generating code, suggesting improvements, and helping with debugging.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full-Stack Development:&lt;/strong&gt; I gained experience building both backend (Python/Flask) and frontend (HTML/CSS/JavaScript) components.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Session Management:&lt;/strong&gt; I learned how to manage user sessions in Flask to track game state.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Responsive Design:&lt;/strong&gt; The web interface adapts to different screen sizes for a better user experience.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error Handling:&lt;/strong&gt; I implemented graceful error handling for invalid inputs and edge cases.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Virtual Environments:&lt;/strong&gt; I learned the importance of using virtual environments to manage dependencies.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Challenges and Solutions
&lt;/h2&gt;

&lt;p&gt;One challenge I faced was the &lt;code&gt;externally-managed-environment&lt;/code&gt; error when installing Flask. Amazon Q suggested using a virtual environment, which solved the problem:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; venv venv
&lt;span class="nb"&gt;source &lt;/span&gt;venv/bin/activate
pip &lt;span class="nb"&gt;install &lt;/span&gt;flask
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Future Improvements
&lt;/h2&gt;

&lt;p&gt;Some ideas for future enhancements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add difficulty levels&lt;/li&gt;
&lt;li&gt;Implement user authentication&lt;/li&gt;
&lt;li&gt;Add sound effects&lt;/li&gt;
&lt;li&gt;Create a multiplayer mode&lt;/li&gt;
&lt;li&gt;Add categories for riddles&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Code Repository
&lt;/h2&gt;

&lt;p&gt;You can find the complete code for this project on my GitHub repository: &lt;a href="https://github.com/Yusra310/Riddle-me-this" rel="noopener noreferrer"&gt;https://github.com/Yusra310/Riddle-me-this&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Building "Riddle Me This" with Amazon Q CLI was a fun and educational experience. The AI assistant helped me quickly develop both console and web versions of the game, allowing me to focus on the creative aspects rather than getting stuck on implementation details.&lt;/p&gt;

&lt;p&gt;If you’re interested in game development or learning web development with Flask, I encourage you to try building your own version of this game!&lt;/p&gt;

</description>
      <category>python</category>
      <category>flask</category>
      <category>aws</category>
      <category>amazonq</category>
    </item>
    <item>
      <title>Ecommerce App Deployment with Flask (Python), GitHub, Jenkins, Docker, and EC2. 🚀</title>
      <dc:creator>Yusra Liaqat</dc:creator>
      <pubDate>Fri, 24 Jan 2025 21:39:51 +0000</pubDate>
      <link>https://dev.to/yusraliaqat/ecommerce-app-deployment-with-flask-python-github-jenkins-docker-and-ec2-299a</link>
      <guid>https://dev.to/yusraliaqat/ecommerce-app-deployment-with-flask-python-github-jenkins-docker-and-ec2-299a</guid>
      <description>&lt;p&gt;Hey folks! 👋 I’m super excited to share an end-to-end DevOps project I recently completed. This project ties together AWS EC2, Docker, GitHub, and Jenkins into a seamless CI/CD workflow. If you're looking for a hands-on guide with a real-world use case, buckle up. I'll walk you through every step I took, from setting up infrastructure to deploying a containerized app with Jenkins. Let’s dive in! 🤿&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;The Idea&lt;/li&gt;
&lt;li&gt;Setting Up AWS EC2 Instances&lt;/li&gt;
&lt;li&gt;Installing Docker on the Ubuntu EC2 Instance&lt;/li&gt;
&lt;li&gt;Building the Ecommerce App&lt;/li&gt;
&lt;li&gt;Creating Repo locally and initializing on GitHub&lt;/li&gt;
&lt;li&gt;Pulling Jenkins and Installing Plugins&lt;/li&gt;
&lt;li&gt;Setting Up Jenkins with GitHub&lt;/li&gt;
&lt;li&gt;Creating a Jenkins Freestyle Pipeline&lt;/li&gt;
&lt;li&gt;Resolving Docker Issues&lt;/li&gt;
&lt;li&gt;Application Deployment&lt;/li&gt;
&lt;li&gt;Visualizing the Workflow&lt;/li&gt;
&lt;li&gt;Code and Resources&lt;/li&gt;
&lt;li&gt;Closing Thoughts&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Idea: &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The goal was to build and deploy an ecommerce application using modern DevOps tools and practices. The process included application development, containerization, and setting up a pipeline for automated deployment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up AWS EC2 Instances &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;I created two EC2 instances on AWS:&lt;/p&gt;

&lt;p&gt;Ubuntu Instance: For running Docker and hosting the application.&lt;br&gt;
Windows Instance: For developing the ecommerce app.&lt;br&gt;
Both instances were provisioned with security groups to allow SSH/RDP and HTTP access.&lt;/p&gt;
&lt;h2&gt;
  
  
  Installing Docker on the Ubuntu EC2 Instance &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;To containerize and run our app, I installed Docker on the Ubuntu EC2 server. Here's the magic command I used:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Building the Ecommerce App &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The Windows EC2 instance served as my dev environment. I developed a simple ecommerce app using Flask python. Once I was happy with the app, I pushed the code to GitHub.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Repo locally and initializing on GitHub &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Essentially, it is just as if you were creating your development project locally and then uploading it to Git &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create any Repo/Project locally in VS code &lt;/li&gt;
&lt;li&gt;It won’t be a part of GitHub Repo as for now &lt;/li&gt;
&lt;li&gt;After adding files your project and updating them we need to initialize our Repo so Git can recognize it
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo "# terraform01" &amp;gt;&amp;gt; README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/Yusra310/terraform01.git
git push -u origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This made my workflow a little cleaner and portable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pulling Jenkins and Installing Plugins &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;To automate the build and deployment process, I pulled the official Jenkins Docker image on the Ubuntu instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -d --name jenkins \
  -p 8080:8080 -p 50000:50000 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v jenkins_home:/var/jenkins_home \
  jenkins/jenkins:lts

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I accessed Jenkins through the browser&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://54.159.138.147:8080
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;unlocked it using the initial password, and installed the necessary plugins:&lt;/p&gt;

&lt;p&gt;GitHub Plugin for GitHub integration.&lt;br&gt;
 Docker Plugin to enable Docker commands within Jenkins.&lt;/p&gt;
&lt;h2&gt;
  
  
  Setting Up Jenkins with GitHub &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;To securely integrate GitHub with Jenkins, I created a GitHub Personal Access Token. This token was added as a credential in Jenkins, allowing the CI/CD pipeline to pull code from the GitHub repository.&lt;/p&gt;
&lt;h2&gt;
  
  
  Creating a Jenkins Freestyle Pipeline &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Here’s the exciting part! 🎉 I set up a Freestyle Jenkins pipeline for the CI/CD workflow. The pipeline:&lt;/p&gt;
&lt;h3&gt;
  
  
  Jenkins Shell Script:
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Docker build -t ecommerce-app
Docker run -p 5000:5000 -d ecommerce-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Resolving Docker Issues &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The first pipeline run failed with an error: docker: command not found.&lt;br&gt;
The issue? Docker wasn’t installed in the Jenkins container! 🤦‍♀️&lt;br&gt;
Solution: I installed Docker inside the Jenkins container and gave it access to the host’s Docker socket. This allowed Jenkins to execute Docker commands seamlessly.&lt;/p&gt;
&lt;h2&gt;
  
  
  Application Deployment &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;With everything in place, I ran the Jenkins pipeline again and The ecommerce app was deployed and accessible in the browser at&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://54.159.138.147:5000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Visualizing the Workflow &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;To make things more digestible, I created a draw.io diagram that outlines the entire workflow, from code push to deployment. Here's a summary of the steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Develop the app on the Windows instance.&lt;/li&gt;
&lt;li&gt;Push the code to GitHub.&lt;/li&gt;
&lt;li&gt;Jenkins pulls the code, builds a Docker image, and runs the container.&lt;/li&gt;
&lt;li&gt;The app is hosted on the Ubuntu EC2 instance.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Code and Resources &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;I’ve shared the source code, Jenkins configuration, and the draw.io diagram here on GitHub [&lt;a href="https://github.com/Yusra310/ecommerce-app" rel="noopener noreferrer"&gt;https://github.com/Yusra310/ecommerce-app&lt;/a&gt;]. Feel free to check it out and try this workflow yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing Thoughts &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;This project was a blast to work on! It taught me the power of automation and containerization in modern application development. If you’re just starting with DevOps, projects like this are a fantastic way to get hands-on experience.&lt;br&gt;
Got questions or suggestions? Drop them in the comments below! Let’s keep building. 💪&lt;br&gt;
Until next time, happy coding and deploying! 🖤&lt;/p&gt;

</description>
      <category>devops</category>
      <category>jenkins</category>
      <category>github</category>
      <category>aws</category>
    </item>
  </channel>
</rss>
