Ai Coding Tools

How to Build a Simple Web App Using GitHub Copilot in Just 2 Hours

By BTW Team4 min read

How to Build a Simple Web App Using GitHub Copilot in Just 2 Hours

If you've ever felt overwhelmed at the thought of building a web app from scratch, you're not alone. Many indie hackers and solo founders struggle with coding, especially if they don't have a background in software development. But what if I told you that you could leverage AI to accelerate your coding process significantly? In this guide, we'll walk through building a simple web app using GitHub Copilot in just 2 hours. Yes, you read that right!

Prerequisites: What You Need Before You Start

Before diving into the development process, make sure you have the following:

  1. GitHub Account: You’ll need a GitHub account to use Copilot. Sign up for free if you don’t have one.
  2. Visual Studio Code (VS Code): Download and install VS Code, which is where we’ll be writing our code.
  3. GitHub Copilot Subscription: Copilot costs $10/month or $100/year. There’s a free trial available, so you can test it out.
  4. Basic HTML/CSS/JavaScript Knowledge: Familiarity with these languages will help you understand what you're building.

Step 1: Setting Up Your Environment

Time: 15 minutes

  1. Install Visual Studio Code: Go to the VS Code website and download the latest version for your OS.
  2. Install GitHub Copilot: Open VS Code, go to Extensions (Ctrl+Shift+X), and search for "GitHub Copilot." Click Install.
  3. Create a New Project Folder: Name it something like "MyWebApp".

Step 2: Initialize Your Project

Time: 10 minutes

  1. Open your project folder in VS Code.
  2. Create your main files: Inside your project folder, create index.html, style.css, and app.js.

Expected output: Your project structure should look like this:

MyWebApp/
├── index.html
├── style.css
└── app.js

Step 3: Using GitHub Copilot to Write Code

Time: 1 hour

  1. Open index.html and start typing: Begin with a basic HTML structure. As you type, GitHub Copilot will suggest completions.
    • For example, type <!DOCTYPE html> and see what suggestions come up.
  2. Add a basic layout: Use Copilot to create a header and a simple form. You can type comments like <!-- Create a header --> and let Copilot generate the HTML for you.
  3. Style with CSS: Open style.css and type in some basic styles. Copilot can help you with common CSS properties.
  4. Implement functionality in app.js: Add simple JavaScript functions. For example, if you type function submitForm(), Copilot will suggest a complete function based on your input.

Example Code Snippet

<!-- index.html -->
<!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>
    <header>
        <h1>Welcome to My Web App</h1>
    </header>
    <form onsubmit="submitForm(); return false;">
        <input type="text" placeholder="Enter something..." required>
        <button type="submit">Submit</button>
    </form>
    <script src="app.js"></script>
</body>
</html>

Step 4: Testing Your Web App

Time: 20 minutes

  1. Open your index.html in a browser: Right-click on the file in VS Code and select "Open with Live Server" (you may need to install the Live Server extension).
  2. Test functionality: Ensure that your form submits correctly and any JavaScript functionality works as expected.

Troubleshooting: What Could Go Wrong

  • Copilot is not suggesting anything: Ensure you're logged into GitHub in VS Code.
  • Errors in JavaScript: Use the console in your browser's developer tools to debug any issues.

What’s Next: Expanding Your Web App

Once you've built your basic web app, consider adding more features like user authentication, database integration, or deploying your app to a platform like Vercel or Netlify.

Conclusion: Start Here

Building a web app doesn't have to be daunting. With GitHub Copilot, you can significantly speed up your development process. Start with the basics, leverage AI to write your code, and don't forget to iterate on your project as you learn!

What We Actually Use

We rely on GitHub Copilot for rapid prototyping and coding assistance. However, we also recommend checking out alternatives like Tabnine or Codeium if you're looking for different AI coding experiences.

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 Implement AI-Powered Code Reviews in Under 30 Minutes

How to Implement AIPowered Code Reviews in Under 30 Minutes As a developer, you know the pain of code reviews. They can be timeconsuming, subjective, and sometimes lead to more fru

Apr 5, 20264 min read
Ai Coding Tools

AI Coding Tools: GitHub Copilot vs. Codeium – Which One Fits Your Workflow?

AI Coding Tools: GitHub Copilot vs. Codeium – Which One Fits Your Workflow? As a solo founder or indie hacker, you know that every minute counts. Whether you’re writing code for yo

Apr 5, 20263 min read
Ai Coding Tools

AI Coding Tools: Bolt.new vs GitHub Copilot - Which is Better for 2026?

AI Coding Tools: Bolt.new vs GitHub Copilot Which is Better for 2026? As we dive into 2026, it's clear that AI coding tools have become essential for indie hackers and solo founde

Apr 5, 20263 min read
Ai Coding Tools

How to Enhance Your Coding Workflow with AI in 30 Minutes

How to Enhance Your Coding Workflow with AI in 30 Minutes As a solo founder or indie hacker, you know that coding can be both exhilarating and exhausting. You want to ship products

Apr 5, 20264 min read
Ai Coding Tools

5 AI Coding Tools for Beginners: Where to Start in 2026

5 AI Coding Tools for Beginners: Where to Start in 2026 If you're a beginner in coding, the landscape can feel overwhelming. With so many tools out there, it's tough to know where

Apr 5, 20264 min read
Ai Coding Tools

How to Build a Simple Portfolio Website Using AI Coding Tools in 2 Hours

How to Build a Simple Portfolio Website Using AI Coding Tools in 2026 Building a portfolio website can seem daunting, especially if you're not a developer. But what if I told you t

Apr 5, 20264 min read