Ai Coding Tools

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

By BTW Team4 min read

How to Use GitHub Copilot to Write Your First App in 2026

If you’ve ever stared at a blank screen and felt overwhelmed by the prospect of building your first app, you're not alone. With so many frameworks, languages, and tools out there, it’s easy to feel paralyzed. Enter GitHub Copilot: an AI pair programmer that can help you write code faster and more efficiently. In this guide, I’ll show you how to leverage GitHub Copilot to create a simple app in just 2 hours.

Prerequisites: What You Need Before Getting Started

Before diving in, make sure you have the following tools and accounts set up:

  • GitHub Account: Sign up for free if you don’t have one already.
  • Visual Studio Code: Download and install this code editor. It’s free and widely used.
  • GitHub Copilot: You’ll need a subscription, which is currently $10/month after a free trial.
  • Basic Understanding of JavaScript: Familiarity with the basics will help you understand the code Copilot generates.

Step 1: Setting Up Your Environment (15 Minutes)

  1. Install Visual Studio Code: If you haven't done this yet, go to Visual Studio Code and download it for your operating system.
  2. Install GitHub Copilot: Open Visual Studio Code, go to Extensions (Ctrl+Shift+X), and search for "GitHub Copilot". Click "Install".
  3. Log Into GitHub: Open the Command Palette (Ctrl+Shift+P) and type GitHub: Sign in. Follow the prompts to authenticate.

Step 2: Creating Your Project (15 Minutes)

  1. Create a New Folder: Name it something like "MyFirstApp".
  2. Open the Terminal: In VS Code, open the terminal (Ctrl+`).
  3. Initialize a Git Repository: Run git init.
  4. Create an index.html file: This will be the main file for your app. You can do this in the terminal with touch index.html.

Step 3: Start Writing Code with Copilot (1 Hour)

3.1 HTML Structure

  • Type <!DOCTYPE html> and press Enter. Copilot will suggest the rest of the HTML structure. Accept the suggestion.

3.2 Adding a Header

  • Type <!-- Header --> and then const header = document.createElement('h1'); header.textContent = 'Welcome to My First App';. Copilot will suggest the full function to append the header to the body.

3.3 Adding a Button

  • Type <!-- Button --> and then const button = document.createElement('button'); button.textContent = 'Click Me';. Accept Copilot’s suggestion to add an event listener that will display an alert when clicked.

3.4 Styling Your App

  • Create a new file called styles.css and type body { font-family: Arial; }. Copilot will suggest styles. Accept and modify them as needed.

3.5 Final Touches

  • Link your CSS file in the HTML: <link rel="stylesheet" href="styles.css">. Again, let Copilot suggest any additional enhancements.

Step 4: Testing Your App (15 Minutes)

  1. Open the HTML File: Right-click on index.html in VS Code and select "Open with Live Server" (install the Live Server extension if you don't have it).
  2. Interact with Your App: Click the button and see if the alert displays. If not, check the console for errors.

Troubleshooting: What Could Go Wrong?

  • Copilot Isn’t Suggesting Code: Make sure you’re logged in and that the extension is enabled.
  • Errors in the Console: Common issues include typos or missing semicolons. Check your syntax carefully.
  • HTML/CSS Not Rendering: Ensure your paths to files are correct, and the Live Server is running.

What's Next?

Now that you’ve built your first app, consider deploying it using services like GitHub Pages or Vercel. You can also explore adding more features, like a backend with Node.js or a database using Firebase.

Conclusion: Start Here

Using GitHub Copilot can significantly reduce the learning curve for building your first app. With just a few hours, you can have a functioning project that’s ready for further development. I recommend starting with a simple idea and iterating from there.

What We Actually Use

In our experience, we rely heavily on GitHub Copilot for rapid prototyping. It saves us time and helps us understand coding patterns better, although it’s not perfect and sometimes requires manual adjustments.

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