Ai Coding Tools

How to Use GitHub Copilot to Write Your First Simple App in 2 Hours

By BTW Team3 min read

Comparing tools? See the AI tools tested on the show.

In short

A step-by-step guide for complete novices on utilizing GitHub Copilot to quickly create a functional app in just two hours.

If you're just getting started with coding, you might feel overwhelmed by the thought of building an app. The good news? GitHub Copilot can be a game-changer, helping you write code faster and with fewer headaches. In this guide, I’ll walk you through using GitHub Copilot to build a simple app in about 2 hours. Whether you’re an indie hacker or a side project builder, this is a practical approach to get you shipping quickly.

Time Estimate: 2 Hours

You can finish this project in about 2 hours if you follow along step-by-step.

Prerequisites

Before diving in, make sure you have the following set up:

  • GitHub Account: Free to create.
  • Visual Studio Code (VS Code): Download and install from here.
  • GitHub Copilot: You can get started with a 14-day free trial, then it’s $10/month.
  • Node.js: Download and install from here.
  • Basic understanding of JavaScript and HTML.

Step-by-Step Guide

Step 1: Set Up Your Development Environment

  1. Open Visual Studio Code.
  2. Install the GitHub Copilot extension from the Extensions Marketplace.
  3. Create a new folder for your project and open it in VS Code.

Step 2: Initialize Your App

  1. Open the terminal in VS Code and run:

    npm init -y
    

    This creates a package.json file for your app.

  2. Create an index.js file in the root of your project folder.

Step 3: Use Copilot to Generate Code

  1. Start typing a comment in index.js describing what you want to do. For example:

    // Create a simple web server that responds with "Hello, World!"
    
  2. Copilot will suggest code. Accept the suggestion by pressing Tab. The output should look something like this:

    const http = require('http');
    
    const server = http.createServer((req, res) => {
        res.statusCode = 200;
        res.setHeader('Content-Type', 'text/plain');
        res.end('Hello, World!\n');
    });
    
    server.listen(3000, () => {
        console.log('Server running at http://localhost:3000/');
    });
    

Step 4: Run Your App

  1. In the terminal, run:
    node index.js
    
  2. Open your browser and go to http://localhost:3000. You should see "Hello, World!" displayed.

Step 5: Expand Your App

  1. Let’s add a route to respond to a different endpoint. Type:

    // Add a route that responds to "/about" with "This is a simple app."
    
  2. Accept Copilot's suggestions again to add the new route.

Troubleshooting

  • What could go wrong: If you encounter errors, check the console for error messages. Common issues include forgetting to run npm init or not having Node.js installed correctly.
  • Solutions: Ensure all dependencies are installed and that you are in the correct project directory when running commands.

What's Next?

Now that you’ve built a simple app, consider expanding its functionality. You could add a front-end using HTML/CSS or integrate a database.

Conclusion

Using GitHub Copilot can significantly speed up your coding process, especially if you're new to programming. Start with small features and gradually expand your app.

What We Actually Use

For our projects, we leverage GitHub Copilot for rapid prototyping, especially when we need to generate boilerplate code quickly. It’s not perfect, but it helps us get past initial roadblocks.

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools
Ai Coding Tools

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them)

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them) In the everevolving landscape of AI coding tools, it's easy to get swept up in the hype. As indie hackers and s

Nov 30, 20263 min read
Ai Coding Tools

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026 In 2026, the landscape for indie hackers and solo founders has evolved significantly, especially with the advent

Nov 26, 20264 min read
Ai Coding Tools

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026 If you’re a developer stuck maintaining legacy code, you know the frustration. It’s like navigating a maze blindfolde

Nov 23, 20264 min read
Ai Coding Tools

10 AI Coding Tools That Will Save You Hours of Debugging in 2026

10 AI Coding Tools That Will Save You Hours of Debugging in 2026 Debugging can feel like a neverending cycle of frustration. Whether you're a solo founder or an indie hacker, spend

Nov 18, 20265 min read
Ai Coding Tools

10 Common Mistakes When Using AI Coding Tools for MVP Development

10 Common Mistakes When Using AI Coding Tools for MVP Development As a founder in 2026, you’re likely aware that AI coding tools can significantly speed up the MVP development proc

Nov 16, 20264 min read
Ai Coding Tools

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026 As a beginner developer, you’ve probably come across a ton of buzz surrounding AI coding tools. But with all the hyp

Nov 12, 20263 min read