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

AI Coding Assistants: GitHub Copilot vs Cursor – Which Is Best for You?

AI Coding Assistants: GitHub Copilot vs Cursor – Which Is Best for You? As a solo founder or indie hacker, you're likely looking for ways to streamline your coding process. Enter A

Aug 13, 20264 min read
Ai Coding Tools

How to Optimize Your Coding Workflow with AI in 45 Minutes

How to Optimize Your Coding Workflow with AI in 45 Minutes As a solo founder or indie hacker, you know that every minute counts. If you’re still coding without leveraging AI, you’r

Aug 13, 20264 min read
Ai Coding Tools

Why AI Coding Tools Are Overrated for Junior Developers

Why AI Coding Tools Are Overrated for Junior Developers As a junior developer, the allure of AI coding tools can be strong. The promise of instant code generation, bug fixes, and l

Aug 12, 20264 min read
Ai Coding Tools

Best AI Coding Tools for Beginners: 5 Essentials for 2026

Best AI Coding Tools for Beginners: 5 Essentials for 2026 If you’re just starting your coding journey in 2026, you’re likely overwhelmed by the sheer number of tools available. The

Aug 12, 20264 min read
Ai Coding Tools

Why GitHub Copilot Is Overrated: A Closer Look at AI Coding Assistants

Why GitHub Copilot Is Overrated: A Closer Look at AI Coding Assistants In 2026, the buzz around AI coding assistants like GitHub Copilot has reached a fever pitch, but is it really

Aug 12, 20264 min read
Ai Coding Tools

How to Build Your First AI Project in 2 Hours Using Free Tools

How to Build Your First AI Project in 2 Hours Using Free Tools If you're an indie hacker or a side project builder, the idea of diving into AI might feel daunting. It seems like yo

Aug 12, 20264 min read