Ai Coding Tools

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

By BTW Team3 min read

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

In short

A step-by-step guide on leveraging GitHub Copilot for rapid web app development, complete with code snippets and examples.

If you're a solo founder or indie hacker, you know that time is often your most valuable resource. The idea of building a complete web app in under two hours might sound far-fetched, but with GitHub Copilot, it’s not just a pipe dream—it’s a very achievable goal. In 2026, AI tools like Copilot have matured significantly, making them indispensable for speeding up coding tasks. Here’s how to leverage Copilot effectively to get your web app off the ground quickly.

Prerequisites: What You Need to Get Started

Before diving in, make sure you have the following:

  1. GitHub Account: You’ll need this to use Copilot.
  2. Visual Studio Code (VS Code): The primary IDE that integrates well with Copilot.
  3. Node.js installed: For backend functionality.
  4. Basic knowledge of JavaScript: Familiarity with syntax and concepts will help.
  5. Copilot Subscription: Pricing is $10/month or $100/year as of June 2026.

Step 1: Set Up Your Environment (15 minutes)

  1. Install VS Code: Download and install it from here.
  2. Install GitHub Copilot: Go to the Extensions Marketplace in VS Code, search for “GitHub Copilot,” and install it.
  3. Create a New Project: Open a new terminal and run:
    mkdir my-web-app && cd my-web-app
    npm init -y
    

Step 2: Generate Your Web App Skeleton (30 minutes)

  1. Create an index.html file: This will be the main entry point of your app.

  2. Use Copilot to scaffold HTML: Start by typing:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>My Web App</title>
    </head>
    <body>
    

    Copilot will suggest the closing tags and common elements like a header or footer.

  3. Add a Simple Form: Type a comment like <!-- Form for user input --> and let Copilot fill in the form structure.

  4. Create a script.js file: Start typing:

    function submitForm() {
        // Logic to handle form submission
    }
    

    Copilot will help fill in the remaining code.

Step 3: Implement Backend Logic (30 minutes)

  1. Set Up a Simple Express Server: Create a server.js file and type:

    const express = require('express');
    const app = express();
    const PORT = process.env.PORT || 3000;
    
    app.listen(PORT, () => {
        console.log(`Server running on http://localhost:${PORT}`);
    });
    

    Copilot will help generate the rest of the Express setup.

  2. Handle Form Submission: Add a route to handle POST requests from your HTML form. Start typing:

    app.post('/submit', (req, res) => {
        // Logic to handle data
    });
    

Step 4: Style Your Web App (25 minutes)

  1. Create a styles.css file: Start with basic styles.
  2. Use Copilot for CSS: Type a comment like /* Button styles */ and let Copilot suggest styles.

Step 5: Test Your Web App (20 minutes)

  1. Run Your Server: In the terminal, run:
    node server.js
    
  2. Open Your Browser: Navigate to http://localhost:3000 and test the form.

What Could Go Wrong

  • Dependencies Not Installed: Make sure to run npm install express if you encounter errors.
  • Missing HTML Elements: If Copilot doesn’t generate elements you need, you may have to write them manually.

What's Next: Deployment

Once your app is functional, consider deploying it using services like Vercel or Heroku. You can follow their respective documentation to get your app live.

Conclusion: Start Here

Using GitHub Copilot, building a web app in under two hours is entirely feasible. It’s not just about writing code faster; it’s about leveraging AI to fill in the gaps and streamline your workflow. Start by setting up your environment and follow the steps outlined above.

What We Actually Use

For our own projects, we use GitHub Copilot alongside tools like Vercel for deployment and Postman for API testing. This combo keeps our workflow smooth and efficient.

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