Vibe AI: Cursor Full-Stack Coding Tutorial

Sort:
Avatar of AlAlper


We’re transforming our SusScan VS Code project into Vibe — a full-stack implementation powered by Cursor AI, React + Vite + Tailwind, and Python FastAPI.


Follow along as we rebuild it step by step — from backend logic to a live web app.
Perfect for ChessDevs who want to learn, collaborate, and create something amazing together.
Jump in, share ideas, and help us build both the development and production environments from scratch.

The project will run on my Windows 11 laptop using PowerShell, with Cursor and VS Code as the main editors. It uses Python 3.11 or newer and Node.js LTS for runtime environments, with Git and GitHub for version control over SSH. Dropbox handles syncing, but heavy folders like node_modules should be excluded. Optionally, you can add MySQL 8 for the database and Chrome with Chromedriver for testing or automation.


Prerequisites:

Window 10 or later is a prerequisite for this tutorial. Also a nice to have is ChatGPT (free version) to reproduce the GPT steps with the prompts, that I will provide.

Avatar of AlAlper

First Step is to ask ChatGPT how to set it up. (GPT Download links are below)

Here’s the best single prompt to reproduce (or regenerate) the full environment setup response you just received — formatted for ChatGPT GPT-5 / Cursor / VS Code contexts:


Prompt--

Create a complete Environment Setup section for my new project where I’m converting SusScan into Vibe — a full-stack app using Cursor AI, React + Vite + Tailwind, and Python FastAPI.

The setup should assume Windows 11 as the OS, and include:

  • Installation steps using PowerShell and winget

  • Integration with Dropbox (addressing file lock issues and node_modules exclusion)

  • GitHub + SSH setup for version control

  • A clean workspace and folder structure for backend (FastAPI) and web (React)

  • .env examples for both backend and frontend

  • Step-by-step backend setup (FastAPI, uvicorn, dotenv, MySQL connector)

  • Frontend setup (React/Vite/Tailwind) with proper CORS configuration

  • PowerShell scripts for setup (Setup-Dev.ps1) and running (Run-Dev.ps1)

  • Notes about common Windows issues (EBUSY, vite not found, execution policy, etc.)

  • Recommended VS Code or Cursor extensions

  • Optional MySQL database and Docker/Render deployment notes

Make it detailed but readable, with proper section headers, PowerShell and code blocks, and markdown formatting for a README.


If you do not have GPT. Here are the official FREE download / access links:

 

Avatar of AlAlper

GPT is often wrong so do not get ahead. We will cover each step in its own comment as we go!!!

This is the ChatGPT Reply to the Above Prompt:

Environment Setup (Windows 11 + Dropbox + GitHub)

for converting SusScanVibe (Cursor + React/Vite/Tailwind + FastAPI)

0) Quick summary (This just what we will setup. Wait for step by step Details. In following comments)

  • OS: Windows 11 (PowerShell)

  • Editors: Cursor (primary) + VS Code

  • Runtimes: Python 3.11+, Node.js LTS (npm)

  • SCM: Git + GitHub (SSH)

  • Sync: Dropbox (project outside node_modules syncing)

  • DB (optional): MySQL 8.x (local or remote)

  • Browsers/Drivers (optional): Chrome + Chromedriver (for Selenium)

10/25/2025 7:35PM

Here’s a clear, developer-friendly explanation of each tool — what it is, why it’s used, and how it fits into your environment:


🪟 Windows 11 (PowerShell)

What it is: The operating system and command-line shell for managing your development environment.
Why: PowerShell is powerful for automation, scripting, and running developer tools. It integrates well with Python, Node.js, and Git workflows, letting you install packages, manage files, and run scripts seamlessly.


💻 Cursor + VS Code

What they are:

  • Cursor: An AI-enhanced code editor built on VS Code, optimized for context-aware completions and refactoring.

  • VS Code: The standard lightweight IDE for coding in Python, JavaScript, and more.

Why:Cursor is your main editor for rapid, AI-assisted development, while VS Code remains the reliable fallback for debugging, extension support, and integrated terminals. Together they provide speed, intelligence, and flexibility.


🐍 Python 3.11+

What it is: A modern programming language runtime used for backend logic, APIs, automation scripts, and data handling.
Why:Python’s clean syntax, massive ecosystem (FastAPI, Pandas, Selenium), and version stability make it ideal for backend and automation tasks.


🌐 Node.js (npm)

What it is: A JavaScript runtime used for building and running web front-ends and developer tooling.
Why:Node powers modern web frameworks (React, Vite, Tailwind) and npm manages all JavaScript dependencies. It complements Python by handling your UI and build tools.


