Ensure these files exist:
cv-tools.php- Main career tools pageprocess_cv_revamp.php- CV revamp backendprocess_sop_generation.php- SOP generation backendcareer-assessment.php- Updated with "Revamp Your CV" buttoninc/header.php- Updated navbar (Trainings → Career Tools)index.php- Added trainings section to homepage
Run in terminal (from project root):
# Windows (PowerShell)
New-Item -Path "data\cv_uploads" -ItemType Directory -Force
New-Item -Path "data\sop_uploads" -ItemType Directory -Force
# Linux/Mac
mkdir -p data/cv_uploads
mkdir -p data/sop_uploadsOr create manually:
data/cv_uploads/data/sop_uploads/
chmod 755 data/cv_uploads
chmod 755 data/sop_uploads- Get API key from https://platform.openai.com/api-keys
- Set environment variable:
Windows:
set OPENAI_API_KEY=sk-your-api-key-hereLinux/Mac:
export OPENAI_API_KEY=sk-your-api-key-hereOr edit the files directly (line ~183 in process_cv_revamp.php and ~139 in process_sop_generation.php):
$api_key = 'sk-your-actual-api-key-here';If you don't set an API key, the system automatically uses rule-based processing:
- Basic text reformatting
- Section extraction
- No advanced AI features
- Still maintains no-hallucination principle
These are optional but improve functionality:
# PDF parsing (highly recommended)
composer require smalot/pdfparser
# Better PDF generation (choose one)
composer require tecnickcom/tcpdf
# OR
composer require dompdf/dompdfUbuntu/Debian:
sudo apt-get install poppler-utils antiwordWindows:
- Download Xpdf tools: https://www.xpdfreader.com/download.html
- Download Antiword: http://www.winfield.demon.nl/
Mac:
brew install poppler antiword- Navigate to
http://localhost/chronuswebsite-main/cv-tools.php - Try uploading a sample CV (PDF or DOCX)
- Fill in required fields
- Click "Generate"
- Check for errors in browser console and PHP logs
Edit process_cv_revamp.php and process_sop_generation.php:
Find the sendRevampedCVEmail() and sendSOPEmail() functions and integrate PHPMailer:
use PHPMailer\PHPMailer\PHPMailer;
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';
require 'PHPMailer/src/Exception.php';
function sendRevampedCVEmail($email, $cv_path, $target_job) {
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = 'your-email@gmail.com';
$mail->Password = 'your-app-password';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;
$mail->setFrom('noreply@chronus.com', 'Chronus Career Services');
$mail->addAddress($email);
$mail->addAttachment($cv_path);
$mail->Subject = "Your Revamped CV for $target_job";
$mail->Body = "Your CV has been revamped...";
return $mail->send();
}- Directories created:
data/cv_uploads/,data/sop_uploads/ - Permissions set (755 on Linux/Mac)
- API key configured (if using AI) OR fallback mode accepted
- Can access
cv-tools.phpin browser - Navbar shows "Career Tools" instead of "Trainings"
- Homepage shows trainings section
- Career assessment success modal has "Revamp Your CV" button
- File upload works (test with sample PDF)
- No fatal PHP errors
Issue: "Failed to upload file"
- Check directory permissions
- Verify directories exist
- Check disk space
Issue: "Could not extract text from CV"
- Install pdftotext/antiword
- Try a different CV file
- Check if PDF is encrypted/password protected
Issue: "Failed to generate revamped CV"
- Verify API key is correct
- Check API quota/billing
- Falls back to rule-based if API unavailable
Issue: White screen / 500 error
- Check PHP error logs:
xampp/php/logs/or/var/log/apache2/error.log - Enable error display:
ini_set('display_errors', 1); - Verify all PHP files are valid syntax
- Test with real CV: Upload your own CV and verify output quality
- Customize prompts: Adjust AI prompts in
buildRevampPrompt()andbuildSOPPrompt()for better results - Configure email: Set up SMTP for email delivery
- Install PDF library: For proper PDF output generation
- Monitor costs: If using OpenAI, track API usage
For detailed documentation, see CAREER_TOOLS_README.md
For issues:
- Check PHP error logs
- Check browser console for JavaScript errors
- Verify all files uploaded correctly
- Test with minimal input first
Before going live:
- Set proper error handling (disable display_errors)
- Configure production API keys
- Set up email delivery
- Install PDF generation library
- Test all upload limits
- Set up automated backups
- Configure HTTPS
- Test on production server