Ai Coding Tools

How to Create a Simple To-Do App Using GitHub Copilot in 2 Hours

By BTW Team3 min read

How to Create a Simple To-Do App Using GitHub Copilot in 2 Hours

Building a simple to-do app is a classic project for developers, especially if you're just getting started. But what if I told you that you could leverage AI to speed up the process significantly? In this guide, I'm going to show you how to create a simple to-do app using GitHub Copilot in just 2 hours. Whether you're a beginner or looking to enhance your coding skills, this tutorial is designed to be practical and straightforward. Let's dive in!

Time Estimate

You can finish this in 2 hours if you follow the steps closely and have a basic understanding of JavaScript and GitHub.

Prerequisites

Before you start, make sure you have the following:

  • A GitHub account (free)
  • Visual Studio Code installed (free)
  • The GitHub Copilot extension for Visual Studio Code (free for students or $10/mo for individual use)
  • Basic knowledge of HTML, CSS, and JavaScript

Step-by-Step Guide

Step 1: Set Up Your Project

  1. Create a New Repository on GitHub named simple-todo-app.
  2. Clone the Repository to your local machine.
  3. Open Visual Studio Code and navigate to your project folder.

Step 2: Create the Basic HTML Structure

In your project folder, create a file named index.html and add the following code:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Simple To-Do App</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <div id="app">
        <h1>My To-Do List</h1>
        <input type="text" id="taskInput" placeholder="Add a new task">
        <button id="addTaskButton">Add Task</button>
        <ul id="taskList"></ul>
    </div>
    <script src="script.js"></script>
</body>
</html>

Step 3: Style Your App

Create a file named styles.css and add some basic styles:

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
}

#app {
    max-width: 400px;
    margin: auto;
}

button {
    margin-left: 10px;
}

Step 4: Implement JavaScript Functionality

Create a file named script.js. Here, you can use GitHub Copilot to help you write the functionality. Start typing the following code and let Copilot suggest the rest:

const taskInput = document.getElementById('taskInput');
const addTaskButton = document.getElementById('addTaskButton');
const taskList = document.getElementById('taskList');

addTaskButton.addEventListener('click', function() {
    const task = taskInput.value;
    
    if (task) {
        const listItem = document.createElement('li');
        listItem.textContent = task;
        taskList.appendChild(listItem);
        taskInput.value = '';
    }
});

Expected Outputs

After following these steps, you should have a working to-do app where you can add tasks by typing in the input field and clicking the "Add Task" button.

Troubleshooting

  • Issue: Nothing happens when I click "Add Task".

    • Solution: Ensure that your JavaScript file is linked correctly in the HTML and that you don’t have any console errors.
  • Issue: Tasks don't appear.

    • Solution: Check if the event listener is set up correctly and that you are getting the value from the input field.

What's Next?

Now that you have a basic to-do app, consider enhancing it by adding features like:

  • Task deletion
  • Saving tasks to local storage
  • Adding due dates

Conclusion

Creating a simple to-do app using GitHub Copilot is a straightforward way to familiarize yourself with coding while leveraging AI. Start with the basics, and you can evolve your app into something more complex as you learn.

What We Actually Use

For our personal projects, we typically use GitHub Copilot for quick prototyping. It's a great tool for beginners and helps speed up the coding process significantly, especially when you're stuck on syntax or need suggestions.

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