# ⚡ FarmMatch Quick Start

## Running the Full Update (One Command)

```bash
cd "/Users/jonathan/SynologyDrive/Since Today/PROJECTEN/farmmatch/scraper"
./full_update.sh
```

That's it! 🎉

---

## What Happens

```
     Properstar Favorites
             ↓
    [1. Scrape Favorites] ← You may need to login
             ↓
     favorites_urls.txt
             ↓
   [2. Extract Breadcrumbs] ← Gets location data
             ↓
    [3. Remove 404/410s] ← Cleanup dead properties
             ↓
     [4. Extract GPS] ← From embedded maps
             ↓
    [5. Geocode Missing] ← Address → GPS
             ↓
    [6. Analyze Criteria] ← Score each property
             ↓
   [7. Update Map Data] ← enriched_data.json
             ↓
      🗺️ Map Viewer
```

---

## ⏱️ Timeline

- **With saved login**: ~5 minutes (fully automatic)
- **First time/expired**: ~6 minutes (manual login required)

---

## 🎯 After Update

Your missing property (105943623) will now:
- ✅ Appear in the map viewer
- ✅ Be searchable by URL
- ✅ Have GPS coordinates
- ✅ Be scored against criteria

---

## 🔧 Prerequisites

**Start these first** (in separate terminals):

```bash
# Terminal 1: HTTP Server
cd "/Users/jonathan/SynologyDrive/Since Today/PROJECTEN/farmmatch/scraper"
python3 -m http.server 8000

# Terminal 2: Criteria API
cd "/Users/jonathan/SynologyDrive/Since Today/PROJECTEN/farmmatch/scraper"
python3 criteria_api.py
```

Then run `./full_update.sh` in Terminal 3.

---

## 🔍 Using URL Search (After Update)

1. Open: http://localhost:8000/map_viewer_advanced.html
2. Find "🔍 Search & Sort" section in left sidebar
3. Enter URL: `https://www.properstar.nl/listing/105943623`
4. Click "🔍 Find Property"
5. Map automatically centers on property!

---

## 💡 Run This Weekly

Keep your database fresh by running `./full_update.sh` once a week to:
- Catch new favorites
- Remove sold properties
- Update coordinates
- Re-score against criteria

---

## 🧹 Troubleshooting

### Processes Stuck or Conflicting?

```bash
# Clean up all FarmMatch processes
./cleanup_processes.sh

# Then run the update
./full_update.sh
```

The full update script now **automatically checks** for running processes and prompts you to clean them up if found.

---

## 📚 Documentation

- **[FULL_UPDATE_GUIDE.md](FULL_UPDATE_GUIDE.md)** - Complete detailed guide
- **[PROCESS_MANAGEMENT.md](PROCESS_MANAGEMENT.md)** - Process troubleshooting
- **[cleanup_processes.sh](cleanup_processes.sh)** - Process cleanup utility