🧭 Git + GitHub (SSH)

What they are:

  • Git: Version control for tracking changes in your code.

  • GitHub: The remote platform for collaboration and hosting repositories.

  • SSH: Secure protocol for authenticating without passwords.

Why:This setup ensures safe, trackable, and collaborative development — every commit, branch, and pull request is synced securely between your local environment and GitHub.


☁️ Dropbox (Sync outside node_modules)

What it is: Cloud storage used for project backup and multi-device syncing.
Why:Keeping your project in Dropbox ensures redundancy and easy restoration, but excluding heavy or system-generated folders (like node_modules) prevents sync issues and saves space.


🗄️ MySQL 8.x (optional)

What it is: A relational database system used for structured data storage (tournaments, users, or analytics).
Why:MySQL integrates smoothly with Python and web backends. It’s reliable, widely supported, and perfect for handling data consistency and reporting.


🌍 Chrome + Chromedriver (optional)

What they are:

  • Chrome: Web browser for testing and automation.

  • Chromedriver: A driver that allows Selenium scripts to control Chrome.

Why:Essential for automation tasks like web scraping, testing UI flows, or verifying web app performance. Selenium + Chromedriver can simulate real user interactions in a controlled environment.

Avatar of AlAlper

1) Install the basics (one-liners)

WARNING Install PS 7.5 before use or it becomes a cluster. GPT needs to write code for consistency and write to PS 7.5. Some time the code is for PS 5.1

Open PowerShell (Admin) and run:

 
# Package manager
winget install --id Git.Git -e
winget install --id OpenJS.NodeJS.LTS -e
winget install --id Python.Python.3.11 -e
winget install --id Microsoft.VisualStudioCode -e
winget install --id Cursor.Cursor -e
winget install --id GitHub.GitHubDesktop -e # optional
winget install --id Oracle.MySQL -e # optional DB

# Optional
winget install --id Oracle.MySQL -e

# Enable long paths

reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f 
This returns:

PS C:\Windows\System32> winget install --id Git.Git -e
>> winget install --id OpenJS.NodeJS.LTS -e
>> winget install --id Python.Python.3.11 -e
>> winget install --id Microsoft.VisualStudioCode -e
>> winget install --id Cursor.Cursor -e
>> winget install --id GitHub.GitHubDesktop -e
>>
>>
The `msstore` source requires that you view the following agreements before using.
Terms of Transaction: https://aka.ms/microsoft-store-terms-of-transactionThe source requires the current machine's 2-letter geographic region to be sent to the backend service to function properly (ex. "US").

Do you agree to all the source agreements terms?
[Y] Yes [N] No: Y
Found Git [Git.Git] Version 2.51.1
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://github.com/git-for-windows/git/releases/download/v2.51.1.windows.1/Git-2.51.1-64-bit.exe██████████████████████████████ 63.1 MB / 63.1 MB
Successfully verified installer hash
Starting package install...
Successfully installed
Found Node.js (LTS) [OpenJS.NodeJS.LTS] Version 22.21.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://nodejs.org/dist/v22.21.0/node-v22.21.0-x64.msi██████████████████████████████ 30.0 MB / 30.0 MB
Successfully verified installer hash
Starting package install...
Successfully installed
Found Python 3.11 [Python.Python.3.11] Version 3.11.9
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://www.python.org/ftp/python/3.11.9/python-3.11.9-amd64.exe██████████████████████████████ 25.0 MB / 25.0 MB
Successfully verified installer hash
Starting package install...
Successfully installed
Found Microsoft Visual Studio Code [Microsoft.VisualStudioCode] Version 1.105.1
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://vscode.download.prss.microsoft.com/dbazure/download/stable/7d842fb85a0275a4a8e4d7e040d2625abbf7f084/VSCodeUserSetup-x64-1.105.1.exe██████████████████████████████ 110 MB / 110 MB
Successfully verified installer hash
Starting package install...
Successfully installed
No package found matching input criteria.
Found GitHub Desktop [GitHub.GitHubDesktop] Version 3.5.3
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://desktop.githubusercontent.com/releases/3.5.3-849ad017/GitHubDesktopSetup-x64.exe██████████████████████████████ 172 MB / 172 MB
Successfully verified installer hash
Starting package install...
Successfully installed
PS C:\Windows\System32>
>> reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f
The operation completed successfully.
PS C:\Windows\System32> winget install --id Oracle.MySQL -e
Found MySQL [Oracle.MySQL] Version 8.4.6
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
This package requires the following dependencies:
- Packages
Microsoft.VCRedist.2015+.x64
Downloading https://cdn.mysql.com/Downloads/MySQL-8.4/mysql-8.4.6-winx64.msi██████████████████████████████ 128 MB / 128 MB
Successfully verified installer hash
Starting package install...
Successfully installed
PS C:\Windows\System32>

