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 Use GitHub Copilot for Full-Stack Development in 2 Hours

How to Use GitHub Copilot for FullStack Development in 2026 If you’re a solo founder or indie hacker, you know the pressure of building fullstack applications quickly and efficient

Aug 12, 20264 min read
Ai Coding Tools

Is AI Coding Overrated? Debunking 5 Myths in 2026

Is AI Coding Overrated? Debunking 5 Myths in 2026 As a solo founder navigating the tumultuous waters of product development, I often hear the buzz around AI coding tools. "They'll

Aug 12, 20264 min read
Ai Coding Tools

How to Boost Your Coding Speed with AI: 5 Tools That Work

How to Boost Your Coding Speed with AI: 5 Tools That Work As a solo founder or indie hacker, you probably know the struggle of getting bogged down in coding tasks that take way lon

Aug 12, 20264 min read
Ai Coding Tools

Cowideed vs. Cursor: Which AI Tool Enhances Code Quality More?

Cowideed vs. Cursor: Which AI Tool Enhances Code Quality More? (2026) As indie hackers and solo founders, we constantly seek tools that genuinely improve our workflow without break

Aug 12, 20263 min read
Ai Coding Tools

How to Use GitHub Copilot for 10x Coding Speed in 2026

How to Use GitHub Copilot for 10x Coding Speed in 2026 If you're a solo founder or indie hacker, you know the struggle of coding efficiently while juggling multiple responsibilitie

Aug 12, 20264 min read
Ai Coding Tools

How to Build Your First AI-Enhanced Application in Under 2 Hours

How to Build Your First AIEnhanced Application in Under 2 Hours Building an AIenhanced application might sound daunting, especially if you’re new to coding or app development. The

Aug 12, 20264 min read