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 Improve Your Coding Speed with AI in Just 2 Hours

How to Improve Your Coding Speed with AI in Just 2 Hours As a solo founder or indie hacker, you know the importance of shipping quickly. But what happens when you hit a coding wall

Jul 28, 20264 min read
Ai Coding Tools

5 Underrated AI Coding Tools You Haven't Tried Yet

5 Underrated AI Coding Tools You Haven't Tried Yet As a solo founder or indie hacker, you're always on the lookout for tools that can help streamline your development process. The

Jul 28, 20264 min read
Ai Coding Tools

5 Must-Use AI Coding Tools for Beginners in 2026

5 MustUse AI Coding Tools for Beginners in 2026 As a beginner in coding, diving into the vast ocean of programming languages and tools can be overwhelming. In 2026, with advancemen

Jul 28, 20264 min read
Ai Coding Tools

How to Use Cursor for Efficient Debugging in Just 30 Minutes

How to Use Cursor for Efficient Debugging in Just 30 Minutes Debugging can often feel like a black hole of time and energy, especially when you're on a tight deadline or managing a

Jul 28, 20264 min read
Ai Coding Tools

5 Advanced Techniques to Supercharge Your Coding with AI Tools

5 Advanced Techniques to Supercharge Your Coding with AI Tools As experienced developers, we often find ourselves drowning in repetitive tasks, debugging nightmares, and the endles

Jul 28, 20264 min read
Ai Coding Tools

Cursor vs Codeium: The Best AI Assistant for Your Development Workflow?

Cursor vs Codeium: The Best AI Assistant for Your Development Workflow? In 2026, AI coding assistants are no longer just a nicetohave; they are essential for indie hackers and solo

Jul 28, 20263 min read