Ai Coding Tools

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

By BTW Team3 min read

How to Use GitHub Copilot to Write Your First Simple App in 2026

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.

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

How to Automate Your Development Workflow with AI in 3 Easy Steps

How to Automate Your Development Workflow with AI in 3 Easy Steps (2026) As indie hackers and solo founders, we often find ourselves buried under a mountain of repetitive tasks tha

Sep 3, 20264 min read
Ai Coding Tools

How to Boost Your Coding Velocity with AI in 30 Minutes

How to Boost Your Coding Velocity with AI in 30 Minutes As a solo founder or indie hacker, you know that time is your most precious resource. The idea of boosting your coding veloc

Sep 3, 20264 min read
Ai Coding Tools

Why Most Developers Get GitHub Copilot Wrong: 5 Myths Busted

Why Most Developers Get GitHub Copilot Wrong: 5 Myths Busted As we dive into 2026, GitHub Copilot has become a staple in many developers' toolkits. However, despite its popularity,

Sep 3, 20263 min read
Ai Coding Tools

How to Use AI Coding Tools to Boost Productivity in Under 2 Hours

How to Use AI Coding Tools to Boost Productivity in Under 2 Hours As indie hackers, we all know the struggle of trying to stay productive while juggling multiple projects. The prom

Sep 3, 20265 min read
Ai Coding Tools

Vercel vs GitHub Copilot: Which AI Tool is Right for Your Project?

Vercel vs GitHub Copilot: Which AI Tool is Right for Your Project? As a solo founder or indie hacker, choosing the right tools can be a makeorbreak decision for your project. With

Sep 3, 20263 min read
Ai Coding Tools

Why GitHub Copilot is Not the Magic Bullet for Every Programmer: Debunking the Myths

Why GitHub Copilot is Not the Magic Bullet for Every Programmer: Debunking the Myths As a programmer, I’ve been there: staring at a blank screen, hoping for a burst of inspiration

Sep 3, 20264 min read