Ai Coding Tools

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

By BTW Team4 min read

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

Building your first web app can feel like climbing a mountain, especially if you’re new to coding. But with tools like GitHub Copilot, you can significantly shorten the learning curve. In this guide, I’ll walk you through using GitHub Copilot to get your first web app up and running in about two hours.

Prerequisites

Before we dive in, here’s what you need to have ready:

  • A GitHub account: Free to sign up.
  • Visual Studio Code (VS Code): Download it from here.
  • GitHub Copilot subscription: $10/month after a free trial, or $100/year.
  • Basic understanding of JavaScript and HTML: If you’re totally new, check out some beginner tutorials first.

Step 1: Set Up Your Environment

  1. Install Visual Studio Code: Once downloaded, open it up.
  2. Install GitHub Copilot: In VS Code, go to Extensions (Ctrl+Shift+X) and search for "GitHub Copilot". Click "Install".

Expected Output: You should see the Copilot icon in the bottom right of your VS Code window.

Step 2: Create Your Project

  1. Open a new terminal in VS Code (Ctrl + `).

  2. Create a new folder for your project:

    mkdir my-first-web-app
    cd my-first-web-app
    
  3. Create the necessary files:

    touch index.html app.js style.css
    

With these commands, you’ll have three files ready to go.

Step 3: Start Coding with Copilot

Using Copilot to Generate Code

  1. Open index.html and start typing:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>My First Web App</title>
        <link rel="stylesheet" href="style.css">
    </head>
    <body>
        <h1>Welcome to My First Web App</h1>
    </body>
    </html>
    
  2. In app.js, start typing a function:

    function greetUser(name) {
        return `Hello, ${name}!`;
    }
    

    Copilot will suggest completions. Accept the suggestions that make sense.

What to Expect

  • Output: You’ll have a basic HTML structure and a JavaScript function within minutes.
  • Limitations: Copilot may not always provide the most efficient or correct code. Always review and test what it suggests.

Step 4: Style Your App

  1. In style.css, add some basic styles:

    body {
        font-family: Arial, sans-serif;
        background-color: #f4f4f4;
        text-align: center;
    }
    
    h1 {
        color: #333;
    }
    
  2. Test the Styles: Open index.html in your browser to see the changes.

Step 5: Test and Deploy Your App

  1. Testing: Ensure everything works as expected. You can use your browser’s developer tools to debug.
  2. Deployment: Use GitHub Pages to deploy your app for free:
    • Push your code to a GitHub repository.
    • Go to the repository settings and enable GitHub Pages.

Troubleshooting

  • Common Issues: If Copilot isn’t suggesting code, ensure you’re connected to the internet and that the extension is enabled.
  • Debugging: Use console logs in your JavaScript to identify issues.

What’s Next?

Once your first web app is live, consider adding features like user input or connecting to an API. You could also explore other tools that enhance your coding experience, like:

  • Postman for API testing: Free tier available.
  • Netlify for easy deployment: Free for personal projects.

Tool Comparison

| Tool | Pricing | Best For | Limitations | Our Take | |----------------|------------------------|-------------------------|-------------|------------------------------------| | GitHub Copilot | $10/mo, $100/yr | Code suggestions | May suggest inefficient code | Essential for speeding up coding | | Postman | Free tier + $12/mo pro| API testing | Can be complex for newbies | Great for testing APIs | | Netlify | Free tier + $19/mo pro| Deployment | Limited bandwidth on free tier | Easy to use for deploying static sites |

Conclusion: Start Here

If you’re ready to build your first web app, start by signing up for GitHub Copilot and following the steps above. With just a couple of hours, you’ll have a functional web app and a better understanding of how to use AI to code.

Want to see how we’re building in public? Check out our journey on the Built This Week podcast, where we share tools and lessons from our projects.

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