Ai Coding Tools

How to Use GitHub Copilot to Code a Simple App in 2 Hours

By BTW Team4 min read

How to Use GitHub Copilot to Code a Simple App in 2 Hours

If you’re a solo founder or indie hacker, you know that time is everything. You might find yourself stuck on coding tasks when you could be focusing on building your product. What if I told you that you could leverage AI to speed up your coding process? In this guide, I’ll show you how to use GitHub Copilot to code a simple app in about 2 hours. Let’s dive in!

Prerequisites: What You Need Before You Start

Before you jump into coding with Copilot, make sure you have the following:

  1. GitHub Account: You’ll need an account to access Copilot.
  2. Visual Studio Code (VS Code): This is where you'll be coding. Download it if you haven’t already.
  3. GitHub Copilot Subscription: It costs $10/month for individuals. There’s a free trial available for new users.
  4. Basic Knowledge of JavaScript: We’ll be building a simple to-do app, so familiarity with JavaScript will help.

Step-by-Step Guide to Building Your App

1. Install GitHub Copilot

First, install the GitHub Copilot extension in VS Code:

  • Open VS Code.
  • Go to Extensions (or press Ctrl+Shift+X).
  • Search for "GitHub Copilot" and click install.

Expected Output: You should see the Copilot icon in your sidebar.

2. Create Your Project Directory

Now, let’s set up your project:

  • Open the terminal in VS Code.
  • Create a new directory: mkdir simple-todo-app && cd simple-todo-app
  • Initialize a new Node.js project: npm init -y

Expected Output: You should have a new directory with a package.json file.

3. Set Up Your Basic HTML Structure

Create an index.html file:

<!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>
</head>
<body>
    <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>
    <script src="app.js"></script>
</body>
</html>

Expected Output: You should have a basic HTML structure ready.

4. Use Copilot to Code the JavaScript Logic

Create an app.js file and start writing the logic for adding tasks. Begin with a comment to guide Copilot:

// This function adds a task to the list

Expected Output: Copilot will likely suggest a function for adding tasks. Accept the suggestion.

5. Implement Task Removal Logic

Next, add the ability to remove tasks. Again, guide Copilot with a comment:

// This function removes a task from the list

Expected Output: Copilot should generate the removal logic for you.

6. Test Your App

Open index.html in your browser and test adding and removing tasks.

Troubleshooting: If something doesn't work as expected, check the console for errors. Common issues could be due to typos or missing elements.

7. Polish Your App

Once the basic functionality is working, consider adding some CSS for styling. You can either do this manually or use Copilot to suggest styles.

What Could Go Wrong

  1. Copilot Misunderstandings: Sometimes, Copilot might not get your intentions right. Don’t hesitate to modify the generated code.
  2. Browser Compatibility: Ensure your app works across different browsers. Test it on Chrome and Firefox.
  3. Performance Issues: If you add too many tasks, check how the app performs. You might need to optimize the code.

What's Next?

Once you’ve built your simple app, consider expanding its functionality:

  • Add a local storage feature to save tasks.
  • Implement user authentication.
  • Create a mobile-friendly version.

Conclusion: Start Here

Using GitHub Copilot can drastically reduce the time you spend coding, allowing you to focus on bringing your product to market. If you follow this guide, you can build a simple to-do app in about 2 hours. Don’t hesitate to experiment with Copilot and explore its capabilities!

What We Actually Use

We actively use GitHub Copilot for various coding tasks. While it saves us time, we always review the generated code for accuracy and performance.

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