Ai Coding Tools

How to Use GitHub Copilot to Code a Full Web App in 2 Hours

By BTW Team4 min read

How to Use GitHub Copilot to Code a Full Web App in 2 Hours

If you're like many indie hackers and solo founders, you probably feel overwhelmed by the amount of coding required to build a web app. You want to ship quickly, but the learning curve can be steep. Enter GitHub Copilot, a powerful AI tool that can help you write code faster and more efficiently. In this guide, I'll walk you through how to leverage GitHub Copilot to build a full web app in just 2 hours.

Prerequisites

Before diving in, you'll need a few things set up:

  1. GitHub Account: You'll need this to use Copilot.
  2. Visual Studio Code (VS Code): This is the code editor where you'll be writing your app.
  3. GitHub Copilot Subscription: Copilot costs $10/month (as of May 2026) for individual users.
  4. Basic Knowledge of JavaScript/HTML/CSS: While Copilot can help you with suggestions, understanding the basics will help you guide it.

What We’re Building

For this tutorial, we’ll create a simple task manager web app that allows users to add, view, and delete tasks. The expected output is a fully functional web app with a backend using Node.js and a frontend using HTML and JavaScript.

Step-by-Step Guide

Step 1: Set Up Your Project

  1. Create a new directory for your app:

    mkdir task-manager
    cd task-manager
    
  2. Initialize a new Node.js project:

    npm init -y
    
  3. Install Express:

    npm install express
    

Step 2: Create the Basic Server

  1. Create a file named server.js and let Copilot help you set up a basic server:

    const express = require('express');
    const app = express();
    const PORT = 3000;
    
    app.use(express.json());
    app.get('/', (req, res) => {
        res.send('Hello World!');
    });
    
    app.listen(PORT, () => {
        console.log(`Server is running on http://localhost:${PORT}`);
    });
    
  2. Ask Copilot for help: As you type, Copilot will suggest code. If it suggests a correct function, just hit "Tab" to accept.

Step 3: Add Task Management Functionality

  1. Create a simple in-memory array to store tasks. Ask Copilot to help you:
    let tasks = [];
    
    app.post('/tasks', (req, res) => {
        const task = req.body.task;
        tasks.push(task);
        res.status(201).send({ task });
    });
    
    app.get('/tasks', (req, res) => {
        res.send(tasks);
    });
    
    app.delete('/tasks/:index', (req, res) => {
        const index = req.params.index;
        tasks.splice(index, 1);
        res.send({ message: 'Task deleted' });
    });
    

Step 4: Create the Frontend

  1. Create an index.html file and ask Copilot to help you set up a simple UI:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Task Manager</title>
        <script src="app.js" defer></script>
    </head>
    <body>
        <h1>Task Manager</h1>
        <input type="text" id="taskInput" placeholder="Add a new task">
        <button id="addTaskBtn">Add Task</button>
        <ul id="taskList"></ul>
    </body>
    </html>
    
  2. Create app.js to handle frontend logic and let Copilot guide you:

    document.getElementById('addTaskBtn').addEventListener('click', async () => {
        const taskInput = document.getElementById('taskInput');
        const task = taskInput.value;
        await fetch('/tasks', {
            method: 'POST',
            headers: { 'Content-Type': 'application/json' },
            body: JSON.stringify({ task })
        });
        taskInput.value = '';
        loadTasks();
    });
    
    async function loadTasks() {
        const response = await fetch('/tasks');
        const tasks = await response.json();
        const taskList = document.getElementById('taskList');
        taskList.innerHTML = '';
        tasks.forEach((task, index) => {
            const li = document.createElement('li');
            li.textContent = task;
            const deleteBtn = document.createElement('button');
            deleteBtn.textContent = 'Delete';
            deleteBtn.onclick = async () => {
                await fetch(`/tasks/${index}`, { method: 'DELETE' });
                loadTasks();
            };
            li.appendChild(deleteBtn);
            taskList.appendChild(li);
        });
    }
    
    loadTasks();
    

Step 5: Run Your App

  1. Start your server:

    node server.js
    
  2. Open your browser and navigate to http://localhost:3000. You should see your task manager!

Troubleshooting

  • Common Issue: If your server doesn't start, double-check your code for syntax errors. Copilot is helpful, but it’s not perfect.
  • No tasks showing: Ensure you have the correct routes and that your fetch requests are hitting the right endpoints.

What’s Next?

Now that you have a basic task manager, consider adding features like user authentication, database integration, or deploying your app using platforms like Heroku or Vercel.

Conclusion

Using GitHub Copilot, you can build a functional web app in just 2 hours, given you have the right prerequisites and understanding of the basics. It’s a great tool to accelerate your coding process, but remember that it’s not infallible.

Start Here: If you’re new to coding, practice building small projects to get comfortable. Once you’re ready, jump into GitHub Copilot to help you scale your coding efforts.

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

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time As a developer, whether you're just starting out or have years of experience, debugging can feel like a neverend

Oct 16, 20265 min read
Ai Coding Tools

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow As developers, we’re always on the lookout for ways to streamline our workflow and boost productivity. Enter

Oct 14, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools That Could Hurt Your Development Process

5 Myths About AI Coding Tools That Could Hurt Your Development Process As a solo founder or indie hacker, you might be lured by the promises of AI coding tools that claim to simpli

Oct 13, 20264 min read
Ai Coding Tools

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026 As AI coding tools have become an integral part of a developer's toolkit in 2026, many are still stumbling over

Oct 12, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026 As we dive into 2026, the landscape of AI coding tools has evolved significantly, yet many developers still

Oct 11, 20263 min read
Ai Coding Tools

Why AI Coding Assistants Are Overrated for Beginners in 2026

Why AI Coding Assistants Are Overrated for Beginners in 2026 As a solo founder or indie hacker, it’s tempting to think that AI coding assistants are the silver bullet to jumpstart

Oct 10, 20263 min read