Ai Coding Tools

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

By BTW Team4 min read

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

Building a web app can feel daunting, especially if you're just starting out. But what if I told you that you could leverage AI to speed up the process significantly? In this guide, I'll show you how to build a simple web app using GitHub Copilot in just 2 hours. Yes, you read that right! Let's dive into the practical steps without the fluff.

Prerequisites

Before we start, make sure you have the following:

  • GitHub Account: Free to sign up and essential for version control.
  • Visual Studio Code (VS Code): A lightweight code editor.
  • GitHub Copilot: You can get it for $10/month after a 30-day free trial.
  • Basic JavaScript Knowledge: Familiarity with HTML, CSS, and JavaScript will help, but don’t worry if you’re a complete beginner.

Step 1: Set Up Your Environment (30 min)

  1. Install Visual Studio Code: Download and install VS Code from the official site.
  2. Install GitHub Copilot:
    • Open VS Code.
    • Go to Extensions (Ctrl+Shift+X).
    • Search for "GitHub Copilot" and install it.
    • Sign in with your GitHub account.
  3. Create a New Project Folder:
    • Create a new directory for your project. For example, my-web-app.
    • Open this folder in VS Code.

Step 2: Initialize Your Project (20 min)

  1. Create HTML File:
    • Create a file named index.html.
    • Use GitHub Copilot to generate a basic HTML template. Just type <!DOCTYPE html> and let Copilot suggest the rest.
  2. Create CSS File:
    • Create a styles.css file.
    • Ask Copilot to generate some basic CSS, like a simple layout or color scheme.
  3. Create JavaScript File:
    • Create a script.js file.
    • You can use Copilot to generate basic functionality, like fetching data or handling user input.

Step 3: Build the Web App (40 min)

Now comes the fun part! Let’s build a simple to-do list app.

  1. HTML Structure:

    • In index.html, create a simple form for adding tasks and a list to display them. Use Copilot to generate the form elements.
    <body>
        <h1>My To-Do List</h1>
        <form id="taskForm">
            <input type="text" id="taskInput" placeholder="Add a new task...">
            <button type="submit">Add</button>
        </form>
        <ul id="taskList"></ul>
    </body>
    
  2. JavaScript Functionality:

    • In script.js, write a function to handle form submission and add tasks to the list. Start typing comments, and let Copilot fill in the code.
    document.getElementById('taskForm').addEventListener('submit', function (e) {
        e.preventDefault();
        const task = document.getElementById('taskInput').value;
        // Add task to list
    });
    
  3. Style Your App:

    • Use Copilot to generate CSS rules that improve the look of your app, like margins, padding, and colors.

Step 4: Test Your App (20 min)

  1. Open in Browser: Open index.html in your browser to see your app in action.
  2. Debugging: If something doesn’t work, use the Developer Tools (F12) to debug. You can ask Copilot for help by typing comments about what you need.

Troubleshooting

  • Common Issues: If tasks aren’t appearing, check your JavaScript console for errors. Copilot can help you debug by suggesting fixes.
  • Styling Not Applying: Ensure you link your CSS file correctly in index.html.

What's Next?

Once you have your basic web app running, consider these next steps:

  • Add Features: Implement local storage to save tasks even when the page refreshes.
  • Deploy Your App: Use free services like GitHub Pages or Vercel to share your app with others.
  • Learn More: Explore more advanced topics like APIs or frameworks like React.

Conclusion

Building a simple web app using GitHub Copilot can be done in just 2 hours. Start with a basic structure, let Copilot do the heavy lifting, and focus on refining your ideas. Remember, the key is to keep iterating and learning.

Start here: Sign up for GitHub Copilot and follow the steps outlined above. You’ll be surprised at what you can create in just a couple of hours!

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 GitHub Copilot is Overrated: Contrarian Perspectives on AI Coding Assistants

Why GitHub Copilot is Overrated: Contrarian Perspectives on AI Coding Assistants As a solo founder or indie hacker, you’re always on the lookout for tools that genuinely boost your

Mar 16, 20264 min read
Ai Coding Tools

How to Build Your First App Using AI Tools in Under 3 Hours

How to Build Your First App Using AI Tools in Under 3 Hours If you're a solo founder or an indie hacker, the thought of building an app might seem daunting. But what if I told you

Mar 16, 20265 min read
Ai Coding Tools

Top 5 AI Tools for Beginners in 2026: Your Launchpad

Top 5 AI Tools for Beginners in 2026: Your Launchpad As a beginner diving into the world of coding in 2026, the landscape is flooded with AI tools promising to make your journey sm

Mar 16, 20264 min read
Ai Coding Tools

Supabase vs Firebase for AI-Driven Projects: A 2026 Comparison

Supabase vs Firebase for AIDriven Projects: A 2026 Comparison As we dive into 2026, the landscape for building AIdriven applications has evolved significantly. If you're an indie h

Mar 16, 20264 min read
Ai Coding Tools

How to Build a Simple App with GitHub Copilot in 2 Hours

How to Build a Simple App with GitHub Copilot in 2026 Building an app can feel like a daunting task, especially if you’re a beginner. You might be asking yourself if you have the r

Mar 16, 20264 min read
Ai Coding Tools

How to Write Code 3x Faster Using AI in Just 30 Minutes

How to Write Code 3x Faster Using AI in Just 30 Minutes As a solo founder or indie hacker, you're probably familiar with the struggle of balancing coding with everything else on yo

Mar 16, 20265 min read