Ai Coding Tools

How to Use GitHub Copilot to Write Your First Complete App in Under 2 Hours

By BTW Team4 min read

How to Use GitHub Copilot to Write Your First Complete App in Under 2 Hours

Building your first app can feel like a daunting task, especially if you're not a seasoned developer. But what if I told you that with GitHub Copilot, you could whip up a complete app in under two hours? Sounds too good to be true, right? I get it; I was skeptical too. However, after diving into it, I've found that Copilot can genuinely accelerate the development process—if you know how to use it effectively.

In this guide, I’ll walk you through the steps to create a simple app using GitHub Copilot, including the tools you’ll need, the process to follow, and some tips for overcoming common pitfalls.

Prerequisites: What You Need to Get Started

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

  1. GitHub Account: Free to sign up.
  2. Visual Studio Code (VS Code): Download it for free here.
  3. GitHub Copilot Subscription: $10/month for individuals after a 60-day free trial.
  4. Basic understanding of JavaScript: You don't have to be an expert, but some knowledge will help.

Step 1: Setting Up Your Environment (15 Minutes)

  1. Install VS Code: If you haven't already, download and install it.
  2. Install GitHub Copilot: Go to the Extensions tab in VS Code, search for "GitHub Copilot," and install it.
  3. Sign in to Copilot: Use your GitHub account to authenticate.

Expected Output After This Step:

  • VS Code up and running with GitHub Copilot activated.

Step 2: Start a New Project (10 Minutes)

  1. Create a New Folder: Name it something like "MyFirstApp."
  2. Open the Terminal in VS Code: Use `Ctrl + `` (backtick).
  3. Initialize a New Node.js Project: Run npm init -y to create a package.json file.

Expected Output After This Step:

  • A new folder with a basic Node.js project setup.

Step 3: Use Copilot to Generate Code (60 Minutes)

Now comes the fun part: let’s generate some code with Copilot!

  1. Create an index.js file: This will be the entry point for your app.
  2. Write a Comment: Start with a comment that describes what you want. For example:
    // Create a simple Express server
    
  3. Accept Suggestions: Copilot will suggest code snippets. Accept them by pressing Tab.

Example Code Snippet:

const express = require('express');
const app = express();

app.get('/', (req, res) => {
  res.send('Hello World!');
});

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

Expected Output After This Step:

  • A fully functional Express server that responds with "Hello World!" when accessed.

Step 4: Testing Your App (20 Minutes)

  1. Run Your App: In the terminal, type:
    node index.js
    
  2. Visit Your App: Open your browser and go to http://localhost:3000. You should see "Hello World!"

Troubleshooting:

  • If you encounter errors, double-check your code and ensure all dependencies are installed via npm install express.

Step 5: Refining Your App (15 Minutes)

Now that you have a basic app running, you can refine it. Here’s how:

  1. Add More Routes: Use Copilot to add features like /about or /contact by writing comments.
  2. Implement Middleware: Add logging or error-handling middleware.

Expected Output After This Step:

  • An extended app with multiple routes and improved functionality.

What Could Go Wrong

  • Copilot Suggests Incorrect Code: Always review the code it generates. It might not be optimal or even correct.
  • Dependencies Issues: Ensure all required packages are installed.

What's Next: Deploying Your App

Once your app is ready, consider deploying it on platforms like Heroku or Vercel, which offer free tiers. This is a great way to share your project with others and get feedback.

Conclusion: Start Here

With GitHub Copilot, writing your first complete app can be a streamlined process. By following these steps, you can leverage AI to significantly cut down development time and get your project off the ground.

If you're ready to dive in, start by setting up your environment and generating some code! Remember, the key is to write clear comments and let Copilot do its magic.

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

Best AI Tools for Coding Automation in 2026: Top 7 Picks

Best AI Tools for Coding Automation in 2026: Top 7 Picks As a solo founder or indie hacker, you know that coding can be a significant bottleneck in getting your projects off the gr

May 15, 20265 min read
Ai Coding Tools

AI Code Assistants Showdown: Cursor vs GitHub Copilot - Which Is Better in 2026?

AI Code Assistants Showdown: Cursor vs GitHub Copilot Which Is Better in 2026? As an indie hacker or solo founder, the tools you choose can make or break your productivity. In 202

May 15, 20263 min read
Ai Coding Tools

Lovable vs. Codeium: Which AI Coding Tool Is Right for You?

Lovable vs. Codeium: Which AI Coding Tool Is Right for You? As a solo founder or indie hacker, choosing the right AI coding tool can feel like navigating a maze. You want something

May 15, 20263 min read
Ai Coding Tools

5 Common Mistakes Developers Make with AI Tools

5 Common Mistakes Developers Make with AI Tools As developers, we’re often excited about the potential of AI tools to streamline our workflows and enhance productivity. However, in

May 15, 20264 min read
Ai Coding Tools

How to Integrate AI Coding Assistants into Your Workflow in 1 Day

How to Integrate AI Coding Assistants into Your Workflow in 1 Day If you're a solo founder or indie hacker like me, you know that time is everything. Writing code can be a drag, es

May 15, 20264 min read
Ai Coding Tools

Bolt.new vs GitHub Copilot: Which AI Tool Accelerates Development More?

Bolt.new vs GitHub Copilot: Which AI Tool Accelerates Development More? As a solo founder or indie hacker, you're always looking to speed up your development process without compro

May 15, 20263 min read