Ai Coding Tools

How to Build a Simple App with AI in 2 Hours

By BTW Team4 min read

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

In short

A step-by-step tutorial designed for beginners that outlines the process of using AI coding tools to build a functional app from scratch in just two hours.

Feeling overwhelmed by the thought of creating an app, especially with all the noise about AI? You’re not alone. Many aspiring builders hesitate, thinking they need to be expert coders or have a massive budget to get started. But what if I told you that you could build a functional AI-powered app in just 2 hours? In this guide, I’m going to walk you through the process using practical tools that actually work, so you can skip the fluff and get straight to building.

Prerequisites: What You Need

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

  1. Basic understanding of programming - Familiarity with JavaScript will help, but you don’t need to be a pro.
  2. A computer with internet access - You’ll be using online tools and platforms.
  3. Accounts on the following tools:
    • OpenAI (for AI functionality)
    • Replit (for coding)
    • Zapier (for automation, optional)

Step-by-Step Guide to Building Your AI App

Step 1: Define Your App Idea

Start by brainstorming a simple app idea. It could be a chatbot that provides weather updates, a text summarizer, or a simple game. Keep it straightforward. The clearer your idea, the easier it will be to execute.

Step 2: Set Up Your Development Environment

  1. Create a Replit Account: Go to Replit and sign up. This platform allows you to code in your browser without complex setup.

    • Pricing: Free tier available, Pro at $20/mo.
    • Best for: Beginners who want to code quickly.
    • Limitations: Free tier has limited storage and performance.
    • Our take: We love Replit for rapid prototyping.
  2. Start a New Project: Select a template that fits your app idea (e.g., Node.js for backend apps).

Step 3: Integrate AI with OpenAI

  1. Sign Up for OpenAI: Go to OpenAI and create an account.

    • Pricing: Free tier available, paid plans start at $20/mo.
    • Best for: Adding AI capabilities like text generation.
    • Limitations: Usage limits on the free tier.
    • Our take: We use OpenAI for generating content and chatbot functionalities.
  2. Get Your API Key: After signing up, navigate to the API settings and get your API key. This key allows your app to communicate with OpenAI’s models.

Step 4: Code Your App

  1. Set Up Your Code: In Replit, write the code to connect to the OpenAI API. Here’s a simple example for a chatbot:

    const express = require('express');
    const axios = require('axios');
    const app = express();
    const port = 3000;
    
    app.use(express.json());
    
    app.post('/chat', async (req, res) => {
        const userInput = req.body.input;
        const response = await axios.post('https://api.openai.com/v1/engines/davinci/completions', {
            prompt: userInput,
            max_tokens: 50
        }, {
            headers: { 'Authorization': `Bearer YOUR_API_KEY` }
        });
        res.json(response.data);
    });
    
    app.listen(port, () => {
        console.log(`App running on http://localhost:${port}`);
    });
    
  2. Test Your App: Run your app within Replit and test the endpoint using Postman or a simple frontend.

Step 5: Add Automation (Optional)

If you want to enhance your app with automation, consider using Zapier to connect it to other services (like Slack or email). This step can be skipped if you're aiming for a simple app.

Step 6: Deploy Your App

  1. Deploy on Replit: Replit allows you to easily deploy your app with a few clicks. Follow their guide for deployment.
  2. Share Your App: Once deployed, you can share the link with friends or potential users.

Troubleshooting: What Could Go Wrong

  • API Errors: If you encounter errors when connecting to OpenAI, double-check your API key and endpoint.
  • Deployment Issues: If your app isn’t running, ensure that all dependencies are installed and that your code is error-free.

What’s Next?

Now that you have your simple AI app, consider expanding its features. You could integrate more advanced AI functionalities, add a frontend using a framework like React, or even explore user feedback for improvements.

Comparison of AI Tools for App Building

| Tool | Pricing | Best For | Limitations | Our Verdict | |--------------|------------------------|------------------------------|------------------------------|----------------------------------| | OpenAI | Free tier + $20/mo | Text generation | Usage limits on free tier | Essential for AI features | | Replit | Free tier + $20/mo | Rapid coding and prototyping | Limited performance on free | Great for quick builds | | Zapier | Free tier + $19/mo | Automation | Limited actions on free tier | Useful for connecting services | | Glitch | Free | Collaborative coding | Limited features | Good for team projects | | Vercel | Free tier + $20/mo | Frontend deployment | Limited serverless functions | Best for React apps |

Conclusion: Start Here

Building an AI app doesn’t have to be daunting. With tools like OpenAI and Replit, you can create something functional in just 2 hours. Start by defining your idea, setting up your environment, and coding the basics. Remember, the key is to start small and iterate.

If you’re eager to dive deeper into building and shipping products, check out our podcast, Built This Week, where we share our weekly journey and the tools we're testing.

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