Ai Coding Tools

How to Use GitHub Copilot to Code a 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 leveraging GitHub Copilot for quickly developing a functioning web app within just two hours.

Building a web app can feel like a daunting task, especially if you're a solo founder or indie hacker. You might be staring at a blank screen, unsure of where to start, or overwhelmed by the endless lines of code. But what if I told you that you could leverage AI to speed up the process significantly? Enter GitHub Copilot, a tool that can help you code faster and more efficiently. In this guide, I'll walk you through how to use GitHub Copilot to build a simple web app in just 2 hours.

Prerequisites

Before we dive in, here’s what you’ll need:

  • GitHub Account: Sign up for free if you don’t have one.
  • Visual Studio Code (VSCode): Download and install it from the official site.
  • GitHub Copilot Subscription: As of August 2026, Copilot is priced at $10/month for individuals and $19/month for teams.
  • Basic Understanding of JavaScript and HTML: Familiarity with these languages will help you leverage Copilot effectively.

Step 1: Set Up Your Environment

  1. Install GitHub Copilot in VSCode:

    • Open VSCode.
    • Go to Extensions (Ctrl+Shift+X) and search for "GitHub Copilot."
    • Click "Install" and follow the prompts to authenticate your GitHub account.
  2. Create a New Project:

    • Open the terminal in VSCode (Ctrl+`).
    • Run mkdir my-web-app && cd my-web-app to create a new directory.
    • Initialize a new Node.js project with npm init -y.
  3. Install Necessary Packages:

    • For a simple web app, you might want to use Express. Install it using:
      npm install express
      

Step 2: Start Coding with GitHub Copilot

Now that your environment is set up, let’s start coding. Here’s how you can leverage Copilot effectively:

  1. Create an index.js File:

    • In your project folder, create a file named index.js.
    • Start typing the code for a basic Express server. For example, type const express = require('express'); and watch Copilot suggest the rest.
  2. Build the Server:

    • Type const app = express(); and then app.get('/', (req, res) => { and see how Copilot suggests the response code.
    • You might end up with something like this:
      const express = require('express');
      const app = express();
      
      app.get('/', (req, res) => {
        res.send('Hello, World!');
      });
      
      app.listen(3000, () => {
        console.log('Server is running on http://localhost:3000');
      });
      
  3. Add More Features:

    • Want to add a new route? Just start typing app.get('/about', (req, res) => { and see what Copilot suggests.
    • You can easily build out your app with various endpoints and features by simply describing what you want in comments, and Copilot will generate the code for you.

Step 3: Test Your Web App

  1. Run Your Server:

    • In the terminal, run node index.js.
    • Open your browser and navigate to http://localhost:3000 to see the "Hello, World!" message.
  2. Debugging with Copilot:

    • If you encounter any issues, you can describe the problem in comments, and Copilot can suggest potential fixes.
    • For example, if you're having trouble with routes, you might comment, // Fix route handling and see what Copilot comes up with.

Troubleshooting Common Issues

  • Copilot Not Suggesting Code: Make sure you’re connected to the internet and that your subscription is active. Sometimes, simply restarting VSCode can solve this issue.
  • Incorrect Suggestions: Always review and test the code that Copilot generates. It’s not perfect and might suggest outdated or incorrect patterns.

What’s Next?

Now that you’ve built a simple web app using GitHub Copilot, consider expanding its functionality. Add a front-end framework like React or Vue.js to enhance the user experience. You could also integrate a database like MongoDB for persistent data storage.

Pricing Breakdown

| Tool | Pricing | Best For | Limitations | Our Take | |-------------------------|-------------------------|-------------------------------------|----------------------------------------|----------------------------------------| | GitHub Copilot | $10/mo (individual) | Rapid coding assistance | Can suggest incorrect code | We use it for quick prototypes | | Visual Studio Code | Free | Code editing and debugging | Requires extensions for advanced features | Essential tool for our workflow | | Express | Free | Building server-side applications | Not suitable for large-scale apps | Perfect for lightweight web servers | | MongoDB | Free tier + $25/mo | NoSQL database for web apps | Free tier has limited capacity | Great for projects of all sizes |

Conclusion

Using GitHub Copilot can drastically reduce the time it takes to build a web app, and with just a couple of hours, you can have a functional prototype up and running. Start by setting up your environment, leveraging Copilot for coding, and testing your app.

If you're feeling stuck, remember that Copilot is a tool meant to assist you, not replace your coding skills. So, go ahead, experiment, and build something great!

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