Ai Coding Tools

How to Build Your First App with GitHub Copilot in Under 2 Hours

By BTW Team4 min read

How to Build Your First App with GitHub Copilot in Under 2 Hours

Building your first app can feel like a daunting task, especially if you’re new to coding. But what if I told you that with the help of AI, you could whip up a simple app in under two hours? GitHub Copilot, a powerful coding assistant, can guide you through the process, making it easier than ever for beginners to get started. In this tutorial, I’ll walk you through the steps to build a basic app using GitHub Copilot, all while being mindful of your time and budget.

Prerequisites: What You Need to Get Started

Before we dive in, here’s what you’ll need:

  1. GitHub Account: Sign up for free if you don’t already have one.
  2. Visual Studio Code: Download and install VS Code, which is the code editor we’ll use.
  3. GitHub Copilot Subscription: Costs $10/month after a free trial. It’s essential for AI-powered coding assistance.
  4. Basic Understanding of JavaScript: Familiarity with JavaScript will help, but Copilot can fill in gaps.
  5. Node.js: Install Node.js to run your app locally.

Step 1: Setting Up Your Environment (15 minutes)

  1. Install Visual Studio Code: If you haven't installed it yet, grab it from the official site.
  2. Install GitHub Copilot:
    • Open Visual Studio Code.
    • Go to Extensions (Ctrl+Shift+X).
    • Search for "GitHub Copilot" and install it.
  3. Create a New Project Folder: Open your terminal and create a new directory for your app.
mkdir my-first-app
cd my-first-app
  1. Initialize a New Node.js Project:
npm init -y

This will create a package.json file for your project.

Step 2: Coding Your App with GitHub Copilot (1 hour)

Now, the exciting part! Let’s start coding. In your project folder, create a new file named app.js and open it in Visual Studio Code.

  1. Set Up Basic Server:

    • Start typing const http = require('http'); and let Copilot suggest the rest.
    • You should see suggestions for creating a simple HTTP server. Accept the suggestions to build your server.
  2. Add Basic Functionality:

    • Type function requestListener(req, res) and see how Copilot assists in building the request handler.
    • You might end up with something like this:
const http = require('http');

const requestListener = function (req, res) {
    res.writeHead(200);
    res.end('Hello, World!');
};

const server = http.createServer(requestListener);
server.listen(8080, () => {
    console.log('Server is running on http://localhost:8080');
});
  1. Run Your App:
    • Save your file and run it in the terminal:
node app.js
  1. Test Your App: Open your browser and go to http://localhost:8080. You should see "Hello, World!" displayed!

Step 3: Adding Features (30 minutes)

Let’s make this app a bit more interesting by adding a simple route.

  1. Modify the Request Listener:

    • Ask Copilot to help you create additional routes. For instance, if you type if (req.url === '/about'), Copilot will likely suggest a response for that route.
  2. Final Code Example:

const http = require('http');

const requestListener = function (req, res) {
    if (req.url === '/about') {
        res.writeHead(200);
        res.end('About Page');
    } else {
        res.writeHead(200);
        res.end('Hello, World!');
    }
};

const server = http.createServer(requestListener);
server.listen(8080, () => {
    console.log('Server is running on http://localhost:8080');
});

Troubleshooting: What Could Go Wrong

  • Error Messages: If you see an error in the terminal, check for typos in your code.
  • Server Not Starting: Make sure your port 8080 is not being used by another application.
  • Copilot Not Suggesting: Ensure you’re connected to the internet and that Copilot is enabled in your VS Code settings.

What’s Next?

Congratulations! You’ve built a simple app in under two hours using GitHub Copilot. Here are a few ideas for what you can do next:

  • Enhance Your App: Add more routes or integrate a database.
  • Deploy Your App: Consider using platforms like Vercel or Heroku to get your app online.
  • Learn More: Check out the official GitHub Copilot documentation for advanced features.

Conclusion: Start Here

If you’re a beginner looking to build your first app, GitHub Copilot is a fantastic tool to help you along the way. Start by following the steps above, and don’t hesitate to experiment. Building in public, sharing your progress, and iterating on your app will only make you a better developer.

What We Actually Use: We rely on GitHub Copilot for quick prototyping and to speed up our coding process, especially when working on side projects.

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

Supabase vs Firebase: The Best AI Coding Tool for Your Project in 2026

Supabase vs Firebase: The Best AI Coding Tool for Your Project in 2026 As a solo founder or indie hacker, choosing the right backend service can feel like navigating a minefield—es

Mar 28, 20264 min read
Ai Coding Tools

Is Codeium Really Worth the Hype? A Deep Dive Comparison with GitHub Copilot

Is Codeium Really Worth the Hype? A Deep Dive Comparison with GitHub Copilot If you're a solo founder or indie hacker, you know the struggle of finding the right tools to superchar

Mar 28, 20263 min read
Ai Coding Tools

Why Codeium Might Be Overrated for AI Development in 2026

Why Codeium Might Be Overrated for AI Development in 2026 As we dive into 2026, the landscape of AI development is more crowded than ever, and tools like Codeium are often touted a

Mar 28, 20264 min read
Ai Coding Tools

Why Most Developers Overrate Codeium: A Critical Analysis

Why Most Developers Overrate Codeium: A Critical Analysis In 2026, the landscape of AI coding tools has exploded, with Codeium frequently touted as a top choice among developers. H

Mar 28, 20264 min read
Ai Coding Tools

How to Build Your First Python App Using AI Tools in Just 2 Hours

How to Build Your First Python App Using AI Tools in Just 2 Hours Building your first Python app can feel daunting, especially if you're new to programming or coding. But what if I

Mar 28, 20264 min read
Ai Coding Tools

Supabase vs Firebase: The Best Backend for AI-Driven Apps in 2026

Supabase vs Firebase: The Best Backend for AIDriven Apps in 2026 As an indie hacker or solo founder, choosing the right backend for your AIdriven app can feel overwhelming. With so

Mar 28, 20264 min read