NEXT STEP


10/25/2025 8:02

🧩 What PowerShell Version You Should Use

As of 2025, the latest stable release is PowerShell 7.5 (often written as PowerShell 7 or PowerShell Core).
This is the cross-platform, modern version of PowerShell (works on Windows, macOS, and Linux).

The older Windows PowerShell 5.1 comes preinstalled on Windows 10/11, but it’s no longer being updated — so for most users, installing PowerShell 7.x is the way to go.


🧰 How to Check Your Current PowerShell Version

    1. Open PowerShell (press Win + X, then choose Windows PowerShell or Terminal).

    2. Type:

      $PSVersionTable.PSVersion
    3. The output will look like:
      Major Minor Build Revision
      ----- ----- ----- --------
      5 1 22621 2506
      That means you have Windows PowerShell 5.1.

⚙️ How to Install PowerShell 7.x

🔹 Option 1 — Windows (Easiest)

  1. Go to the official Microsoft download page:
    👉 https://github.com/PowerShell/PowerShell/releases

  2. Under Assets, download:

    • PowerShell-7.x.x-win-x64.msi (for 64-bit Windows)

    • Or PowerShell-7.x.x-win-x86.msi (for 32-bit)

  3. Run the installer:

      • Accept the terms.

      • Choose to add PowerShell to PATH.

      • (Optional) Enable “Register PowerShell for context menu”.

  4. When done, open a terminal and type:

    pwsh
    That launches PowerShell 7.

Avatar of AlAlper

2) Dropbox best practices (avoid EBUSY & lock issues)

Problem you’ve hit before: EBUSY on node_modules during installs.

Fixes:

  • Put the repo inside Dropbox but exclude heavy/volatile folders:

    • Right-click folder → Dropbox “Don’t sync to this device”: node_modules/, .venv/, .pytest_cache/, __pycache__/, .next/, dist/, build/.

  • Or, keep the repo outside Dropbox and only sync artifacts (recommended for web projects).

  • When doing big npm install or vite dev runs, Pause Dropbox temporarily.


10/25/2025 10:15PM

This is very important but out of order. We will get to this.

Avatar of AlAlper

WRONG the whole point of Vibe is to let Cursor help set this up.

4) Repository layout (monorepo example)

 
 

 

Avatar of GoodyPrime

Well that was a loooooooooooooong read through, but it was nice, I work with FastAPI, React + Typescript + TailwindCSS. So I will love to help out in this project.

Avatar of AlAlper
GoodyPrime wrote:

Well that was a loooooooooooooong read through, but it was nice, I work with FastAPI, React + Typescript + TailwindCSS. So I will love to help out in this project.

Great follow along! Soon we will have the Git-Hub repo, and we can collaborate.

Avatar of GoodyPrime

That's nice

Avatar of AlAlper
GoodyPrime wrote:

Well that was a loooooooooooooong read through, but it was nice, I work with FastAPI, React + Typescript + TailwindCSS. So I will love to help out in this project.

Well watch I I build out the dev environment. And I still have design Issues that need to be addressed. This whole mono repo thing is a design Issue.

Avatar of AlAlper

As you can see the build given by GPT starts to fail around step 2. When using Chat GPT it is important to know what you are doing.
The whole Idea with VIBE-- Cursor is the design tool. So It is time to setup Cursor.

Avatar of AlAlper

Vibe Environment Design (Cursor‑driven)

A step‑by‑step playbook to design and stand up the Vibe software environment using Cursor as the primary AI pair‑programmer. This is optimal for your stack: React + Vite + Tailwind front end, FastAPI backend, MySQL database, GitHub + CI/CD, and optional Selenium tools.


0) Goals & Guardrails

  • Positive mission: power Perfectly Normal Play (PeNoPl) and related GT tools.

  • Monorepo for coherence; clear boundaries per package.

  • Fast local dev, predictable builds, repeatable infra.

  • AI‑ready repo: tiny, focused prompts, stable scripts, strict linting.


1) Decide Scope & Write the Design Brief (in Cursor)

Create a single page Design Brief that Cursor can “see” and reference.

File: /docs/DesignBrief.md

Template:

# Vibe – Design Brief (v0)

## Mission
Short statement (2–3 lines) explaining why Vibe exists and who it serves.

## Primary Capabilities (MVP)
1. Web app with Beta Tests page (PeNoPl, Coordinate Trainer)
2. FastAPI API for player analysis endpoints
3. MySQL schema for users, tournaments, analysis cache

