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

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time As a developer, whether you're just starting out or have years of experience, debugging can feel like a neverend

Oct 16, 20265 min read
Ai Coding Tools

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow As developers, we’re always on the lookout for ways to streamline our workflow and boost productivity. Enter

Oct 14, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools That Could Hurt Your Development Process

5 Myths About AI Coding Tools That Could Hurt Your Development Process As a solo founder or indie hacker, you might be lured by the promises of AI coding tools that claim to simpli

Oct 13, 20264 min read
Ai Coding Tools

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026 As AI coding tools have become an integral part of a developer's toolkit in 2026, many are still stumbling over

Oct 12, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026 As we dive into 2026, the landscape of AI coding tools has evolved significantly, yet many developers still

Oct 11, 20263 min read
Ai Coding Tools

Why AI Coding Assistants Are Overrated for Beginners in 2026

Why AI Coding Assistants Are Overrated for Beginners in 2026 As a solo founder or indie hacker, it’s tempting to think that AI coding assistants are the silver bullet to jumpstart

Oct 10, 20263 min read