Step 1: Create a New Next.js App
Open Cursor's terminal and run these commands to create your project:
# Create your app (name it whatever you want)
npx create-next-app@latest my-ai-app
# Move into your project folder
cd my-ai-app
# Install dependencies
pnpm install
# Run the app locally
pnpm devNow open your browser to http://localhost:3000. You should see a welcome screen — your local app is running.
Running pnpm dev starts the node server locally. If you close this window in Cursor, you can always run pnpm dev again to restart the server.
Step 2: Set Up GitHub
Go to github.com and create an account if you don't have one. Then create a new repository and keep it private. Save the repository URL — you'll need it later.
Step 3: Install GitHub CLI
The GitHub CLI lets you work with GitHub directly from your terminal.
# Install Homebrew (if not already installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install GitHub CLI
brew install ghWindows users should install GitHub CLI via WinGet or download from cli.github.com
Step 4: Connect to GitHub
# Login to GitHub from the terminal
gh auth login
# Select HTTPS when prompted
# Set your global username and email
git config --global user.name "your-github-username"
git config --global user.email "your-github-email"
# Verify your email is set
git config --global user.emailStep 5: Commit and Push to GitHub
# Initialize git tracking
git init
# Stage all files
git add .
# Commit with a message
git commit -m "Initial Next.js app"
# Connect to your GitHub repository
git remote add origin <your-github-url>
# Push to GitHub
git push -u origin mainStep 6: Connect to Vercel
Deploy your app:
- Go to vercel.com and create an account
- Start a new project by importing from GitHub
- Install the GitHub connection when prompted
- Import your repository
- Your app will be live in seconds!
Setting up this connection creates a pipeline: when you push changes from your IDE to GitHub, they're automatically deployed to Vercel.
What You Now Have
- A Next.js project running locally
- GitHub repo storing your code in the cloud
- Vercel deployment live on the web
- A pipeline: Local → GitHub → Vercel (automatic)