Web Design AI Header

Lesson 2: Project Setup and Environment Configuration

Learn to clone your GitHub repository, set up your local development environment with virtual environments, and configure database connections using environment variables.

Lesson Objectives

  • Clone GitHub repositories locally and open in Cursor IDE
  • Set up Python virtual environments (venv) and activation
  • Install project dependencies using pip and requirements.txt
  • Use Claude AI to create .env files with database credentials
  • Configure Heroku config variables and avoid common spacing errors
  • Understand security practices for environment variables and credentials

Watch: Project Setup and Environment Configuration Tutorial

Project Setup and Environment Configuration - Notes

Clone Repository and Open in Cursor

Step 1: Clone Your GitHub Repository:

  • Go to your GitHub repository (created from CRUD F25 template)
  • Click the "Code" button and copy the clone URL
  • Open Cursor IDE and maximize the window
  • Click "Clone" and paste the repository URL
  • Choose your desired location (e.g., Desktop/Python folder)
  • Select "Yes" to open the cloned project

Virtual Environment Setup

Step 3: Create Virtual Environment:

# Create virtual environment
python -m venv venv

Step 4: Activate Virtual Environment:

# Windows activation command
venv\Scripts\activate

# Note: Be careful with spelling - it's "venv" not "vm"
# The command prompt will show (venv) when activated

Important Notes:

  • Virtual environment name doesn't have to be "venv" - you can name it anything
  • Naming it "venv" just helps with spelling when typing commands
  • You'll see (venv) in your terminal prompt when activated successfully
  • Virtual environment isolates project dependencies

Create .env File Using Claude

Step 6: Use Claude AI to Create Environment File:

  • Log into Claude in Cursor (say "yes" to proceed)
  • Prepare your JawsDB credentials from your notepad (from Lesson 1)
  • Give Claude this prompt: "make a copy of the .env.example file and call it .env and use this information"
  • Paste your JawsDB credentials (right-click to paste)
  • Press Enter to let Claude create the .env file

Heroku Config Variables Setup

Step 7: Configure Heroku Production Environment:

  • Go back to Heroku dashboard
  • Navigate to your app → Settings tab
  • Scroll down to "Reveal Config Vars"
  • Add each database credential as a separate config variable

⚠️ CRITICAL: Avoid Spaces!

  • 99% of problems come from extra spaces in config vars
  • Double-click to select values cleanly
  • Check for spaces at beginning/end of values
  • Once set, Heroku won't let you edit - you can only view