Ai Coding Tools

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

By BTW Team3 min read

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

If you’re a solo founder or indie hacker looking to build a web app but feel overwhelmed by the coding part, you’re not alone. The barrier to entry can feel insurmountable, especially if you’re not a seasoned developer. But what if I told you that you could leverage AI to write your first web app in just two hours? Enter GitHub Copilot, the AI-powered code assistant that can help you get started quickly.

In this guide, I’ll walk you through the steps to create a simple web app using GitHub Copilot. We’ll cover prerequisites, setup, and even some troubleshooting tips. Let’s dive in!

Prerequisites: What You Need Before Starting

Before you begin, make sure you have the following:

  • GitHub Account: You can sign up for free.
  • Visual Studio Code (VS Code): Download and install it on your machine.
  • Node.js: Install the latest version, as it will help you run your web app locally.
  • GitHub Copilot Subscription: It’s $10/month after a 60-day free trial, which is a solid investment for indie hackers.

Step-by-Step Guide to Building Your Web App

Step 1: Set Up Your Environment

  1. Install VS Code Extensions: Open VS Code and install the GitHub Copilot extension.
  2. Create a New Project: In the terminal, run mkdir my-web-app && cd my-web-app && npm init -y to set up a new Node.js project.

Step 2: Create Your Basic File Structure

  1. Create the following files:
    • index.html
    • style.css
    • app.js

Step 3: Use GitHub Copilot to Generate Code

  1. HTML Setup: Open index.html and start typing a comment like <!-- Create a simple HTML structure -->. Copilot will suggest a basic HTML template. Accept the suggestion.

    Expected Output:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="style.css">
        <title>My Web App</title>
    </head>
    <body>
        <h1>Welcome to My Web App</h1>
        <script src="app.js"></script>
    </body>
    </html>
    
  2. CSS Styling: In style.css, type /* Basic styles for my web app */. Copilot will help you with styling suggestions.

  3. JavaScript Functionality: In app.js, start with // Function to display a welcome message. Copilot will generate a simple function that you can modify as needed.

Step 4: Run Your Web App

  1. Start Local Server: Run npx http-server in your terminal.
  2. Open in Browser: Navigate to http://localhost:8080 to see your app live.

Step 5: Troubleshooting Common Issues

  • Copilot Not Suggesting: Make sure you’re logged into GitHub in VS Code and that your subscription is active.
  • Syntax Errors: If you encounter errors, double-check the code generated by Copilot against JavaScript syntax.

Expected Time: 2 Hours

If you follow these steps closely, you should be able to get your first web app up and running within two hours.

What Could Go Wrong

Here are some common pitfalls:

  • Not understanding the generated code: Copilot can write code, but if you don’t understand it, you might struggle to debug. Take time to learn the basics of HTML, CSS, and JavaScript.
  • Over-reliance on Copilot: While it's a great tool, don’t forget to read documentation and learn the fundamentals.

What's Next

Once you have your basic web app running, consider adding features like user input or data storage. You could also explore deploying your app using platforms like Vercel or Netlify for free.

Conclusion: Start Here

If you’re ready to dive into web development, using GitHub Copilot is a practical way to get started. It’s not just about writing code; it’s about learning how to build something useful without getting bogged down by complexity.

What We Actually Use

In our experience, we use GitHub Copilot alongside basic HTML/CSS/JavaScript knowledge to quickly prototype ideas. It’s not a replacement for understanding the code, but it’s an excellent aid for speeding up the process.

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

Why Most Developers Overrate AI Coding Assistance: Common Myths Debunked

Why Most Developers Overrate AI Coding Assistance: Common Myths Debunked As a developer, you’ve probably heard the hype around AI coding tools. They promise to turn you into a supe

Feb 11, 20264 min read
Ai Coding Tools

How to Integrate AI Coding Tools in Your Workflow in 1 Hour

How to Integrate AI Coding Tools in Your Workflow in 1 Hour In 2026, AI coding tools have become essential for indie hackers, solo founders, and side project builders looking to bo

Feb 11, 20265 min read
Ai Coding Tools

How to Build a Simple Web App with AI Coding Tools in Just 2 Hours

How to Build a Simple Web App with AI Coding Tools in Just 2 Hours Building a web app can feel like a daunting task, especially if you’re not a seasoned developer. But what if I to

Feb 11, 20264 min read
Ai Coding Tools

5 AI Coding Tools That Boost Solo Developer Productivity in 2026

5 AI Coding Tools That Boost Solo Developer Productivity in 2026 As a solo developer, you often juggle multiple roles: coder, designer, marketer, and sometimes even customer suppor

Feb 11, 20264 min read
Ai Coding Tools

How to Build a Simple API with Bolt.new in Under 1 Hour

How to Build a Simple API with Bolt.new in Under 1 Hour Building APIs can often feel overwhelming, especially for indie hackers and solo founders who are juggling multiple projects

Feb 11, 20263 min read
Ai Coding Tools

Cursor vs. GitHub Copilot: Which AI Tool is the Better Coding Companion?

Cursor vs. GitHub Copilot: Which AI Tool is the Better Coding Companion? As a solo founder or indie hacker, finding the right coding companion can feel like searching for a needle

Feb 11, 20263 min read