How to Build Your First Project with GitHub Copilot in Just 2 Hours
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:
-
Install the GitHub Copilot Extension:
- Open Visual Studio Code.
- Go to Extensions (Ctrl + Shift + X).
- Search for "GitHub Copilot" and click install.
-
Authorize GitHub Copilot:
- After installation, you’ll need to authorize the extension with your GitHub account. Follow the prompts to complete this.
-
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
- In the terminal, create a new folder for your project and navigate into it:
-
Initialize a Git Repository:
- Run:
git init
- Run:
Step 2: Building Your First Feature with Copilot
Let’s create a simple web application that fetches and displays data from an API.
-
Create an HTML File:
- Create a file named
index.htmland 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.
- Create a file named
-
Create a JavaScript File:
- Create a file named
app.jsand 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.
- Create a file named
-
Link JavaScript to HTML:
- In
index.html, add:<script src="app.js"></script> - This links your JavaScript to the HTML file.
- In
Step 3: Testing Your Application
-
Open Your HTML File:
- Use Live Server extension in VS Code (install if you don’t have it) to preview your web app.
-
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
-
Copilot Doesn't Suggest Code:
- Make sure you’re in a code file. Copilot won’t work in plain text files.
-
API Issues:
- If the API is down or returns an error, check the network tab in your browser’s developer tools.
-
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.