Setting Up an Efficient Full-Stack Development Environment with Cursor

Author:Eric Liang
Platform:WeChat Official Account
Date:2025-05-24

This article provides a detailed guide on configuring development environments for mainstream programming languages like Python using the AI-enhanced Cursor code editor on macOS to boost productivity. Includes foundational setup, Python environment configuration, virtual environment management, and practical tips.

CursorAI ProgrammingPython DevelopmentDevelopment Environment SetupFull-Stack DevelopmentVS CodeProgramming ToolsmacOS Development

Setting Up an Efficient Full-Stack Development Environment with Cursor

Author: Eric Liang
Original Link: Original Link


Greetings, sharing practical insights and reflections from hands-on experience.

With the rapid advancement of AI, an increasing number of development tools are integrating AI capabilities to enhance productivity. Cursor, an AI-enhanced code editor based on VS Code, is becoming a powerful ally for developers thanks to its robust AI coding assistant features and user-friendly interface.

This article details how to efficiently configure development environments for various mainstream programming languages using Cursor on macOS, enabling developers to leverage AI-assisted programming and improve efficiency.

Basic Cursor Configuration

Before setting up language-specific environments, complete the following foundational steps:

  • Download and Install: Get the latest version of Cursor from the official website [1].
  • Account Login: Use Google for quick sign-in.
  • Import Settings: If migrating from VS Code, import existing settings, extensions, and themes.
  • Set Global Rules: Refer to this article for detailed configuration: Cursor Rules Best Practices.

These steps ensure an optimal Cursor experience.

Python Development Environment

Python is an interpreted, high-level programming language renowned for its readable syntax. As of 2025, Python remains a top contender in programming language popularity rankings, surpassing JavaScript as the most-used language on GitHub. Its design philosophy emphasizes code readability, using indentation to define code blocks, making it a favorite among beginners and professionals alike.

  1. Installation

Download Python from https://www.python.org/downloads/ [2].

After installation, configure the Python Path (do not copy the path below verbatim). Add the following to ~/.zshrc:

export PATH="/Library/Frameworks/Python.framework/Versions/3.13/bin:$PATH"

Verify in the terminal:

$ python3 --version  
Python 3.13.1  
$ pip3 --version  
pip 24.3.1 from /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/pip (python 3.13)  

To avoid using python3 and pip3, add the following aliases to ~/.zshrc:

alias python='python3'  
alias pip='pip3'  
  1. Virtual Environment Management

Recommended tools for managing Python virtual environments:

  • uv: Faster package installation and environment management.
  • poetry: Modern dependency and packaging management.

Installation commands:

# Install uv  
curl -sSf https://install.python-poetry.org | python3 -  

# Install poetry  
pip install poetry  
  1. Cursor Plugins and Configuration
  • Python (Microsoft): Language support.
  • Python Debugger: Debugging with breakpoints, step-by-step execution, and variable inspection.
  • Pylance: Static type checking and intelligent suggestions.
  • Black Formatter: Code formatting.
  • Pylint: Code linting.
  • Mypy Type Checker: Type checking.

Reference: Migration to Python Tools Extensions [3].

Configure settings.json:

{
  "[python]": {
    "editor.defaultFormatter": "ms-python.black-formatter",
    "editor.formatOnSave": true
  },
  "pylint.enabled": true
}

Select the project's virtual environment:

Open the command palette (Cmd + Shift + P), search for "Python: Select Interpreter," and choose from the list.

image-20250321下午62023387

JavaScript Development Environment

JavaScript is a high-level, interpreted programming language initially designed for enhancing web interactivity. Today, it underpins web development, extending to server-side development via Node.js, enabling full-stack capabilities. JavaScript is object-oriented, prototype-based, and dynamically typed, supporting functional and modern asynchronous programming paradigms.

  1. Installation

Install Node.js:

# Download and install nvm:  
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash  

# Reload shell without restarting:  
. ~/.nvm/nvm.sh  

