# Local Sync Agent - Quick Start (5 Minutes)

## What Is It?

A Python app that runs on a local PC and syncs user data from cloud ADMS to your local biometric devices.

## Installation (5 min)

### Step 1: Install Python (if not already installed)
- Download from python.org
- Install Python 3.8 or higher

### Step 2: Install Dependencies
```bash
cd /path/to/adms-server
pip install -r requirements.txt
```

### Step 3: Create Configuration
```bash
python3 sync_agent.py --create-config
```

This creates `sync_agent_config.json`

### Step 4: Edit Configuration
Open `sync_agent_config.json` and set your cloud URL:

```json
{
  "cloud_url": "https://your-adms.cloud.com",
  "sync_interval_minutes": 10,
  "auto_discover": true,
  "network_prefix": "192.168.1"
}
```

Replace `https://your-adms.cloud.com` with your actual ADMS URL.

### Step 5: Test
```bash
python3 sync_agent.py --device 192.168.1.100
```

Should show:
```
✅ Success: Successfully synced 50 users
```

### Step 6: Run
```bash
python3 sync_agent.py
```

That's it! The agent will now sync users to all devices every 10 minutes.

---

## Keep It Running (Background)

### On Mac/Linux
```bash
# Run in background
nohup python3 sync_agent.py > sync_agent.log 2>&1 &

# Check if running
ps aux | grep sync_agent
```

### On Windows
Create `run_agent.bat`:
```batch
@echo off
python sync_agent.py
pause
```

Double-click to run.

Or use Windows Task Scheduler to run at startup.

---

## Verify It Works

1. Go to your ADMS web interface
2. Click **Device Sync Status**
3. Check device "Last Sync" time
4. Should show recent time (within 10 minutes)
5. Users should show 100% synced

---

## View Logs
```bash
tail -f logs/sync_agent_*.log
```

---

## That's It! 🎉

The sync agent is now running and will automatically sync users every 10 minutes.

**Next:** See SYNC_AGENT_SETUP.md for detailed configuration and troubleshooting.
