Welcome! This guide will help you set up your Mac for Price Watch development. We'll go step-by-step, explaining what each tool does and why we need it.
Time needed: 45-60 minutes (mostly waiting for downloads)
| Tool | What It Does | Why We Need It |
|---|---|---|
| Homebrew | Package manager for Mac | Makes installing developer tools easy |
| Git | Version control | Track code changes and collaborate |
| Docker Desktop | Container platform | Runs the entire system on your Mac |
| VS Code/Cursor/Up to you | Code editor | Write and edit code with helpful features |
| GitHub Account | Code hosting | Access the Price Watch repository |
What: Mac's built-in command-line developer tools Why: Many developer tools depend on these
- Open Terminal (Applications β Utilities β Terminal)
- Copy and paste this command:
xcode-select --install
- Click "Install" in the popup window
- Wait 5-10 minutes for installation
- Type this to verify:
Expected output:
xcode-select -p
/Library/Developer/CommandLineTools
What this does: Installs compilers and tools that other software needs to build and run.
What: Homebrew is like an app store for developer tools Why: Makes installing and updating tools simple
-
Open Terminal (if not already open)
-
Go to https://brew.sh and copy the install command, OR paste this:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Press Enter and follow the prompts (may ask for your Mac password)
-
IMPORTANT: After installation, Homebrew shows a message about running 2 commands. Copy and run those commands.
They look like:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)"
-
Close Terminal and reopen it
-
Verify Homebrew works:
brew --version
Expected output:
Homebrew 4.x.x(any 4.x version is fine)
Troubleshooting:
- If
brew --versionsays "command not found", you need to run those 2 commands from step 4 - Ask Dylan if you get stuck!
What: Git tracks changes to code over time Why: We use it to save our work and collaborate
-
Install Git:
brew install git
-
Verify installation:
git --version
Expected output:
git version 2.x.x -
Configure Git with your information:
git config --global user.name "Kenneth [Last Name]" git config --global user.email "[email protected]"
What this does: Sets your identity for code commits (like signing your work).
What: GitHub hosts our code repository Why: You need access to download and update the code
- Go to https://github.com/signup
- Create an account (use your SendCutSend email)
- Tell Dylan your GitHub username so he can give you access
What: SSH keys are like a secure password that Git uses automatically Why: You won't have to type your password every time you push code
-
Generate a new SSH key:
ssh-keygen -t ed25519 -C "[email protected]" -
Press Enter 3 times (accept default location, no passphrase)
-
Copy your public key:
cat ~/.ssh/id_ed25519.pub -
This shows a long line starting with
ssh-ed25519. Copy the entire line. -
Add to GitHub:
- Go to https://github.com/settings/keys
- Click "New SSH key"
- Title: "Kenneth's Mac"
- Paste the key you copied
- Click "Add SSH key"
-
Test the connection:
ssh -T [email protected]
Expected output:
Hi [your-username]! You've successfully authenticated...
Troubleshooting:
- If you get "Permission denied", double-check you copied the entire key
- If you get "Host key verification", type
yesand press Enter
What: Docker runs all 5 parts of our system (database, Redis, Rails, Sidekiq, scraper) in isolated containers Why: Makes setup consistent across different Macs - everyone runs the exact same environment
-
Download Docker Desktop for Mac
- If you have an M1/M2/M3 Mac: Choose "Apple Chip"
- If you have an Intel Mac: Choose "Intel Chip"
- Not sure? Click the Apple menu β "About This Mac" β Look for "Chip" or "Processor"
-
Open the downloaded
.dmgfile -
Drag Docker to Applications folder
-
Open Docker from Applications
-
Follow the setup wizard (accept defaults)
-
Docker icon appears in menu bar (top-right, looks like a whale)
-
Wait for "Docker Desktop is running" message
-
Verify Docker works:
docker --version docker compose version
Expected output: Version numbers for both commands
Settings to configure:
- Click Docker icon in menu bar β Settings
- Go to "Resources"
- Set Memory: 4 GB (minimum)
- Set CPUs: 2 (minimum)
- Click "Apply & Restart"
What this does: Docker creates mini-computers inside your Mac that run our database, job queue, Rails app, and scraper service.
What: VS Code is a powerful code editor with helpful features Why: Makes writing code easier with syntax highlighting, auto-complete, and debugging
- Go to https://code.visualstudio.com/
- Download for macOS
- Open the downloaded
.zipfile - Drag "Visual Studio Code" to Applications folder
- Open VS Code from Applications
- In VS Code, click the Extensions icon (looks like 4 squares, left sidebar)
- Search and install these:
- Ruby (by Shopify) - Helps with Rails code
- Ruby LSP (by Shopify) - Auto-complete for Ruby
- Docker (by Microsoft) - Manage Docker containers
- ESLint (by Microsoft) - JavaScript/TypeScript linting
- Prettier - Code formatter
What these do: Each extension adds helpful features like auto-complete, error highlighting, and code formatting.
Why: Keeps your development work organized
mkdir -p ~/Documents/work/SendCutSend
cd ~/Documents/work/SendCutSendWhat this does:
mkdir -pcreates folders (the-pcreates parent folders if needed)cdchanges directory (moves you into that folder)~is a shortcut for your home folder
What: Downloads the entire project to your Mac Why: You need the code on your computer to work on it
git clone [email protected]:dylan-conlin/price-watch.git
cd price-watchWhat this does:
git clonedownloads the repositorycd price-watchmoves you into the project folder
code .What this does: Opens the current folder (. means "here") in VS Code.
You should now see the project structure in the left sidebar:
rails/- Rails applicationscraper/- Node.js scraper servicedocs/- DocumentationREADME.md- Project overview
What: Creates a configuration file for secrets (passwords, credentials) Why: The scraper needs competitor account credentials to log in
cp scraper/.env.example scraper/.envWhat this does: Copies the example file to create your own .env file.
- Open
scraper/.envin VS Code - Replace the placeholder credentials with real ones (ask Dylan for these)
Example:
[email protected]
JACOB_HOLLY_PASSWORD=RealPasswordHere123!
JACOB_HOLLY_LOCATION=atlanta_ga
IMPORTANT: Never commit .env to Git! It contains passwords. (Don't worry - it's already in .gitignore so Git will ignore it automatically)
What: Starts all 5 services (postgres, redis, rails, sidekiq, scraper) Why: The system needs all pieces running to work
docker compose up -dWhat this does:
docker compose upstarts all services defined indocker-compose.yml-druns in "detached" mode (background) so you get your terminal back
Wait 30-60 seconds for everything to start, then check status:
docker compose psExpected output: All 5 services show "Up" status
What: Creates tables and loads historical data Why: Rails needs a database structure to store competitors, quotes, parts, etc.
docker compose exec rails bin/rails db:create
docker compose exec rails bin/rails db:migrate
docker compose exec rails bin/rails db:seedWhat each command does:
db:create- Creates the databasedb:migrate- Creates tables (materials, personas, quotes, etc.)db:seed- Loads historical data (182 materials, 205 quotes, 114 parts, 3 personas)
Expected output: Each command shows what it created/loaded
Run tests:
make test
make test-scraperExpected output:
- Rails:
95 tests, 217 assertions, 0 failures, 0 errors - Scraper:
25 passed
If tests pass, you're ready to go! π
Let's run the scraper to collect a real quote!
What: Rails console is like a playground to interact with the system Why: Easiest way to test the scraper manually
docker compose exec rails bin/rails consoleYou'll see a prompt: irb(main):001:0>
Copy and paste this:
# Claim an available persona (account rotation)
persona = Persona.claim_available!('oshcut')
# Get a part to quote
part = PartProfile.first
# Get a material to quote
material = Material.find_by(sku: 'ALU6061-125')
# Collect quotes for 6 quantities
result = ScrapeOrchestrator.collect_quote(
competitor: 'oshcut',
persona: persona,
part_profile: part,
material: material,
quantities: [1, 10, 25, 50, 100, 250]
)
# See the results
puts "Collected #{result[:quotes].size} quotes!"
result[:quotes].each do |quote|
puts "Qty #{quote.quantity}: $#{quote.unit_price} (#{quote.lead_time_days} days)"
endWhat's happening:
- Browser opens in Docker container (you won't see it)
- Logs in to OshCut
- Uploads STEP file
- Selects material
- Tests 6 quantities
- Saves quotes to database
- Takes screenshots
Takes about 30 seconds.
Expected output:
Collected 6 quotes!
Qty 1: $19.46 (3 days)
Qty 10: $10.05 (3 days)
Qty 25: $8.97 (3 days)
Qty 50: $8.19 (3 days)
Qty 100: $7.35 (3 days)
Qty 250: $6.26 (3 days)
Notice: Prices go down as quantity increases (volume discounts!)
exitKeep this section handy!
# Start all services
docker compose up -d
# Stop all services
docker compose down
# View logs
docker compose logs -f rails # Rails app
docker compose logs -f scraper # Scraper service
docker compose logs -f sidekiq # Background jobs
# Restart a service
docker compose restart rails
docker compose restart scraper
# Check service status
docker compose ps# Rails console (interact with database)
docker compose exec rails bin/rails console
# Run migrations (update database structure)
docker compose exec rails bin/rails db:migrate
# Reset database (WARNING: deletes all data!)
docker compose exec rails bin/rails db:reset# Run Rails tests
make test
# Run scraper tests
make test-scraper
# Run specific test file
docker compose exec rails bin/rails test test/models/persona_test.rb# Check what changed
git status
# See your recent commits
git log --oneline -10
# Pull latest code from GitHub
git pull
# Create a new branch for your work
git checkout -b kenneth/add-new-feature
# Save your changes
git add .
git commit -m "Add new feature"
# Push to GitHub
git pushProblem: Docker Desktop isn't started Solution:
- Open Docker Desktop from Applications
- Wait for "Docker Desktop is running" message
- Try your command again
Problem: Another service is using the port Solution:
docker compose down
# Wait 5 seconds
docker compose up -dProblem: SSH key not set up correctly Solution: Go back to "Part 1, Step 4" and re-do SSH key setup
Problem: Rails service isn't running Solution:
docker compose ps # Check if rails is "Up"
docker compose logs rails # Check for errors
docker compose restart railsProblem: Something isn't set up correctly Solution:
# Reset database and try again
docker compose exec rails bin/rails db:reset
make testIf still failing, ask Dylan!
- Check the logs:
docker compose logs -f railsordocker compose logs -f scraper - Restart services:
docker compose down && docker compose up -d - Ask Dylan: Take a screenshot of the error and send it to Dylan
Once you're set up and the scraper works:
-
Read the documentation:
- Getting Started Guide - Project overview
- Development Workflow - Daily development tasks
- Testing Strategy - How tests work
-
Explore the code:
- Start with
rails/app/models/- Data models (Persona, Material, Quote) - Then
scraper/src/scrapers/oshcut-scraper.ts- The OshCut scraper
- Start with
-
Make a small change:
- Try adding a
putsstatement to see what's happening - Run the scraper again
- See your change in action!
- Try adding a
Mac Terminal Basics:
Git Basics:
- https://try.github.io (interactive tutorial)
Ruby on Rails:
TypeScript/Node.js:
Docker:
Ask Dylan anytime! There are no dumb questions. Everyone was new to this once.
Remember: You have deep domain knowledge (competitors, pricing, materials) that Dylan doesn't have. Your input is valuable even while you're learning the technical side.
Welcome to the team! π