Ai Coding Tools

How to Build Your First Project with GitHub Copilot in Just 2 Hours

By BTW Team4 min read

How to Build Your First Project with GitHub Copilot in Just 2 Hours

If you're a solo founder or indie hacker, you probably know that coding can be a barrier when building your first project. Enter GitHub Copilot: an AI-powered coding assistant that can help you write code faster and with fewer mistakes. But how effective is it really? In this guide, I’ll show you how to get started with GitHub Copilot and build your first project in just 2 hours.

Prerequisites: What You Need to Get Started

Before diving in, make sure you have the following:

  • GitHub Account: Sign up for a free account if you don’t have one.
  • Visual Studio Code: Download and install this popular code editor.
  • GitHub Copilot Subscription: As of March 2026, Copilot costs $10/month after a free trial. If you're a student or open-source maintainer, you may qualify for a free tier.
  • Basic Understanding of JavaScript: While Copilot can assist you, having some foundational knowledge will help.

Step 1: Setting Up GitHub Copilot

Follow these steps to set up GitHub Copilot in Visual Studio Code:

  1. Install the GitHub Copilot Extension:

    • Open Visual Studio Code.
    • Go to Extensions (Ctrl + Shift + X).
    • Search for "GitHub Copilot" and click install.
  2. Authorize GitHub Copilot:

    • After installation, you’ll need to authorize the extension with your GitHub account. Follow the prompts to complete this.
  3. Create a New Project:

    • In the terminal, create a new folder for your project and navigate into it:
      mkdir my-first-project
      cd my-first-project
      
  4. Initialize a Git Repository:

    • Run:
      git init
      

Step 2: Building Your First Feature with Copilot

Let’s create a simple web application that fetches and displays data from an API.

  1. Create an HTML File:

    • Create a file named index.html and start typing:
      <!DOCTYPE html>
      <html lang="en">
      <head>
          <meta charset="UTF-8">
          <meta name="viewport" content="width=device-width, initial-scale=1.0">
          <title>My First Project</title>
      </head>
      <body>
          <h1>Data Fetching App</h1>
          <div id="data"></div>
      </body>
      </html>
      
    • Copilot should suggest HTML boilerplate. Accept the suggestions as needed.
  2. Create a JavaScript File:

    • Create a file named app.js and start coding:
      // Fetch data from an API
      async function fetchData() {
          const response = await fetch('https://jsonplaceholder.typicode.com/posts');
          const data = await response.json();
          document.getElementById('data').innerHTML = JSON.stringify(data);
      }
      fetchData();
      
    • Copilot can help with the fetch function. Accept its suggestions for error handling or other features.
  3. Link JavaScript to HTML:

    • In index.html, add:
      <script src="app.js"></script>
      
    • This links your JavaScript to the HTML file.

Step 3: Testing Your Application

  1. Open Your HTML File:

    • Use Live Server extension in VS Code (install if you don’t have it) to preview your web app.
  2. Check for Errors:

    • Open the console in your browser (F12) and check for any errors. Copilot can help suggest fixes if you encounter issues.

Troubleshooting: What Could Go Wrong

  1. Copilot Doesn't Suggest Code:

    • Make sure you’re in a code file. Copilot won’t work in plain text files.
  2. API Issues:

    • If the API is down or returns an error, check the network tab in your browser’s developer tools.
  3. JavaScript Errors:

    • Common issues include syntax errors or incorrect variable names. Use console logs to debug.

What’s Next: Progressing from Here

Once you’ve built your first project, consider the following:

  • Explore More Features: Try implementing user input or more complex API calls.
  • Learn Git: Familiarize yourself with Git for version control.
  • Deploy Your App: Use platforms like Vercel or Netlify for deployment.

Conclusion: Start Here

Getting started with GitHub Copilot can significantly speed up your development process. In just 2 hours, you can have a functioning web application that fetches data from an API. While Copilot is a powerful tool, it’s not infallible. It requires your foundational knowledge to guide its suggestions effectively.

If you want to build your first project, I recommend diving in and following the steps above. Let Copilot assist you, but don’t forget to learn the basics along the way.

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