Ai Coding Tools

How to Build a Simple Web App Using Cursor in Under 2 Hours

By BTW Team4 min read

How to Build a Simple Web App Using Cursor in Under 2 Hours

Building a web app can often feel daunting, especially for indie hackers and solo founders. You might have the idea, but the technical skills or time commitment can hold you back. What if I told you that you could build a simple web app in under 2 hours using a tool called Cursor? In 2026, this AI-powered coding assistant can help you streamline your development process and get your project off the ground quickly. Let’s dive into how you can leverage Cursor to build your web app efficiently.

Prerequisites: What You Need Before You Start

Before jumping into the building process, here’s what you’ll need:

  1. Cursor Account: Sign up for a free account at Cursor.
  2. Basic Idea: Have a clear idea of what your web app will do. Keep it simple!
  3. Code Editor: Any code editor will do, but I recommend Visual Studio Code for its features and extensions.
  4. Node.js Installed: You’ll need Node.js for running your web app. Install it from Node.js.
  5. Browser: For testing your app. Chrome or Firefox will work best.

Step 1: Setting Up Your Environment (15 Minutes)

  1. Create a New Project Folder: Open your terminal and create a new folder for your project.

    mkdir my-web-app
    cd my-web-app
    
  2. Initialize a New Node.js Project:

    npm init -y
    

    This creates a package.json file for managing dependencies.

  3. Install Express: This will be your web server framework.

    npm install express
    
  4. Open Cursor: Launch Cursor and connect it to your project folder.

Step 2: Using Cursor to Generate Code (30 Minutes)

Cursor is designed to help you write code faster. Here’s how to use it effectively:

  1. Ask Cursor for Help: Type in commands like “create a simple Express server” in the Cursor interface. The AI will generate the code for you.

  2. Copy the Generated Code: Here’s an example of what you might get:

    const express = require('express');
    const app = express();
    const PORT = 3000;
    
    app.get('/', (req, res) => {
        res.send('Hello, World!');
    });
    
    app.listen(PORT, () => {
        console.log(`Server is running on http://localhost:${PORT}`);
    });
    
  3. Paste the Code: Copy the generated code into your main JavaScript file (e.g., index.js).

Step 3: Running Your Web App (15 Minutes)

  1. Run Your Server: Go back to your terminal and start the server.

    node index.js
    
  2. Test Your App: Open your browser and navigate to http://localhost:3000. You should see "Hello, World!" displayed.

Step 4: Adding Features (45 Minutes)

Now that you have a basic app running, you can add more features. Think about what functionality you want to include. For instance, let’s add a simple route that returns JSON data.

  1. Generate JSON Route with Cursor: Ask Cursor to create a route that returns sample JSON data.

    app.get('/data', (req, res) => {
        res.json({ message: 'This is some sample data.' });
    });
    
  2. Test the New Route: Navigate to http://localhost:3000/data in your browser to see the JSON output.

Troubleshooting: What Could Go Wrong

  • Server Not Starting: Make sure you’re in the correct directory and that Node.js is installed properly.
  • Cursor Not Generating Code: Check your internet connection and try refreshing the app.

What's Next: Scaling Your App

Once you have your simple web app running, think about how to scale it. You can:

  • Integrate a database like MongoDB for data persistence.
  • Deploy your app using platforms like Heroku or Vercel.
  • Explore more advanced features like user authentication.

Conclusion: Start Here

Building a simple web app using Cursor is a straightforward process that can be accomplished in under 2 hours. By leveraging the AI capabilities of Cursor, you can focus more on your ideas and less on the coding intricacies. If you're looking for a quick win or a way to get started with web development, this is the perfect approach.

What We Actually Use

In our experience, we love using Cursor for rapid prototyping but also recommend combining it with tools like GitHub for version control and Heroku for deployment once you're ready to scale.

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