Ai Coding Tools

How to Use GitHub Copilot to Code a Web App in 2 Hours

By BTW Team4 min read

How to Use GitHub Copilot to Code a Web App in 2 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!

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

How to Automate Your Development Workflow with AI in 3 Easy Steps

How to Automate Your Development Workflow with AI in 3 Easy Steps (2026) As indie hackers and solo founders, we often find ourselves buried under a mountain of repetitive tasks tha

Sep 3, 20264 min read
Ai Coding Tools

How to Boost Your Coding Velocity with AI in 30 Minutes

How to Boost Your Coding Velocity with AI in 30 Minutes As a solo founder or indie hacker, you know that time is your most precious resource. The idea of boosting your coding veloc

Sep 3, 20264 min read
Ai Coding Tools

Why Most Developers Get GitHub Copilot Wrong: 5 Myths Busted

Why Most Developers Get GitHub Copilot Wrong: 5 Myths Busted As we dive into 2026, GitHub Copilot has become a staple in many developers' toolkits. However, despite its popularity,

Sep 3, 20263 min read
Ai Coding Tools

How to Use AI Coding Tools to Boost Productivity in Under 2 Hours

How to Use AI Coding Tools to Boost Productivity in Under 2 Hours As indie hackers, we all know the struggle of trying to stay productive while juggling multiple projects. The prom

Sep 3, 20265 min read
Ai Coding Tools

Vercel vs GitHub Copilot: Which AI Tool is Right for Your Project?

Vercel vs GitHub Copilot: Which AI Tool is Right for Your Project? As a solo founder or indie hacker, choosing the right tools can be a makeorbreak decision for your project. With

Sep 3, 20263 min read
Ai Coding Tools

Why GitHub Copilot is Not the Magic Bullet for Every Programmer: Debunking the Myths

Why GitHub Copilot is Not the Magic Bullet for Every Programmer: Debunking the Myths As a programmer, I’ve been there: staring at a blank screen, hoping for a burst of inspiration

Sep 3, 20264 min read