Ai Coding Tools

How to Use GitHub Copilot to Code a Complete App in Under 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 beginners on leveraging GitHub Copilot to build a functional app quickly, with specific examples for clarity.

If you're like me, you've probably stared at a blank screen, wondering how to turn your app idea into reality. The thought of coding an entire application can be overwhelming, especially for solo founders and indie hackers. But what if I told you that with GitHub Copilot, you could whip up a functional app in under two hours? In this guide, I’ll show you how to do just that, leveraging the capabilities of this AI-powered coding assistant.

Prerequisites Before You Start

To get the most out of this tutorial, ensure you have the following set up:

  • GitHub Copilot: You’ll need a subscription to GitHub Copilot, which costs $10/month or $100/year.
  • Code Editor: Visual Studio Code is recommended since it integrates seamlessly with Copilot.
  • Basic Knowledge of JavaScript: Familiarity with JavaScript will help you understand the code that Copilot generates.
  • Node.js Installed: Make sure you have Node.js installed on your machine for running the app.

Step 1: Setting Up Your Project

  1. Create a New Directory: Open your terminal and create a new project directory.

    mkdir my-app
    cd my-app
    
  2. Initialize a New Node.js Project: Run the following command and follow the prompts.

    npm init -y
    
  3. Install Required Packages: For this example, let’s say you want to build a simple Express app.

    npm install express
    

Step 2: Using GitHub Copilot to Generate Code

Creating Your Main File

  1. Open Visual Studio Code: Create a new file named app.js.
  2. Start Typing: Begin by typing // Basic Express server and let Copilot suggest code.
  3. Accept Suggestions: Use the Tab key to accept the suggestions. You should see a basic Express server setup.

Generating Routes and Middleware

  1. Define Routes: Type // Define a route for GET / and let Copilot generate the route handler.
  2. Add Middleware: Type // Add middleware for JSON to generate middleware code.

Finalizing the App

  1. Listen on a Port: Type // Listen on port 3000 and watch Copilot generate the final server listening code.
  2. Run Your App: Save the file and run your application:
    node app.js
    

Expected Outputs

  • Your app should run on http://localhost:3000, returning a simple message when you access it.
  • You can test this in your browser or using tools like Postman.

Troubleshooting Common Issues

  • Copilot Not Suggesting Code: Ensure that your GitHub Copilot extension is active in VS Code.
  • Express Not Installed: If you encounter errors, double-check that you installed Express correctly.

What’s Next?

Now that you have a basic Express app, consider expanding its functionality. Here are a few ideas:

  • Add Database Support: Implement MongoDB or PostgreSQL for persistent data storage.
  • User Authentication: Introduce user login features using Passport.js.
  • Deploy Your App: Use platforms like Heroku or Vercel to host your application.

Conclusion: Start Here

Using GitHub Copilot can drastically reduce the time it takes to build a functional app. With the right setup, you can create and run a basic application in under two hours. Remember, while Copilot is a powerful tool, it’s essential to review and understand the code it generates to ensure it meets your needs.

If you’re ready to start building your app, get GitHub Copilot set up and follow the steps above. It might just be the productivity boost you need!

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