## Non‑Goals (v0)
- No complex auth (just token‑based admin)
- No heavy analytics pipeline

## Architecture Snapshot
- Frontend: React + Vite + Tailwind
- Backend: FastAPI + Uvicorn, Pydantic, SQLAlchemy
- DB: MySQL 8
- Packaging: Monorepo (pnpm workspaces + Python src layout)

## Constraints & Decisions
- Windows 11 dev, Dropbox sync (exclude node_modules)
- GitHub Actions for CI/CD, Render or Fly.io for hosting

## Risks
- Dropbox lock/EBUSY on node_modules
- Env var management across services

## Success Criteria
- `pnpm dev` runs web in < 2s HMR
- `uvicorn app.main:app --reload` stable, <100ms p50 for /healthz
- CI: lint+test under 3 minutes

Commit this first so Cursor can cite it while generating code.


2) Repository Strategy (Monorepo)

Why: shared UI, typed contracts, single CI config, one place for issues.

Structure:

vibe/
├─ apps/
│  ├─ web/                 # React + Vite + Tailwind
│  └─ api/                 # FastAPI service
├─ packages/
│  ├─ ui/                  # shared React components (Tailwind)
│  └─ contracts/           # shared types/schemas (OpenAPI + TS types)
├─ infra/
│  ├─ docker/              # Dockerfiles, entrypoints
│  └─ compose/             # docker-compose.yml, .env examples
├─ tools/                  # Selenium, scripts
├─ docs/                   # Design docs, ADRs, runbooks
├─ .cursorrules            # Cursor prompt policies
├─ .editorconfig
├─ .gitignore
├─ package.json            # pnpm workspaces
├─ pnpm-workspace.yaml
└─ README.md

pnpm-workspace.yaml:

packages:
  - "apps/*"
  - "packages/*"
  - "tools/*"

package.json (root):

{
  "name": "vibe",
  "private": true,
  "packageManager": "pnpm@9",
  "scripts": {
    "dev": "pnpm -C apps/web dev",
    "build": "pnpm -C apps/web build",
    "lint": "pnpm -r lint",
    "typecheck": "pnpm -r typecheck"
  }
}

3) Cursor Setup & House Rules

Create .cursorrules (keeps AI on‑rails):

# Cursor Rules for Vibe
- Prioritize small, reviewable diffs. Reference `/docs/DesignBrief.md`.
- Use pnpm workspaces. Do not add npm/yarn lockfiles.
- React: functional components + hooks, no class components.
- Tailwind for styling; avoid inline styles except dynamic widths/heights.
- Backend: FastAPI + pydantic v2, SQLAlchemy 2.0 style, alembic for migrations.
- Write tests (Vitest for web, pytest for api) for new features.
- Add or update README snippets for new scripts/commands.
- Generate .env.example changes whenever env vars change.

In Cursor, open Chat and pin a short instruction: “Follow .cursorrules and the Design Brief.”


4) Scaffolding Commands (run in Terminal inside Cursor)

4.1 Init repo

mkdir vibe && cd vibe
pnpm init -y
pnpm dlx create-vite@latest apps/web --template react-ts
cd apps/web && pnpm i && cd ../..

Install Tailwind & deps:

cd apps/web
pnpm i -D tailwindcss postcss autoprefixer @types/node vite-tsconfig-paths
pnpm dlx tailwindcss init -p

Configure tailwind.config.ts content to include packages/ui:

import type { Config } from 'tailwindcss'
export default {
  content: [
    './index.html',
    './src/**/*.{ts,tsx}',
    '../../packages/ui/src/**/*.{ts,tsx}'
  ],
  theme: { extend: {} },
  plugins: []
} satisfies Config

4.2 Shared UI package

mkdir -p packages/ui/src && cd packages/ui
pnpm init -y
pnpm i react react-dom
pnpm i -D typescript tsup

packages/ui/tsconfig.json:

{ "extends": "../../apps/web/tsconfig.app.json", "include": ["src"] }

Example component:

// packages/ui/src/Card.tsx
import { PropsWithChildren } from 'react'
export function Card({ children }: PropsWithChildren) {
  return <div className="rounded-2xl shadow p-4 bg-slate-900/60 border border-slate-800">{children}</div>
}

4.3 FastAPI app

mkdir -p apps/api && cd apps/api
py -3.11 -m venv .venv && .venv\Scripts\activate
pip install fastapi uvicorn[standard] pydantic sqlalchemy alembic python-dotenv mysqlclient
pip install pytest httpx

apps/api/app/main.py:

