Ai Coding Tools

How to Code a Simple Web App with AI Tools in Under 2 Hours

By BTW Team4 min read

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

In short

A step-by-step guide that shows you how to create a functional web app using AI coding tools in just 2 hours, perfect for developers looking to quickly build and deploy applications.

Building a web app can feel like a monumental task, especially if you’re a solo founder or indie hacker. But what if I told you that with the right AI tools, you can whip up a simple web app in under 2 hours? In 2026, the landscape of coding has changed dramatically, enabling even non-technical founders to create functional applications quickly. This guide will walk you through the process step-by-step, using tools that we've found effective and budget-friendly.

Prerequisites: What You Need Before Starting

  1. Basic Understanding of Web Development: You don't need to be a pro, but familiarity with HTML, CSS, and JavaScript will help.

  2. Accounts on AI Tools: Make sure to sign up for the following tools:

    • GitHub (for version control)
    • Replit or Glitch (for coding environment)
    • OpenAI (for AI functionalities)
  3. Estimated Time: You can finish this project in about 2 hours, given you have the prerequisites ready.

Step 1: Choose Your Web App Idea

Before diving into development, decide on a simple web app idea. For this guide, we'll create a "Todo List" app with AI features that help suggest tasks based on user input.

Step 2: Set Up Your Coding Environment

Using Replit or Glitch

  1. Create a New Project:

    • Go to Replit or Glitch.
    • Start a new project (choose HTML/CSS/JS).
  2. Folder Structure:

    • Create folders for css, js, and assets to keep your files organized.

Expected Output

By the end of this step, you should have a basic environment set up, ready for coding.

Step 3: Build the Frontend

HTML Structure

Create a simple HTML file:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="css/style.css">
    <title>Todo List App</title>
</head>
<body>
    <div id="app">
        <h1>Todo List</h1>
        <input type="text" id="taskInput" placeholder="Add a new task...">
        <button id="addTask">Add Task</button>
        <ul id="taskList"></ul>
    </div>
    <script src="js/app.js"></script>
</body>
</html>

CSS for Styling

Add some basic styles in css/style.css:

body {
    font-family: Arial, sans-serif;
}
#app {
    width: 300px;
    margin: auto;
    text-align: center;
}

Expected Output

After this step, you should see a basic web page with an input box and a button.

Step 4: Implementing the Backend Logic

JavaScript for Functionality

In js/app.js, add the following code to handle adding tasks:

document.getElementById('addTask').onclick = function() {
    const taskInput = document.getElementById('taskInput').value;
    if (taskInput) {
        const li = document.createElement('li');
        li.textContent = taskInput;
        document.getElementById('taskList').appendChild(li);
        document.getElementById('taskInput').value = '';
    }
};

Integrating AI Features

To suggest tasks, we’ll use OpenAI’s API. You’ll need to sign up at OpenAI and get an API key.

  1. Install Axios: Use a package manager or include it via CDN.
  2. API Call: Add a function to fetch suggestions based on user input.

Expected Output

Now your app should allow users to add tasks, and you can expand it with AI suggestions.

Step 5: Testing and Troubleshooting

Common Issues

  • CORS Errors: Make sure your API calls are allowed from your domain.
  • Syntax Errors: Check your console for any JavaScript errors.

Troubleshooting Tips

  • Use console logs to debug.
  • Ensure your API key is valid and properly integrated.

What's Next?

After you've built your basic Todo List app, consider expanding it with more features like:

  • User authentication
  • Task deadlines
  • Notifications using a service like Twilio

Tools We Actually Use for This Process

| Tool | Pricing | Best For | Limitations | Our Take | |------------|------------------------------|------------------------------|-------------------------------------------|-----------------------------------| | Replit | Free tier + $7/mo pro | Quick prototyping | Limited features in free tier | We use it for quick setups. | | Glitch | Free with paid upgrades | Collaborative coding | Not suitable for large projects | Great for team projects. | | OpenAI | $0-100/mo based on usage | AI functionalities | Rate limits for free accounts | We use it for task suggestions. | | GitHub | Free for public repos | Version control | Private repos can get expensive | Essential for tracking changes. |

Conclusion: Start Here

If you’re looking to build a simple web app quickly, start with Replit or Glitch for coding, and integrate OpenAI for AI features. This combination allows you to prototype effectively without diving deep into technical complexities.

Ready to build your web app? Let’s get coding!

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