Ai Coding Tools

How to Build a Simple Web App with Cursor in 2 Hours

By BTW Team3 min read

How to Build a Simple Web App with Cursor in 2 Hours

Building a web app can often feel daunting, especially if you're a solo founder or indie hacker juggling multiple responsibilities. But what if I told you that you could whip up a simple web app in just 2 hours using Cursor? In 2026, with the advancements in AI coding tools, this is not only possible but also practical. Today, I'll walk you through the steps, tools, and considerations to get your app off the ground quickly.

Prerequisites: What You Need to Get Started

Before diving in, you’ll need a few things:

  • Cursor Account: The AI coding tool that will assist you in writing code.
  • Code Editor: VS Code or any other preferred editor.
  • Basic Knowledge of HTML/CSS/JavaScript: Familiarity with these languages will expedite your process.
  • Local Server Setup: Tools like XAMPP or local development servers like Live Server in VS Code.

Step 1: Setting Up Your Project Structure

First, create a new directory for your web app. Inside this directory, you’ll want to create the following files:

  • index.html
  • styles.css
  • script.js

Your basic file structure should look like this:

/my-web-app
    ├── index.html
    ├── styles.css
    └── script.js

Step 2: Using Cursor to Generate Code

This is where Cursor shines. Open your code editor and start Cursor. Here’s how you can leverage it:

  1. HTML Structure: Ask Cursor to generate a basic HTML structure. Just type, "Generate a simple HTML structure for a web app."

    Expected output in index.html:

    <!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="styles.css">
        <title>My Web App</title>
    </head>
    <body>
        <h1>Welcome to My Web App</h1>
        <script src="script.js"></script>
    </body>
    </html>
    
  2. CSS Styles: Next, ask Cursor to create some styles. Say, "Create CSS styles for a simple web app layout."

    Expected output in styles.css:

    body {
        font-family: Arial, sans-serif;
        text-align: center;
        margin: 0;
        padding: 20px;
        background-color: #f4f4f4;
    }
    
  3. JavaScript Functionality: Finally, ask Cursor for basic JavaScript functionality. You might say, "Generate a simple JavaScript function that shows an alert."

    Expected output in script.js:

    document.addEventListener('DOMContentLoaded', () => {
        alert('Welcome to My Web App!');
    });
    

Step 3: Testing Your Web App

Once you have your files set up and code generated, it’s time to test. Open your index.html file in a web browser. You should see your welcome message and an alert popup when the page loads.

Step 4: Troubleshooting Common Issues

While building your app, you might encounter some hiccups. Here are a few common issues and solutions:

  • CSS Not Loading: Ensure your link to styles.css in index.html is correct.
  • JavaScript Errors: Open the developer console in your browser to check for errors in script.js.

Step 5: What's Next?

Now that you've built a simple web app, consider the following next steps:

  • Enhance Functionality: Add more features using Cursor, such as forms or API integrations.
  • Deploy Your App: Look into deployment options like Vercel or Netlify, which are free for small projects.

Conclusion: Start Here

Building a web app doesn't have to be a lengthy process. With tools like Cursor, you can create a simple web app in just 2 hours. The key is to leverage AI to handle the heavy lifting while you focus on the creative aspects of your project.

If you’re looking for a straightforward way to get started, I highly recommend using Cursor. It’s not just about speed but also about enabling you to focus on building rather than getting stuck in the weeds of coding.

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