Ai Coding Tools

How to Use GitHub Copilot to Code Your First Web App in 2 Hours

By BTW Team4 min read

Comparing tools? See the AI tools tested on the show.

In short

A step-by-step tutorial on using GitHub Copilot to successfully code and deploy a simple web application within just two hours.

Building your first web app can feel like climbing a mountain, especially if you’re new to coding. But with tools like GitHub Copilot, you can significantly shorten the learning curve. In this guide, I’ll walk you through using GitHub Copilot to get your first web app up and running in about two hours.

Prerequisites

Before we dive in, here’s what you need to have ready:

  • A GitHub account: Free to sign up.
  • Visual Studio Code (VS Code): Download it from here.
  • GitHub Copilot subscription: $10/month after a free trial, or $100/year.
  • Basic understanding of JavaScript and HTML: If you’re totally new, check out some beginner tutorials first.

Step 1: Set Up Your Environment

  1. Install Visual Studio Code: Once downloaded, open it up.
  2. Install GitHub Copilot: In VS Code, go to Extensions (Ctrl+Shift+X) and search for "GitHub Copilot". Click "Install".

Expected Output: You should see the Copilot icon in the bottom right of your VS Code window.

Step 2: Create Your Project

  1. Open a new terminal in VS Code (Ctrl + `).

  2. Create a new folder for your project:

    mkdir my-first-web-app
    cd my-first-web-app
    
  3. Create the necessary files:

    touch index.html app.js style.css
    

With these commands, you’ll have three files ready to go.

Step 3: Start Coding with Copilot

Using Copilot to Generate Code

  1. Open index.html and start typing:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>My First Web App</title>
        <link rel="stylesheet" href="style.css">
    </head>
    <body>
        <h1>Welcome to My First Web App</h1>
    </body>
    </html>
    
  2. In app.js, start typing a function:

    function greetUser(name) {
        return `Hello, ${name}!`;
    }
    

    Copilot will suggest completions. Accept the suggestions that make sense.

What to Expect

  • Output: You’ll have a basic HTML structure and a JavaScript function within minutes.
  • Limitations: Copilot may not always provide the most efficient or correct code. Always review and test what it suggests.

Step 4: Style Your App

  1. In style.css, add some basic styles:

    body {
        font-family: Arial, sans-serif;
        background-color: #f4f4f4;
        text-align: center;
    }
    
    h1 {
        color: #333;
    }
    
  2. Test the Styles: Open index.html in your browser to see the changes.

Step 5: Test and Deploy Your App

  1. Testing: Ensure everything works as expected. You can use your browser’s developer tools to debug.
  2. Deployment: Use GitHub Pages to deploy your app for free:
    • Push your code to a GitHub repository.
    • Go to the repository settings and enable GitHub Pages.

Troubleshooting

  • Common Issues: If Copilot isn’t suggesting code, ensure you’re connected to the internet and that the extension is enabled.
  • Debugging: Use console logs in your JavaScript to identify issues.

What’s Next?

Once your first web app is live, consider adding features like user input or connecting to an API. You could also explore other tools that enhance your coding experience, like:

  • Postman for API testing: Free tier available.
  • Netlify for easy deployment: Free for personal projects.

Tool Comparison

| Tool | Pricing | Best For | Limitations | Our Take | |----------------|------------------------|-------------------------|-------------|------------------------------------| | GitHub Copilot | $10/mo, $100/yr | Code suggestions | May suggest inefficient code | Essential for speeding up coding | | Postman | Free tier + $12/mo pro| API testing | Can be complex for newbies | Great for testing APIs | | Netlify | Free tier + $19/mo pro| Deployment | Limited bandwidth on free tier | Easy to use for deploying static sites |

Conclusion: Start Here

If you’re ready to build your first web app, start by signing up for GitHub Copilot and following the steps above. With just a couple of hours, you’ll have a functional web app and a better understanding of how to use AI to code.

Want to see how we’re building in public? Check out our journey on the Built This Week podcast, where we share tools and lessons from our projects.

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools
Ai Coding Tools

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them)

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them) In the everevolving landscape of AI coding tools, it's easy to get swept up in the hype. As indie hackers and s

Nov 30, 20263 min read
Ai Coding Tools

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026 In 2026, the landscape for indie hackers and solo founders has evolved significantly, especially with the advent

Nov 26, 20264 min read
Ai Coding Tools

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026 If you’re a developer stuck maintaining legacy code, you know the frustration. It’s like navigating a maze blindfolde

Nov 23, 20264 min read
Ai Coding Tools

10 AI Coding Tools That Will Save You Hours of Debugging in 2026

10 AI Coding Tools That Will Save You Hours of Debugging in 2026 Debugging can feel like a neverending cycle of frustration. Whether you're a solo founder or an indie hacker, spend

Nov 18, 20265 min read
Ai Coding Tools

10 Common Mistakes When Using AI Coding Tools for MVP Development

10 Common Mistakes When Using AI Coding Tools for MVP Development As a founder in 2026, you’re likely aware that AI coding tools can significantly speed up the MVP development proc

Nov 16, 20264 min read
Ai Coding Tools

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026 As a beginner developer, you’ve probably come across a ton of buzz surrounding AI coding tools. But with all the hyp

Nov 12, 20263 min read