Ai Coding Tools

How to Use GitHub Copilot to Write a Simple Web App in 2 Hours

By BTW Team3 min read

How to Use GitHub Copilot to Write a Simple Web App in 2026

If you're a solo founder or indie hacker, chances are you've encountered the daunting task of building a web app from scratch. The coding part can feel like a mountain to climb, especially if you're short on time or experience. Enter GitHub Copilot: an AI-powered coding assistant that can help you write a simple web app in about two hours. Sounds too good to be true? Let’s break down how to leverage this tool effectively.

Time Estimate and Prerequisites

Time: You can finish this in about 2 hours if you follow along closely.
Prerequisites:

  • A GitHub account (Free tier available)
  • Visual Studio Code (VS Code) installed
  • GitHub Copilot subscription (Free trial available, then $10/month)
  • Basic understanding of JavaScript and HTML

Step 1: Set Up Your Environment

  1. Install Visual Studio Code: Download and install VS Code.
  2. Install GitHub Copilot: Open VS Code, go to Extensions, and search for "GitHub Copilot". Click install.
  3. Sign In: Sign in with your GitHub account and activate your Copilot subscription.

Expected Output

At this stage, you should see the GitHub Copilot logo in the bottom right corner of VS Code, indicating that it's ready to assist you.

Step 2: Create Your Project Structure

  1. Create a New Folder: Name it simple-web-app.
  2. Open the Folder in VS Code: Click File > Open Folder.
  3. Create HTML and JavaScript Files: Inside your folder, create two files: index.html and app.js.

Expected Output

You should have a folder structure that looks like this:

simple-web-app/
├── index.html
└── app.js

Step 3: Write Your HTML

In index.html, start typing the basic HTML structure. GitHub Copilot will suggest code snippets as you type.

  1. Type <!DOCTYPE html> and press Enter.
  2. Start typing <html> and then hit Enter. Copilot will suggest a complete HTML boilerplate. Accept the suggestion.

Expected Output

The index.html should now contain a basic HTML structure with a title and linked app.js.

Step 4: Write Your JavaScript

Switch to app.js and start coding the functionality. For example, if you want to create a simple button click event:

  1. Type function and press Enter. Copilot will suggest a function. Accept the suggestion.
  2. Type document.getElementById('myButton').addEventListener('click', function() { and let Copilot fill in the rest.

Expected Output

Your app.js should have a function that listens for a button click and performs an action, like displaying an alert.

Step 5: Testing Your App

  1. Open index.html in your browser.
  2. Click the button you created. If everything is set up correctly, you should see an alert.

Troubleshooting

  • If the alert doesn’t show: Check your JavaScript console for errors. Common issues include incorrect element IDs or syntax errors.
  • If Copilot isn’t suggesting any code: Make sure you’re online and that the extension is properly installed.

What's Next?

Once you've completed your simple web app, consider exploring more features such as adding styles with CSS or integrating a backend service. You can also iterate on this project by adding more functionalities.

Conclusion: Start Here

If you're looking to build a simple web app quickly, GitHub Copilot can be a significant asset. It reduces the friction of coding by providing real-time suggestions based on what you’re writing. Remember, it's not perfect, and you'll still need to understand the code it generates, but it can save you a lot of time.

Our Recommendation: Start with a small project and let Copilot guide you. As you become more comfortable, you can tackle more complex applications.

Follow Our Building Journey

Weekly podcast episodes on tools we're testing, products we're shipping, and lessons from building in public.

Subscribe

Never miss an episode

Subscribe to Built This Week for weekly insights on AI tools, product building, and startup lessons from Ryz Labs.

Subscribe
Ai Coding Tools

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time As a developer, whether you're just starting out or have years of experience, debugging can feel like a neverend

Oct 16, 20265 min read
Ai Coding Tools

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow As developers, we’re always on the lookout for ways to streamline our workflow and boost productivity. Enter

Oct 14, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools That Could Hurt Your Development Process

5 Myths About AI Coding Tools That Could Hurt Your Development Process As a solo founder or indie hacker, you might be lured by the promises of AI coding tools that claim to simpli

Oct 13, 20264 min read
Ai Coding Tools

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026 As AI coding tools have become an integral part of a developer's toolkit in 2026, many are still stumbling over

Oct 12, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026 As we dive into 2026, the landscape of AI coding tools has evolved significantly, yet many developers still

Oct 11, 20263 min read
Ai Coding Tools

Why AI Coding Assistants Are Overrated for Beginners in 2026

Why AI Coding Assistants Are Overrated for Beginners in 2026 As a solo founder or indie hacker, it’s tempting to think that AI coding assistants are the silver bullet to jumpstart

Oct 10, 20263 min read