Back/Engineering/Cursor
BeginnerEngineering

How to Build Your First Local Web App from Scratch Using Cursor AI

Create a small local Next.js project from an empty folder with Cursor, learn how to run and inspect it, and save a private version-controlled baseline before adding real features.

How to Build Your First Local Web App from Scratch Using Cursor AI

Claire abandons an overbuilt first prototype, opens an empty folder in Cursor, asks its agent for a minimal Next.js document-and-prototype hub, runs it locally, and saves the first version with GitHub Desktop.

Before you start

What you need

  • Cursor, Node.js, and npm installed
  • An empty project folder
  • A two-sentence app purpose or short PRD
  • A browser and terminal
  • GitHub Desktop or Git plus a private repository destination

What you’ll make

A local app that starts reliably, displays the intended document and prototype sections, explains its basic structure, and has a clean initial commit with no secrets.

Tools used

Step by step

The workflow

Follow the sequence once, then adapt the prompts, checks, and handoffs to your own setup.

5 steps

Step01

Set Up Your Local Environment

Install Cursor, a supported Node.js version, npm, and GitHub Desktop. Create a new empty folder, open it in Cursor, and confirm the terminal points to that folder.

Using the 'Agents' view in Cursor 2.0 helps you focus on high-level instructions rather than getting lost in individual files, making it perfect for beginners.

Step02

Prompt the AI to Scaffold the Application

Give Cursor a minimal product brief and ask it to scaffold the app, install dependencies, add a README, and avoid authentication, databases, deployment, and extra features.

Example prompt
Create a minimal Next.js app in this empty folder. It has two sections: Markdown documents from a docs directory and simple prototype routes from a prototypes directory. Add one sample of each, clear local run instructions, and a sensible .gitignore. Do not add authentication, a database, analytics, deployment, or unrelated features. Run the basic project checks.
Step03

Ask the AI How to Run the App

Ask the agent to explain the exact setup and run commands, then inspect package.json and README so you know what each command does.

Example prompt
Explain how to install dependencies and run this app locally. Point to the package.json scripts, expected local URL, how to stop the server, and the first places I should look if it fails.
Step04

Run the App in the Terminal

Run the install and development commands in Cursor’s terminal. Open the reported local URL, confirm both sections render, and save any terminal error before asking the agent for a focused repair.

Example prompt
npm run dev
Step05

Set Up Version Control with GitHub

Create a private repository in GitHub Desktop, inspect the changed-file list and .gitignore, make a descriptive initial commit, and publish it privately. Do not include .env files, credentials, node_modules, or build output.

What good looks like

  • A new user can run the app from written instructions.
  • The first version contains only the requested routes and sample content.
  • The repository ignores secrets, dependencies, and build output.
  • The initial commit is pushed privately and can be restored.

Build your next product with ChatPRD

Turn an idea into a PRD, user stories, and a plan.

Try ChatPRD free

After the steps

Runbook notes

How to recover when the loop fails and where human judgment helps.

Recover

If it goes sideways

The install fails because Node or npm is missing or incompatible
Check the required versions, install a supported Node release, reopen the terminal, and rerun the smallest failed command.
The agent creates authentication, a database, or extra features
Restate the two core sections, remove optional infrastructure, and keep sample data local.
The development server starts on an unexpected port or appears unreachable
Read the terminal URL, stop duplicate servers, and open the exact local address it reports.
Environment files or credentials appear in the commit
Remove them from tracking, rotate exposed values, update .gitignore, and inspect the commit before pushing.

Start shipping
better products.

Join 100,000+ product managers who use ChatPRD to write better docs, align teams faster, and build products users love.

Free to start
No credit card
SOC 2 certified
Enterprise ready