Ai Coding Tools

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

By BTW Team3 min read

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

If you're a solo founder or indie hacker, you know that time is your most precious resource. The idea of building a web app can feel daunting, especially if you're not a seasoned developer. But what if I told you that with GitHub Copilot, you can whip up a simple web app in under two hours? Sounds too good to be true? Let's break it down.

Prerequisites: What You Need Before Starting

Before diving in, make sure you have the following:

  • GitHub Account: You'll need this to access Copilot.
  • Visual Studio Code (VS Code): This is where you'll write your code.
  • GitHub Copilot Subscription: Costs $10/month after a 60-day free trial.
  • Basic Understanding of JavaScript/HTML/CSS: You don’t need to be an expert, but familiarity is beneficial.

Step-by-Step Guide to Building Your Web App

You can complete this project in about 2 hours, assuming you have all your tools set up. Here's how to get started:

1. Set Up Your Development Environment

  • Install VS Code: Download and install Visual Studio Code from here.
  • Install GitHub Copilot: Go to the extensions marketplace in VS Code and search for "GitHub Copilot." Install and authenticate with your GitHub account.

2. Create Your Project Structure

Open VS Code and create a new folder for your project. Inside this folder, create the following files:

  • index.html
  • style.css
  • app.js

3. Get GitHub Copilot to Help You Code

Now, let's start coding. In your index.html, begin typing the basic structure:

<!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>Simple Web App</title>
</head>
<body>
    <h1>Hello, World!</h1>
    <script src="app.js"></script>
</body>
</html>

As you type, Copilot will suggest completions. Accept them by pressing Tab.

4. Style Your Web App

Open style.css and start adding some basic styles. You can ask Copilot for suggestions like so:

body {
    background-color: #f0f0f0;
    font-family: Arial, sans-serif;
}

5. Implement Functionality with JavaScript

In app.js, you can implement a simple feature. For instance, let’s add a button that changes the text when clicked:

const button = document.createElement('button');
button.innerText = 'Click me!';
document.body.appendChild(button);

button.addEventListener('click', () => {
    document.querySelector('h1').innerText = 'You clicked the button!';
});

6. Run Your Web App

In VS Code, you can use the Live Server extension to run your app locally. Install it from the extensions marketplace, then right-click on index.html and select "Open with Live Server." Your app should now be live!

7. Troubleshooting Common Issues

  • Copilot Not Suggesting Code?: Ensure you have an active subscription and that the extension is enabled.
  • Errors in Code?: Review the suggestions carefully and make adjustments. Remember, Copilot is a tool, not a replacement for understanding.

What Could Go Wrong

Even with Copilot, things might not work as expected. Here are some common pitfalls:

  • Syntax Errors: Copilot’s suggestions might not always be perfect, so double-check your code.
  • Performance Issues: Simple web apps can become slow if too many features are added without optimization.

What's Next?

Once you've built your basic web app, consider expanding it with more features like:

  • User authentication
  • A database connection (consider Firebase for a simple setup)
  • Deploying your app using platforms like Vercel or Netlify for free.

Conclusion: Start Here

Using GitHub Copilot can significantly speed up your development process. If you follow the steps above, you should be able to create a simple web app in under two hours. Just remember to keep learning and experimenting.

What We Actually Use: For our projects, we rely heavily on GitHub Copilot for initial coding, but we always review and refine the code to ensure quality.

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

5 Mistakes When Using AI Coding Tools That Slow You Down

5 Mistakes When Using AI Coding Tools That Slow You Down As we dive into 2026, AI coding tools have become nearly indispensable for developers. However, many of us still make criti

Jul 27, 20264 min read
Ai Coding Tools

How to Use GitHub Copilot to Boost Productivity by 50% in 30 Days

How to Use GitHub Copilot to Boost Productivity by 50% in 30 Days If you're a solo founder or indie hacker, you know the struggle of juggling multiple roles. Writing code, debuggin

Jul 27, 20264 min read
Ai Coding Tools

Best AI Coding Tools for Senior Developers in 2026

Best AI Coding Tools for Senior Developers in 2026 As a senior developer, you know that coding is only part of the job. With increasing complexity and the demand for higher code qu

Jul 27, 20264 min read
Ai Coding Tools

Comparing Cursor vs GitHub Copilot: Which AI Tool Enhances Coding Efficiency More?

Comparing Cursor vs GitHub Copilot: Which AI Tool Enhances Coding Efficiency More? (2026) As a founder or indie hacker, you know the pressure of shipping code quickly and efficient

Jul 27, 20263 min read
Ai Coding Tools

How to Build a Complete Application in 4 Hours Using AI Tools

How to Build a Complete Application in 4 Hours Using AI Tools As indie hackers, we often face the daunting task of building applications quickly and efficiently. What if I told you

Jul 27, 20264 min read
Ai Coding Tools

How to Build a Basic Web App in 60 Minutes Using AI Tools

How to Build a Basic Web App in 60 Minutes Using AI Tools Building a web app can feel like a daunting task, especially if you're a solo founder or indie hacker with limited time an

Jul 27, 20264 min read