Ai Coding Tools

How to Use GitHub Copilot to Write Your First AI-Powered Application in 60 Minutes

By BTW Team3 min read

Comparing tools? See the AI tools tested on the show.

In short

Step-by-step guide on leveraging GitHub Copilot to create a fully functional application in just an hour.

If you're like most indie hackers or solo founders, you've probably found yourself staring at a blank screen, wondering how to kickstart your first AI-powered application. The good news is that you can leverage GitHub Copilot to get you on your way in just 60 minutes. This isn't just theory; I’ve done it myself, and I’m here to share how you can do it too.

Prerequisites: What You Need Before Starting

Before you jump in, here’s what you need to have in place:

  1. GitHub Account: Sign up for a GitHub account if you don't already have one.
  2. Visual Studio Code (VS Code): Download and install VS Code.
  3. GitHub Copilot: Subscribe to GitHub Copilot ($10/month or $100/year as of May 2026). You’ll need to enable it in VS Code.
  4. Node.js: Install Node.js to run your application.

Step 1: Set Up Your Project

  1. Open VS Code.
  2. Create a new folder for your project and open it in VS Code.
  3. Open the terminal and run the following command to initialize a new Node.js project:
    npm init -y
    
    This creates a package.json file in your project directory.

Step 2: Install Necessary Packages

You’ll need a few libraries to make your AI application functional. For this tutorial, let’s build a simple chatbot. Run the following command in your terminal:

npm install express body-parser @openai/api

Step 3: Start Writing Code with GitHub Copilot

  1. Create a new file called app.js.

  2. Start typing the following:

    const express = require('express');
    const bodyParser = require('body-parser');
    const app = express();
    

    As you type, GitHub Copilot will suggest completions. Accept its suggestions to build out the structure of your server.

  3. Continue writing:

    app.use(bodyParser.json());
    app.post('/chat', (req, res) => {
        // AI chat logic here
    });
    

    Use Copilot to fill in the AI logic, and it will suggest how to integrate OpenAI's API.

  4. Complete the logic for the AI chat:

    const { Configuration, OpenAIApi } = require('@openai/api');
    const configuration = new Configuration({
        apiKey: process.env.OPENAI_API_KEY,
    });
    const openai = new OpenAIApi(configuration);
    
    app.post('/chat', async (req, res) => {
        const userMessage = req.body.message;
        const response = await openai.createChatCompletion({
            model: 'gpt-3.5-turbo',
            messages: [{ role: 'user', content: userMessage }],
        });
        res.json({ reply: response.data.choices[0].message.content });
    });
    
  5. Start the server: At the end of your app.js, add:

    app.listen(3000, () => {
        console.log('Server is running on http://localhost:3000');
    });
    

Step 4: Test Your Application

  1. Run your app:
    node app.js
    
  2. Use a tool like Postman or Curl to test the /chat endpoint. Send a POST request with a JSON body:
    {
        "message": "Hello, AI!"
    }
    

Troubleshooting: What Could Go Wrong

  • Copilot Suggestions Not Appearing: Ensure that GitHub Copilot is enabled in VS Code under Extensions.
  • API Key Issues: Make sure you set your OpenAI API key in your environment variables. If you get a 401 error, your key might be invalid.

What's Next?

Once you have your basic AI chatbot up and running, consider adding features like user authentication, a database for storing chat logs, or even a front-end interface. You can also explore integrating more advanced AI models or even experimenting with different frameworks.

Conclusion: Start Here

If you’re an indie hacker looking to build something quickly, GitHub Copilot is a solid choice for getting your first AI application off the ground in just an hour. The key is to embrace the suggestions Copilot gives you while maintaining an understanding of your code.

What I recommend is to dive in, follow this guide, and see what you can create. It’s all about iterating and improving your application as you learn.

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