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

Comparing AI Coding Assistants: Cursor vs Codeium in 2026

Comparing AI Coding Assistants: Cursor vs Codeium in 2026 As we dive into 2026, the landscape of AI coding assistants has evolved significantly. If you're a solo founder or indie h

Aug 12, 20263 min read
Ai Coding Tools

How to Use GitHub Copilot to Write Code Faster: A 30-Minute Guide

How to Use GitHub Copilot to Write Code Faster: A 30Minute Guide If you’re a solo founder or indie hacker, you know how precious time is. Writing code can be a slow and tedious pro

Aug 12, 20263 min read
Ai Coding Tools

How to Use GitHub Copilot for Full-Stack Development in 2 Hours

How to Use GitHub Copilot for FullStack Development in 2026 If you’re a solo founder or indie hacker, you know the pressure of building fullstack applications quickly and efficient

Aug 12, 20264 min read
Ai Coding Tools

Is AI Coding Overrated? Debunking 5 Myths in 2026

Is AI Coding Overrated? Debunking 5 Myths in 2026 As a solo founder navigating the tumultuous waters of product development, I often hear the buzz around AI coding tools. "They'll

Aug 12, 20264 min read
Ai Coding Tools

How to Boost Your Coding Speed with AI: 5 Tools That Work

How to Boost Your Coding Speed with AI: 5 Tools That Work As a solo founder or indie hacker, you probably know the struggle of getting bogged down in coding tasks that take way lon

Aug 12, 20264 min read
Ai Coding Tools

Cowideed vs. Cursor: Which AI Tool Enhances Code Quality More?

Cowideed vs. Cursor: Which AI Tool Enhances Code Quality More? (2026) As indie hackers and solo founders, we constantly seek tools that genuinely improve our workflow without break

Aug 12, 20263 min read