# 🏠 Property Brochure Generator

Professional PDF generation system for real estate properties with Salesforce integration.

## 🚀 **Quick Start**

### **1. Deploy LWC to Salesforce**
```bash
chmod +x deploy-lwc-production.sh
./deploy-lwc-production.sh
```

### **2. Deploy PDF API to Your Server**
```bash
cd python-pdf-generator
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python3 api_server.py
```

### **3. Update LWC with Your API URL**
Edit these files with your actual server IP:

**LWC JavaScript:**
```javascript
// force-app/main/default/lwc/propertyTemplateSelector/propertyTemplateSelector.js
pdfApiBaseUrl = 'https://YOUR-ACTUAL-IP:8000/api';
```

**Apex Controller:**
```apex
// force-app/main/default/classes/PropertyTemplateController.cls
String apiEndpoint = 'https://YOUR-ACTUAL-IP:8000/api/generate-pdf';
```

**Production Config:**
```javascript
// force-app/main/default/lwc/propertyTemplateSelector/production-config.js
PDF_API_BASE_URL: 'https://YOUR-ACTUAL-IP:8000/api'
```

## 📁 **Project Structure**

```
├── force-app/                          # Salesforce LWC Components
│   └── main/default/
│       ├── lwc/propertyTemplateSelector/  # Main LWC Component
│       ├── classes/PropertyTemplateController.cls  # Apex Controller
│       └── objects/                    # Custom Objects
├── python-pdf-generator/               # PDF Generation API
│   ├── api_server.py                   # FastAPI Server
│   ├── property_pdf_generator.py       # PDF Generation Logic
│   └── requirements.txt                # Python Dependencies
├── deploy-lwc-production.sh            # LWC Deployment Script
└── README.md                           # This File
```

## 🔧 **Features**

- **5-Step Wizard**: Template → Property → Details → Preview → Download
- **Multiple Templates**: 1-page, 3-page, 5-page, Luxury, Modern
- **Real-time Preview**: Instant customization updates
- **Image Management**: Multiple images with room names
- **Salesforce Integration**: Direct access to pcrm__Property__c data
- **Responsive Design**: Works on all devices

## 📊 **API Endpoints**

- **Base URL**: `https://YOUR-IP:8000/api`
- **Preview**: `POST /preview`
- **Generate PDF**: `POST /generate-pdf`
- **Health Check**: `GET /health`
- **Templates**: `GET /templates`

## 🔒 **Security**

- Configure CORS for your Salesforce domain
- Use HTTPS in production
- Implement authentication if needed
- Configure firewall for port 8000

## 📞 **Support**

For issues or questions, check the deployment logs and ensure:
- Salesforce CLI is installed
- Python dependencies are installed
- API server is running on your IP
- LWC has correct API URL

---

**🎯 Production-ready system for generating professional property brochures!** 