# 🚀 FarmMatch - Quick Reference Card

## 📍 Your Current Status
- ✅ System installed and running
- ✅ Progress tracking implemented
- ✅ Testing infrastructure ready
- ⏳ **Next step**: One-time Properstar login

---

## 🎯 One-Time Setup (Do This First!)

```bash
cd /Users/jonathan/SynologyDrive/Since\ Today/PROJECTEN/farmmatch/scraper
python3 timed_login.py
```

**Then:**
1. Browser opens to Properstar
2. Log in (you have 3 minutes)
3. Navigate to favorites
4. Wait - session saves automatically
5. ✅ Done! Never need to do this again (until session expires)

---

## 🖥️ Daily Usage

### Start System
```bash
./start_system.sh
```

### Open Criteria Manager
http://localhost:8000/criteria_manager.html

### Run Full Update
Click "🔄 Full Update" button in UI
(Takes 20-30 min, progress shows in UI)

### Stop System
```bash
./stop_system.sh
```

---

## 🧪 Testing

```bash
# Quick test (30 seconds)
python3 test_update_pipeline.py

# Expected: 8/9 tests pass
```

---

## 📊 Check System Status

### Via Browser
http://localhost:8000/criteria_manager.html
(Look at top status bar)

### Via Command Line
```bash
# System health
curl http://localhost:5001/api/system-status | jq

# Active jobs
ps aux | grep "auto_scrape\|check_availability" | grep -v grep
```

---

## 🔧 Common Tasks

### Update Data
```bash
# Full pipeline (20-30 min)
python3 auto_scrape_favorites.py now

# Scrape only (5-10 min)
python3 auto_scrape_favorites.py scrape-only

# Check availability only (5-10 min)
python3 check_availability.py
```

### Fix Session Expired
```bash
rm auth.json
python3 timed_login.py
```

### Restart Everything
```bash
./stop_system.sh
./start_system.sh
```

---

## 📂 Important Files

| File | Purpose |
|------|---------|
| **enriched_data.json** | Your property data |
| **auth.json** | Properstar login session |
| **extracted_property_urls.csv** | Scraped URLs |
| **criteria_manager.html** | Main UI |
| **test_update_pipeline.py** | Test suite |

---

## 🐛 Troubleshooting

### Progress Bar Stuck at 0%
✅ **Normal** - Script is working, just not showing progress yet
Check: `ps aux | grep auto_scrape`

### "Session Expired"
```bash
rm auth.json
python3 timed_login.py
```

### "API Server Not Running"
```bash
./start_system.sh
```

### "No Data Found"
```bash
python3 auto_scrape_favorites.py now
# Wait 20-30 minutes
```

---

## 📚 Full Documentation

- **SESSION_SUMMARY.md** - Complete session overview
- **TESTING_GUIDE.md** - How to test everything
- **UX_IMPROVEMENT_ANALYSIS.md** - Future improvements
- **PIPELINE_OPTIMIZATION.md** - How the pipeline works
- **EFFICIENT_PROCESSING_STRATEGY.md** - Performance tips

---

## 💡 Pro Tips

1. **Check data freshness** before making decisions
   - Look at top status bar: 🟢 Fresh / 🟡 Old / 🔴 Stale

2. **Run availability check daily**
   ```bash
   python3 check_availability.py
   ```

3. **Full update weekly**
   - Click "Full Update" every Sunday

4. **Monitor system status**
   - Keep criteria_manager.html open
   - Status bar shows everything

---

## 🎯 What Each Button Does

### In Criteria Manager UI:

**🔄 Full Update** (20-30 min)
- Scrape → Check Availability → Geocode → Analyze
- Processes only active properties

**📥 Scrape Only** (5-10 min)
- Just updates property list
- No geocoding or analysis

**🔍 Check Availability** (5-10 min)
- Verifies which properties are still listed
- Marks removed/sold ones

---

## 📈 Expected Performance

| Operation | Time |
|-----------|------|
| Scrape favorites | 5-8 min |
| Check availability | 5-10 min |
| Geocode (if new) | 1-5 min |
| Analyze (if new) | 2-10 min |
| **Full Update** | **20-30 min** |

---

## ✅ Success Checklist

After running Full Update:

- [ ] enriched_data.json timestamp is recent
- [ ] UI status shows "Fresh (0h ago)"
- [ ] Active jobs counter is 0
- [ ] No error messages in UI
- [ ] All active properties have coordinates
- [ ] Map viewer shows updated data

---

## 🆘 Get Help

1. Run test suite: `python3 test_update_pipeline.py`
2. Check logs: `tail -f /tmp/farmmatch_api.log`
3. Check SESSION_SUMMARY.md for detailed info

---

**Quick Start**: Run `python3 timed_login.py` once, then everything works automatically! 🎉
