Skip to content

clicksmartmedia/leadsfire.com

Repository files navigation

LeadsFire Voice AI System

A production-ready Flask application for handling AI-powered voice calls using Twilio, OpenAI, and ElevenLabs.

System Requirements

  • Python 3.12.8
  • Node.js (for PM2)
  • Nginx
  • MongoDB Atlas (cloud database)
  • Git

Server Specifications

  • Vultr VPS
  • 1 vCPU
  • 1024 MB RAM
  • 25 GB NVMe Storage
  • Ubuntu Server (latest LTS)

External Services

  • Twilio (Voice & SMS)
  • OpenAI (GPT-3.5)
  • ElevenLabs (Text-to-Speech)
  • ClickSend (SMS)
  • MongoDB Atlas

Installation

  1. Clone the repository:
git clone https://github.com/clicksmartmedia/leadsfire.com.git
cd leadsfire.com
  1. Create and activate virtual environment:
python3.12 -m venv venv
source venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables:
cp .env.example .env
# Edit .env with your production credentials

Monitoring & Debugging Commands

Application Logs

# 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

Application Status

# Check application status
pm2 status

# Monitor CPU/Memory usage
pm2 monit

# View process details
pm2 show leadsfire

Nginx Logs

# 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

MongoDB Queries

# 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'})"

System Commands

# Check Nginx configuration
sudo nginx -t

# Reload Nginx configuration
sudo systemctl reload nginx

# Check SSL certificates
sudo certbot certificates

Security Features

  • SSL/TLS encryption (Let's Encrypt)
  • IP whitelisting for admin endpoints
  • Nginx reverse proxy
  • Firewall configuration
  • Secure environment variable handling

Monitoring & Logging

  • PM2 process management
  • Standard logging format
  • 30-day log retention
  • Zero-downtime deployments

Directory Structure

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

License

Proprietary - All Rights Reserved

Support

For support, please contact the development team.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published