from fastapi import FastAPI
app = FastAPI(title="Vibe API")

@app.get("/healthz")
def healthz():
    return {"ok": True}

Run:

uvicorn app.main:app --reload --port 8000

5) Database & Migrations

Alembic init:

cd apps/api
alembic init db

.env.example (root):

# Web
VITE_API_BASE=http://localhost:8000

# API
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=vibe
MYSQL_PASSWORD=dev
MYSQL_DB=vibe

Add a starter migration for core tables (users, players, tournaments). Keep it minimal; write an ADR for schema choices.


6) Local Orchestration with Docker Compose

infra/compose/docker-compose.yml:

services:
  db:
    image: mysql:8.0
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: vibe
      MYSQL_USER: vibe
      MYSQL_PASSWORD: dev
    ports: ["3306:3306"]
    volumes:
      - dbdata:/var/lib/mysql
  api:
    build: ../../apps/api
    env_file: ../../.env
    ports: ["8000:8000"]
    depends_on: [db]
  web:
    build: ../../apps/web
    ports: ["5173:5173"]
    environment:
      - VITE_API_BASE=http://localhost:8000
    depends_on: [api]
volumes:
  dbdata:

Add infra/docker/Dockerfile.api and Dockerfile.web with slim images and proper CMD.


7) Contracts & Type‑safety Between Web & API

Create packages/contracts that exports Zod or openapi‑typescript types to the web.

  • Generate OpenAPI from FastAPI (/openapi.json).

  • Use openapi-typescript to emit TS types: pnpm dlx openapi-typescript http://localhost:8000/openapi.json -o packages/contracts/src/api.d.ts


8) Lint, Format, and Testing

  • Web: ESLint (typescript), Prettier, Vitest.

  • API: ruff (lint), black (format), pytest.

Root scripts:

{
  "scripts": {
    "lint": "pnpm -r lint",
    "format": "pnpm -r format",
    "test": "pnpm -r test"
  }
}

9) CI/CD (GitHub Actions)

.github/workflows/ci.yml:

name: ci
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v4
        with: { version: 9 }
      - uses: actions/setup-node@v4
        with: { node-version: 'lts' }
      - run: pnpm i
      - run: pnpm -C apps/web build
      - uses: actions/setup-python@v5
        with: { python-version: '3.11' }
      - run: pip install -r apps/api/requirements.txt || true
      - run: pytest -q || true

Add a separate deploy.yml for Render/Fly once environments exist.


10) Environment Management

  • Keep node_modules out of Dropbox sync; add to .dropboxignore if needed.

  • Always update .env.example and never commit .env.

  • Provide scripts/ helpers:

scripts/
  dev-web.ps1         # Start Vite with safe flags
  dev-api.ps1         # Start uvicorn
  dev-all.ps1         # Start both (concurrently)

11) Cursor‑First Workflow

Prompt pattern (pin this in Cursor):

You are building Vibe per /docs/DesignBrief.md and .cursorrules.
Task:
1) Modify only the files listed below.
2) Explain planned diffs first.
3) Keep diffs minimal and testable.

Example task:

“Implement /beta page in apps/web using packages/ui/Card. 2 cards: PeNoPl and Coordinate Trainer. Link PeNoPl to GitHub, Trainer to /trainer. Add responsive grid, Tailwind classes, and a10‑line unit test with Vitest.”

.cursorrules addition for PRs:

  • Require a Changeset entry for versioned packages.

  • Require tests for UI and API endpoints.


12) UX & Design System (Tailwind)

  • Define brand tokens in tailwind.config.ts (colors, radii, shadows).

  • Composition guidelines: 2xl rounded corners, soft shadows, grid layout.

  • Motion: use framer-motion for entrance fades; keep durations < 250ms.

  • Accessibility: focus rings, color contrast, semantic headings.


13) Observability (Dev)

  • Add /healthz and /readyz in API.

  • Simple request logging (uvicorn access logs).

  • Frontend error boundary + console error reporting hook.


14) Definition of Done (checklist)

  • Feature behind a route or flag

  • Types and contracts updated

  • Tests (web/api) passing locally

  • Lint/format clean

  • .env.example updated

  • Docs/README updated


15) Next Actions

  1. Commit DesignBrief.md and .cursorrules.

  2. Run scaffolding steps (web/ui/api).

  3. Add /beta page using shared Card.

  4. Stand up MySQL via Docker Compose.

  5. Push to GitHub, enable CI.

  6. Choose hosting (Render/Fly) and wire env vars.

Once these are in, we’ll iterate on PeNoPl pages, API routes, and data models with Cursor‑guided tasks.