How to Use GitHub Copilot to Write Your First Full Application in Under 2 Hours
How to Use GitHub Copilot to Write Your First Full Application in Under 2 Hours
If you’re like most indie hackers or solo founders, the thought of building an entire application can feel overwhelming. You might have great ideas, but the coding part? That’s where the anxiety kicks in. Enter GitHub Copilot—a powerful AI-powered coding assistant that can help you whip up your first full application in under two hours. But does it live up to the hype? Let's dig in.
Prerequisites: What You Need to Get Started
Before we dive into the nitty-gritty, make sure you have the following:
- GitHub Account: Sign up for free if you don’t have one.
- Visual Studio Code: Download and install this code editor. It’s free and widely used.
- GitHub Copilot Subscription: As of June 2026, it's $10/month after a free trial.
- Basic Understanding of JavaScript: You don’t need to be an expert, but familiarity with the syntax will help.
Step 1: Set Up Your Environment
Setting up your environment takes about 15 minutes:
- Install Visual Studio Code: Follow the installation instructions for your OS.
- Install GitHub Copilot: Open VS Code, go to Extensions (Ctrl+Shift+X), and search for "GitHub Copilot." Click install.
- Sign in to GitHub: Once installed, you’ll be prompted to sign in to your GitHub account to activate Copilot.
Expected Output: You should see a Copilot icon in the bottom right corner of VS Code, indicating it's active.
Step 2: Create Your First Application
Let’s build a simple web application that displays a list of your favorite books. This will take about 1.5 hours.
-
Create a New Folder: Name it
FavoriteBooksApp. -
Open the Terminal: Inside VS Code, go to Terminal > New Terminal.
-
Initialize a New Project:
mkdir FavoriteBooksApp cd FavoriteBooksApp npm init -y -
Install Express:
npm install express -
Create Your Main File: Create a file called
app.js. -
Start Coding with Copilot: In
app.js, start typing:const express = require('express'); const app = express(); const port = 3000; app.get('/', (req, res) => { res.send('Welcome to my favorite books app!'); }); app.listen(port, () => { console.log(`App listening at http://localhost:${port}`); });As you type, Copilot will suggest completions. Accept the suggestions by pressing
Tab.
Expected Output: Running node app.js in the terminal should give you a message indicating the app is running.
Step 3: Add Functionality to Display Books
Next, let’s enhance the application to display a list of books. This should take about 30 minutes.
-
Create a Books Array: Add the following code before the
app.getroute:const books = [ { title: '1984', author: 'George Orwell' }, { title: 'To Kill a Mockingbird', author: 'Harper Lee' }, { title: 'The Great Gatsby', author: 'F. Scott Fitzgerald' } ]; -
Modify the Route: Change the
app.getroute to:app.get('/books', (req, res) => { res.json(books); });
Expected Output: Navigating to http://localhost:3000/books in your browser should display the list of books in JSON format.
Troubleshooting: What Could Go Wrong
- Copilot Fails to Suggest: If Copilot isn’t suggesting code, ensure you’re connected to the internet and signed in to GitHub.
- Syntax Errors: If you see errors, double-check your code for typos or missing brackets.
What's Next?
Now that you’ve built a basic application, consider adding features like a front-end interface using React or Vue.js, or even deploying your app using Heroku or Vercel. Each of these steps can be done using Copilot for code suggestions.
Conclusion: Start Here
Using GitHub Copilot can dramatically reduce the time it takes to code your first application. In our experience, it’s a solid tool for beginners and seasoned developers alike. It won’t write perfect code every time, but it can get you 80% of the way there, especially if you’re just starting out.
So, if you’re ready to build your first app, grab your tools, and get coding with Copilot. You might be surprised at how much you can accomplish in just two hours.
Follow Our Building Journey
Weekly podcast episodes on tools we're testing, products we're shipping, and lessons from building in public.