# Install Node.js:  
nvm install 22  

# Verify Node.js version:  
node -v  # Should print "v22.14.0".  
nvm current  # Should print "v22.14.0".  

# Verify npm version:  
npm -v  # Should print "10.9.2".  
  1. Package Manager Options

Choose based on project needs:

  • npm: Default with Node.js, widely used.
  • yarn: Faster dependency installation and better caching.
    npm install -g yarn  
    
  • pnpm: Disk-efficient dependency management.
    npm install -g pnpm  
    
  1. TypeScript Configuration

TypeScript adds static typing to JavaScript for improved code quality:

# Global installation  
npm install -g typescript  

# Project initialization  
tsc --init  

# Compile TypeScript files  
tsc your-file.ts  
  1. Cursor Plugins and Configuration
  • ESLint: Code quality checks.
  • Prettier: Code formatting.
  • JavaScript and TypeScript Nightly: Latest TypeScript syntax support.

Configure settings.json:

{
  "[javascript]": {
    "editor.tabSize": 2,
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
  },
  "[typescript]": {
    "editor.tabSize": 2,
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
  }
}

Swift iOS/macOS Development Environment

Swift is a strongly typed, multi-paradigm language introduced by Apple in 2014 for iOS, macOS, watchOS, and tvOS development. Combining safety, performance, and modern design patterns, Swift offers expressive syntax and automatic memory management via ARC (Automatic Reference Counting).

  1. Install Xcode

Download the latest Xcode from the Mac App Store.
Install command-line tools:

xcode-select --install  
  1. Supplementary Tools

Enhance Swift development with:

# Build projects without opening Xcode  
brew install xcode-build-server  

# Beautify `xcodebuild` output  
brew install xcbeautify  

# Advanced formatting and language features  
brew install swiftformat  
  1. Cursor Plugins and Configuration
  • SweetPad: Enhanced Swift development with compilation, execution, and debugging.
  • Swift: Syntax highlighting and basic language features.

SweetPad Configuration:

  • After installing the plugin, create a .sweetpad config file in the project root.
  • Set project-specific build and run parameters.

For more on SweetPad, visit: SweetPad Documentation [4].

Java Development Environment

Java is a widely used object-oriented language known for its "write once, run anywhere" capability via the JVM (Java Virtual Machine). Released in 1995, Java remains a cornerstone of enterprise application development even after 30 years.

  1. Installation

Use SDKMAN to manage Java tools:

# Install SDKMAN  
curl -s "https://get.sdkman.io" | bash  

# Install JDK  
sdk list java  
sdk install java 21.0.1-oracle  

# Install build tools  
sdk install gradle 8.7  
sdk install maven 3.8.1  

# Set default version  
sdk default java 21.0.1-oracle  
  1. Cursor Plugins and Configuration
  • Extension Pack for Java: Comprehensive Java support.
  • Gradle for Java: Gradle build support.
  • Maven for Java: Maven build support.
  • Spring Boot Extension Pack: Spring Boot application development.

Configure settings.json:

{
  "java.jdt.ls.java.home": "/path/to/jdk",
  "java.configuration.runtimes": [
    {
      "name": "JavaSE-21",
      "path": "/path/to/jdk-21",
      "default": true
    }
  ],
  "[java]": {
    "editor.formatOnSave": true
  }
}

Conclusion

Cursor, as a modern AI-powered editor, offers robust support for full-stack development. By configuring environments for Python, JavaScript/TypeScript, Swift, and Java, developers can handle full-stack applications within a single tool.

Recommendations for using Cursor:

  • Leverage AI Features: Use shortcuts (Cmd+K/Cmd+I) for AI code suggestions.
  • Customize Rules: Tailor AI behavior to project needs.
  • Gradual Migration: Pair with familiar IDEs (e.g., IDEA, Xcode) initially.
  • Stay Updated: Regularly update Cursor to access new features.