# 🌐 Network Access Guide

## Your Network Configuration

### Server IP Address
- **Local IP**: `10.0.0.194`
- **Network**: `10.0.0.0/24` (WiFi network)
- **Interface**: `eno4`

### Service URLs

#### Frontend (Web Interface)
- **Local**: http://localhost:3002
- **Network**: **http://10.0.0.194:3002** ← Share this URL!
- **Status**: ✅ RUNNING

#### Backend (Python Agent)
- **Status**: ✅ RUNNING
- **Worker ID**: AW_eLrA3RRd6AeK
- **LiveKit Region**: India South

---

## 📱 Share with Others on WiFi

Anyone connected to the same WiFi network can access your app:

### Share This URL:
```
http://10.0.0.194:3002
```

### What They Can Do:
1. **Talk to the AI Agent** - Click "Connect" and start a voice conversation
2. **Make Outbound Calls** - Use the interface to call any phone number
3. **Test the Voice AI** - Experience the full voice assistant features

---

## 🔓 Firewall Configuration

If others can't access the app, you may need to allow the port:

### Ubuntu/Linux Firewall (ufw)
```bash
# Allow port 3002 from local network
sudo ufw allow from 10.0.0.0/24 to any port 3002

# Or allow from anywhere (less secure)
sudo ufw allow 3002
```

### Check Firewall Status
```bash
sudo ufw status
```

### Windows Firewall (if running on Windows)
1. Open Windows Defender Firewall
2. Click "Advanced settings"
3. Click "Inbound Rules" → "New Rule"
4. Select "Port" → Next
5. Enter port `3002` → Next
6. Allow the connection → Next
7. Apply to all profiles → Next
8. Name it "Voice AI Frontend" → Finish

---

## 🧪 Testing Network Access

### From Another Device on Same WiFi:

1. **Connect to the same WiFi network**
2. **Open browser** (Chrome, Safari, Firefox, etc.)
3. **Navigate to**: http://10.0.0.194:3002
4. **You should see the Voice AI interface**

### Troubleshooting:

#### Can't Connect?

**Check 1: Ping the server**
```bash
ping 10.0.0.194
```
If this fails, there's a network connectivity issue.

**Check 2: Check if port is listening**
On the server:
```bash
netstat -tuln | grep 3002
```
You should see: `0.0.0.0:3002` or `:::3002`

**Check 3: Firewall**
```bash
sudo ufw status
```
Make sure port 3002 is allowed.

**Check 4: Service is running**
```bash
ps aux | grep "next dev"
```
Should show the Next.js process.

---

## 🔒 Security Considerations

### Current Setup (Development Mode)
- ✅ Only accessible on local network (10.0.0.0/24)
- ✅ Not exposed to internet
- ⚠️ No authentication (anyone on WiFi can access)

### For Production Use:
1. Add authentication (login/password)
2. Use HTTPS (SSL certificate)
3. Set up proper firewall rules
4. Use environment-specific configurations

---

## 📊 Current Service Status

### Backend
```
Process ID: 3430465
Worker ID: AW_eLrA3RRd6AeK
Command: uv run python -m src.agent dev
Status: ✅ RUNNING
```

### Frontend
```
Process ID: 3430523
Port: 3002
URL: http://10.0.0.194:3002
Status: ✅ RUNNING
```

---

## 🔄 Restart Services

If you need to restart with network access:

### Backend
```bash
cd /var/www/html/vikas/2025-Nov-21-Voicebot/BackEnd/agent-starter-python
uv run python -m src.agent dev
```

### Frontend (Bind to All Interfaces)
```bash
cd /var/www/html/vikas/2025-Nov-21-Voicebot/FrontEnd/agent-starter-react/agent-starter-react
npm run dev
```

Next.js automatically binds to `0.0.0.0` (all interfaces) in development mode, making it accessible from any device on your network.

---

## 📱 Mobile Access

### On Your Phone/Tablet:

1. **Connect to the same WiFi** (must be on `10.0.0.x` network)
2. **Open browser** (Chrome, Safari, etc.)
3. **Go to**: http://10.0.0.194:3002
4. **Grant microphone permissions** when prompted
5. **Click "Connect"** and start talking!

---

## 🎯 Quick Share

Copy and share this with anyone on your WiFi:

```
Voice AI Demo
URL: http://10.0.0.194:3002

Instructions:
1. Open the URL in your browser
2. Click "Connect"
3. Allow microphone access
4. Start talking to the AI!
```

---

## 🌍 External Access (Optional)

If you want to access from outside your local network:

### Option 1: Port Forwarding (Router)
1. Log into your router (usually 192.168.1.1 or 10.0.0.1)
2. Find "Port Forwarding" settings
3. Forward external port 3002 to 10.0.0.194:3002
4. Access via your public IP: http://[your-public-ip]:3002

### Option 2: Ngrok (Temporary Tunnel)
```bash
# Install ngrok
curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null
echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list
sudo apt update && sudo apt install ngrok

# Create tunnel
ngrok http 3002
```

This gives you a public URL like: `https://abc123.ngrok.io`

**⚠️ Warning**: External access exposes your app to the internet. Use with caution!

---

## 📚 Related Documentation

- **QUICK_COMMANDS.md** - Command reference
- **START_HERE.md** - Setup guide
- **RUNNING_STATUS.md** - Current status
- **TELEPHONY_SETUP.md** - Phone integration
