A production-ready Flask application for handling AI-powered voice calls using Twilio, OpenAI, and ElevenLabs.
- Python 3.12.8
- Node.js (for PM2)
- Nginx
- MongoDB Atlas (cloud database)
- Git
- Vultr VPS
- 1 vCPU
- 1024 MB RAM
- 25 GB NVMe Storage
- Ubuntu Server (latest LTS)
- Twilio (Voice & SMS)
- OpenAI (GPT-3.5)
- ElevenLabs (Text-to-Speech)
- ClickSend (SMS)
- MongoDB Atlas
- Clone the repository:
git clone https://github.com/clicksmartmedia/leadsfire.com.git
cd leadsfire.com
- Create and activate virtual environment:
python3.12 -m venv venv
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
cp .env.example .env
# Edit .env with your production credentials
# View all logs in real-time
pm2 logs leadsfire --raw
# View only error logs
pm2 logs leadsfire --err
# View last 10 lines of output logs
pm2 logs leadsfire --lines 10 --out
# Check application status
pm2 status
# Monitor CPU/Memory usage
pm2 monit
# View process details
pm2 show leadsfire
# View Nginx access logs
sudo tail -f /var/log/nginx/leadsfire.access.log
# View Nginx error logs
sudo tail -f /var/log/nginx/leadsfire.error.log
# Insert test survey data
python3 -c "from pymongo import MongoClient; import os; from dotenv import load_dotenv; load_dotenv(); client = MongoClient(os.getenv('MONGODB_URI')); db = client['pay_per_call_db']; db.surveys.insert_one({'Phone': '9097648539', 'first_name': 'Test', 'last_name': 'User', 'LAmount': '250000', 'Credit': '720', 'tags': ['refinance', 'debt consolidation']})"
# Insert test offer data
python3 -c "from pymongo import MongoClient; import os; from dotenv import load_dotenv; load_dotenv(); client = MongoClient(os.getenv('MONGODB_URI')); db = client['pay_per_call_db']; db.offers.insert_one({'offerName': 'Test Refinance Company', 'minMortgageBalance': 100000, 'maxMortgageBalance': 500000, 'routeToPhoneNumber': '+13369390718', 'conversionRate': 0.85, 'tag': 'refinance'})"
# Check Nginx configuration
sudo nginx -t
# Reload Nginx configuration
sudo systemctl reload nginx
# Check SSL certificates
sudo certbot certificates
- SSL/TLS encryption (Let's Encrypt)
- IP whitelisting for admin endpoints
- Nginx reverse proxy
- Firewall configuration
- Secure environment variable handling
- PM2 process management
- Standard logging format
- 30-day log retention
- Zero-downtime deployments
leadsfire.com/
├── app.py # Main application file
├── eleven_labs.py # ElevenLabs integration
├── requirements.txt # Python dependencies
├── static/ # Static files
├── .env # Environment variables
├── .gitignore # Git ignore rules
└── deployment/ # Deployment configurations
├── nginx/ # Nginx configuration
└── pm2/ # PM2 configuration
Proprietary - All Rights Reserved
For support, please contact the development team.