Auto-deploy: 2026-06-02 16:37:46

This commit is contained in:
Hamza-Ayed
2026-06-02 16:37:46 +03:00
parent dad9cba7db
commit e153327bba
6 changed files with 433 additions and 12 deletions

View File

@@ -17,7 +17,7 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
// ─── Core API call ─────────────────────────────────────────────────────────── // ─── Core API call ───────────────────────────────────────────────────────────
async function handleGeminiRequest({ apiKey, prompt, tab, action = 'generateText', jobDescription = '', jobTitle = '', postText = '' }) { async function handleGeminiRequest({ apiKey, prompt, tab, action = 'generateText', jobDescription = '', jobTitle = '', postText = '', template = 'default' }) {
// Rate limit check // Rate limit check
const canProceed = await checkRateLimit(); const canProceed = await checkRateLimit();
if (!canProceed) { if (!canProceed) {
@@ -47,7 +47,8 @@ async function handleGeminiRequest({ apiKey, prompt, tab, action = 'generateText
prompt: trimmedPrompt, prompt: trimmedPrompt,
jobDescription: jobDescription, jobDescription: jobDescription,
jobTitle: jobTitle, jobTitle: jobTitle,
postText: postText postText: postText,
template: template
}) })
}); });

View File

@@ -535,7 +535,8 @@
apiKey: settings.apiKey, apiKey: settings.apiKey,
jobDescription: jobData.description, jobDescription: jobData.description,
jobTitle: jobData.jobTitle || 'Job', jobTitle: jobData.jobTitle || 'Job',
action: 'generatePdf' action: 'generatePdf',
template: 'amman'
} }
}, resolve); }, resolve);
}); });

192
cv_market_analysis.md Normal file
View File

@@ -0,0 +1,192 @@
# تحليل سوق عمّان — استراتيجية الـ CV
## نظرة عامة على السوق
### شركات التكنولوجيا المحلية في عمّان (Target Companies)
| الشركة | المجال | الـ Stack الشائع | المسمى الوظيفي المناسب |
|--------|--------|-----------------|----------------------|
| Mawdoo3 | محتوى/AI | PHP, Python, Node.js, AWS | Senior Backend Engineer / Tech Lead |
| Abwaab | EdTech | Node.js, React, PostgreSQL, AWS | Lead Backend Engineer |
| OpenSooq | Classifieds | PHP, MySQL, Redis, AWS | Senior Backend Developer |
| ArabiaWeather | GIS/Data | Python, GIS, APIs | GIS/Backend Developer |
| Liwwa | FinTech | Node.js, Python, PostgreSQL | Senior Backend Engineer |
| JoPACC | FinTech/Payments | Java, Node.js, APIs | Systems Engineer |
| ZenHR | HR Tech/SaaS | PHP, Node.js, MySQL | Senior Software Engineer |
| Atypon | Publishing | Java, Node.js, AWS | Senior Engineer |
### ماذا تبحث عنه شركات عمّان في الـ CV؟
1. **التسليم والتنفيذ (Delivery over Design):** يريدون شخص يبني وينفذ، مش بس يرسم architecture diagrams
2. **الاستمرارية (Retention):** الخوف الأكبر: "هل حيتركنا ويروح عالخليج؟"
3. **العمل الجماعي (Team Player):** يريدون شخص يشتغل مع فريق، يمنتور junior developers
4. **التكلفة (Cost-Conscious):** يحبوا أرقام التوفير — $10K/month قصة قوية
5. **اللغة (Bilingual):** ثنائية اللغة ميزة تنافسية كبيرة
6. **السوق المحلي (Local Market):** فهم السوق الأردني والعربي مهم
7. **الـ Stack المطلوب:** PHP, Node.js, PostgreSQL, AWS, Docker — مش GIS ولا ride-hailing
---
## المشكلة الأساسية مع الـ CV الحالي
### ١. العنوان والـ Positioning
**الحالي:** "Solutions Architect" — هذا عنوان شركات enterprise في الخليج وأوروبا. شركة عمّان ما بتوظف Solutions Architect. بتوظف Senior Backend Engineer أو Tech Lead.
**المطلوب:** استبدال كل mentions الـ "Solutions Architect" بـ: `Senior Backend Engineer & Technical Lead` أو `Lead Backend Engineer — Distributed Systems` حسب الوظيفة.
### ٢. قصة الـ Founder/CTO
**المشكلة:** الـ CV الحالي بيحكي قصة "أنا بنيت شركتين" مش "أنا مهندس ممكن أضيف قيمة لشركتكم."
**الحل:** إعادة صياغة التجربة كلغة delivery و engineering، مش founding:
- ❌ "CTO & Technical Architect — Intaleq"
- ✅ "Technical Lead & Backend Engineer — Intaleq"
- ❌ "Founding Engineer & Lead Backend Architect — Tripz Egypt"
- ✅ "Lead Backend Engineer — Tripz Egypt"
- ❌ "Co-founded and architected..."
- ✅ "Built and scaled..."
### ٣. الـ AI Claim
**الحالي:** عنوان "AI Solutions Architect" مع إن الـ AI experience محدود بـ LLM API integration.
**الحل:**
- حذف "AI" من الـ positioning الأساسي
- ذكر الـ AI tools كمهارة إضافية، مش كتخصص
- إعادة تسمية: Nabih → "Automated Customer Support System" مش "AI Smart Responder"
- إعادة تسمية: Musadaq → "Document Processing Platform" مش "AI-Powered Invoice Processing"
### ٤. الـ Stack Prioritization
**الحالي:** OSM, GraphHopper, MapLibre, PostGIS في المقدمة — هذا stack شخص بنى ride-hailing.
**المطلوب لعمّان:**
1. PHP (Workerman), Node.js, NestJS — أول شيء
2. PostgreSQL, MySQL, Redis
3. Docker, AWS, CI/CD
4. REST APIs, WebSockets, Microservices
5. Flutter (ثانوي)
6. GIS (في الأخير — ميزة إضافية مش أساسية)
### ٥. السطر الـ AI-generated
**الحذف فوراً:**
> *"I leverage my expertise..."*
أي HR في عمّان شايف هاد السطر ١٠٠ مرة من ناس مستخدمين ChatGPT.
### ٦. الفريلانس بدون أسماء
**المشكلة:** "25+ production applications" بدون أسماء شركات أو صناعات.
**الحل:** ذكر الصناعات بوضوح — healthcare, logistics, HR, sports, utilities, fintech — بدون أسماء شركات إذا ما في إذن، لكن الصناعات تبني ثقة.
---
## الـ CV الجديد — الهيكل المقترح لسوق عمّان
### Header
- الاسم: Hamza Ayed
- العنوان: `{{JOB_HEADLINE}}` — يجب أن يكون `Senior Backend Engineer & Technical Lead` أو ما يناسب الوظيفة
- التواصل: عمّان، الأردن (مش Amman, Jordan — أكد الموقع)
### ١. Professional Summary
- التركيز على: delivery، scale، cost savings، MENA experience
- حذف ride-hailing hook الإجباري — استبداله بـ hook عن building production systems
- 3-4 أسطر: من أنا، ماذا بنيت، ماذا أقدم للشركة
### ٢. Technical Skills (مرتبة حسب أولوية سوق عمّان)
```
Core Focus: {{DYNAMIC_SKILLS}} ← AI-generated per job
Backend & Architecture: PHP (Workerman), Node.js, NestJS, Python (FastAPI/Flask), REST APIs, WebSockets, Microservices
Infrastructure & Cloud: Docker, Linux, Nginx, Redis, CI/CD (GitHub Actions), AWS
Databases: PostgreSQL, MySQL, Redis, Database Design & Query Optimization
Geospatial (Supplemental): PostGIS, OpenStreetMap, GraphHopper, MapLibre GL
Mobile: Flutter/Dart, GetX, BLoC/Cubit
```
### ٣. Technical Impact (جديد — يركز على delivery والإنجاز)
- Built platforms serving 6,000+ active users across two markets
- Engineered proprietary mapping infrastructure replacing Google Maps — $10K+/month savings
- Designed high-concurrency WebSocket systems for real-time operations
- Delivered 25+ production applications across healthcare, logistics, fintech, and utilities
- Published open-source SDKs on pub.dev and npm
### ٤. Professional Experience (معاد صياغته)
```
Technical Lead & Backend Engineer — Intaleq | Jan 2024Present | Amman, Jordan
• Built full-stack transportation platform from zero: PHP/Workerman backend, Flutter apps, WebSocket dispatcher — serving 1,800+ drivers
• Developed proprietary mapping platform (NestJS, GraphHopper, OSM, PostGIS) — $10K+/month cost reduction vs Google Maps
• Designed event-driven architecture for real-time matching and tracking
Lead Backend Engineer — Tripz Egypt | Jan 2023Present | Cairo / Remote
• Built complete ride-hailing system: PHP backend, Flutter apps, real-time WebSocket layer, payment integrations
• Engineered driver/rider matching system serving 4,318 drivers — $0.78 customer acquisition cost
• Integrated local payment gateways and automated payout infrastructure
Senior Backend Engineer — Freelance | Jan 2017Dec 2023 | Jordan / Remote
• Delivered 25+ applications for MENA clients: healthcare platforms, logistics systems, HR tools, sports apps, utility dashboards
• Built automated customer support platform (Flutter + PHP backend)
• Developed document processing system using vision models and async pipelines
```
### ٥. Notable Projects
- IntaleqMaps Engine (NestJS, GraphHopper, OSM, PostGIS) — proprietary mapping
- Tripz Egypt Platform — end-to-end ride-hailing
- Automated Customer Support Platform — Flutter + high-concurrency PHP
- Document Processing System — AI vision models + async pipelines
- Meta Ads Manager — multi-tenant SaaS (NestJS/React)
- WhatsApp Bridge — high-concurrency Node.js + headless Puppeteer
### ٦. Open Source (كما هو)
### ٧. Education (كما هو)
### ٨. Languages (كما هو)
### ٩. Availability (معدل لسوق عمّان)
```
Based in Amman, Jordan — Available Immediately
Open to On-site, Hybrid, and Remote roles in Jordan and MENA
```
---
## تغييرات الـ Prompt المطلوبة
### Current Prompt (generatePdf):
```
My title MUST be aligned with 'Solutions Architect', 'Senior Backend Engineer', or 'Senior Mobile Engineer'.
The summary MUST open with exactly this hook: 'Built two production ride-hailing platforms from zero to thousands of users, on proprietary infrastructure, in high-complexity and emerging markets.'
```
### New Prompt (Amman market):
```
My title MUST be aligned with 'Senior Backend Engineer', 'Technical Lead', or 'Lead Backend Engineer'.
NEVER use 'Solutions Architect' or 'AI Developer'.
The summary should open with a hook about building and scaling production systems in the MENA region.
Focus on delivery, cost optimization, and hands-on engineering — not enterprise architecture.
```
---
## ملخص التغييرات على مستوى الملفات
| الملف | التغيير |
|-------|---------|
| `server/cv_template_amman.html` | **جديد** — قالب مخصص لسوق عمّان |
| `server/cv_template.html` | يبقى كما هو (للخليج/enterprise) |
| `server/generate_cv.php` | إضافة `template` parameter + prompt مخصص |
| `prompts.js` | تحديث `cvtips` ليعكس positioning سوق عمّان |
| `linkedin-analyzer/cv_template.html` | مزامنة مع الـ server template |
---
## الخطوات التالية
1. إنشاء `server/cv_template_amman.html`
2. تعديل `generate_cv.php` لدعم template selection
3. تعديل `prompts.js` — تحديث cvtips لسوق عمّان
4. للمستقبل: إنشاء templates إضافية لـ UAE enterprise و FinTech

View File

@@ -32,7 +32,7 @@ STRICT INTEGRITY RULES — VIOLATING THESE IS FORBIDDEN:
${analysisLang} ${analysisLang}
Evaluate this job against my profile with brutal honesty and EXTREME brevity. Evaluate this job against my profile with brutal honesty and EXTREME brevity.
DO NOT recount my history, military background, or summarize my profile. Keep it actionable and short. DO NOT recount my history, military background, or summarize my profile. Keep it actionable and short.
CRITICAL RULE: The user is an elite Solutions Architect and Tech Lead targeting Senior/Lead engineering roles in the GCC Enterprise market. Position his 0-to-1 experience as a massive advantage for scaling systems, not as a risk. Do NOT downgrade his executive presence. CRITICAL RULE: The user is a Senior Backend Engineer and Technical Lead who built and scaled production systems from zero. Position his 0-to-1, hands-on delivery experience as a massive advantage for any engineering team. Do NOT downgrade his technical leadership.
${STRICT_RULES} ${STRICT_RULES}
@@ -89,7 +89,7 @@ CRITICAL RULES:
- NO brackets or placeholders — use ACTUAL names and data - NO brackets or placeholders — use ACTUAL names and data
- Every sentence specific to THIS job at ${co} - Every sentence specific to THIS job at ${co}
- Under 300 words total - Under 300 words total
- Tone MUST be highly professional, McKinsey-style, and executive. Focus on enterprise-scale impact and technical architecture. DO NOT mention military history. DO NOT use buzzwords like "sanctioned markets", "serving millions", "disruptive".`; - Tone MUST be professional, direct, and confident. Focus on delivery, impact, and hands-on engineering. DO NOT mention military history. DO NOT use buzzwords like "sanctioned markets", "serving millions", "disruptive".`;
P.cvtips = `You are a LinkedIn optimization expert and ATS specialist. P.cvtips = `You are a LinkedIn optimization expert and ATS specialist.
IMPORTANT: Respond ENTIRELY in English regardless of the job posting language. IMPORTANT: Respond ENTIRELY in English regardless of the job posting language.
@@ -104,10 +104,10 @@ ${ctx}
Respond EXACTLY: Respond EXACTLY:
## LINKEDIN HEADLINE ## LINKEDIN HEADLINE
[One headline, EXACTLY under 80 characters, ATS-optimized. Format like: Senior Backend Engineer & Systems Architect | PHP, NestJS, GIS | CTO at Intaleq] [One headline, EXACTLY under 80 characters, ATS-optimized. Format like: Senior Backend Engineer & Technical Lead | PHP, NestJS, Docker | Building for Scale]
## PROFESSIONAL SUMMARY ## PROFESSIONAL SUMMARY
[3-4 sentences tailored summary ready to paste — in English. CRITICAL: Use a McKinsey-style, executive, and highly professional tone. Focus purely on technical architecture, enterprise-scale impact, and business value. DO NOT mention military history. DO NOT use buzzwords like "sanctioned markets", "serving millions", "solo-adapted", "disruptive", "cutting-edge". DO NOT invent industries like "banking" unless they are in MY PROFILE.] [3-4 sentences tailored summary ready to paste — in English. CRITICAL: Focus on delivery, cost optimization, and hands-on engineering. Use a professional, direct, no-fluff tone. Emphasize impact: what you built, numbers you achieved, problems you solved. DO NOT use academic or AI-generated phrases like 'I leverage my expertise'. DO NOT invent industries like 'banking' unless they are in MY PROFILE.]
## ATS KEYWORDS TO ADD ## ATS KEYWORDS TO ADD
- [10-15 specific keywords from this job that MUST appear in CV] - [10-15 specific keywords from this job that MUST appear in CV]

View File

@@ -0,0 +1,200 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
font-variant-ligatures: none;
font-feature-settings: "liga" 0, "clig" 0;
letter-spacing: 0px;
text-rendering: geometricPrecision;
font-size: 13px;
color: #222;
line-height: 1.4;
margin: 0;
padding: 15px 30px;
}
.header {
text-align: center;
border-bottom: 2px solid #1a237e;
padding-bottom: 10px;
margin-bottom: 15px;
}
h1 {
font-size: 28px;
color: #1a237e;
margin: 0 0 5px 0;
text-transform: uppercase;
letter-spacing: 1px;
}
.headline {
font-size: 16px;
font-weight: bold;
color: #424242;
margin-bottom: 5px;
}
.contact {
font-size: 12px;
color: #555;
}
.section-title {
font-size: 15px;
font-weight: bold;
color: #1a237e;
border-bottom: 1px solid #ddd;
margin-top: 15px;
margin-bottom: 6px;
padding-bottom: 4px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
p { margin: 0 0 6px 0; text-align: justify; }
.job-block { margin-bottom: 10px; }
.job-header {
width: 100%;
margin-bottom: 5px;
display: table;
}
.job-title {
font-weight: bold;
font-size: 13.5px;
color: #222;
float: left;
width: 70%;
line-height: 1.3;
}
.job-meta {
font-size: 11px;
color: #1a237e;
font-weight: bold;
float: right;
width: 28%;
text-align: right;
}
.clear { clear: both; }
ul { margin: 4px 0 8px 0; padding-left: 20px; }
li { margin-bottom: 4px; text-align: justify; }
</style>
</head>
<body>
<div class="header">
<h1>Hamza Ayed</h1>
<div class="headline">{{JOB_HEADLINE}}</div>
<div class="contact">
Amman, Jordan | +962 79 858 3052 | <a href="mailto:hamzaayed.dev@gmail.com" style="color: #555; text-decoration: none;">hamzaayed.dev@gmail.com</a><br>
<a href="https://linkedin.com/in/hamza-ayed" style="color: #555; text-decoration: none; font-weight: bold;">linkedin.com/in/hamza-ayed</a> |
<a href="https://github.com/Hamza-Ayed" style="color: #555; text-decoration: none; font-weight: bold;">github.com/Hamza-Ayed</a> |
<a href="https://intaleqapp.com/hamza.html" style="color: #1a237e; text-decoration: underline; font-weight: bold;">intaleqapp.com/hamza.html (Portfolio)</a>
</div>
</div>
<div class="section-title">Professional Summary</div>
<p>{{TAILORED_SUMMARY}}</p>
<div class="section-title">Technical Skills</div>
<p><strong>Core Focus:</strong> {{DYNAMIC_SKILLS}}</p>
<p><strong>Backend &amp; Architecture:</strong> PHP (Workerman), Node.js, NestJS, Python (FastAPI/Flask), REST APIs, WebSockets, Microservices</p>
<p><strong>Infrastructure &amp; Cloud:</strong> Docker, Linux, Nginx, Redis, CI/CD (GitHub Actions), AWS</p>
<p><strong>Databases:</strong> PostgreSQL, MySQL, Redis, Database Design &amp; Query Optimization</p>
<p><strong>Geospatial (Supplemental):</strong> PostGIS, OpenStreetMap (OSM), GraphHopper, MapLibre GL, Spatial Queries</p>
<p><strong>Mobile:</strong> Flutter/Dart, GetX, BLoC/Cubit</p>
<div class="section-title">Impact &amp; Delivery</div>
<ul>
<li>Built and scaled platforms serving 6,000+ active users across two markets with zero downtime deployments</li>
<li>Engineered proprietary OSM-based mapping infrastructure replacing Google Maps APIs across the MENA region — saving $10,000+/month in operational costs</li>
<li>Designed high-concurrency WebSocket systems handling real-time operations at scale</li>
<li>Delivered 25+ production applications across healthcare, logistics, fintech, and utilities for MENA clients</li>
<li>Published open-source mapping SDKs on pub.dev and npm, used in production environments</li>
</ul>
<div class="section-title">Professional Experience</div>
<div class="job-block">
<div class="job-header">
<div class="job-title">Technical Lead &amp; Backend Engineer — Intaleq &nbsp;|&nbsp;</div>
<div class="job-meta">January 2024 Present | Amman, Jordan</div>
<div class="clear"></div>
</div>
<ul>
<li>Built full-stack transportation platform from zero to production: PHP/Workerman backend, Flutter mobile apps, WebSocket-based real-time dispatcher — serving 1,800+ active drivers.</li>
<li>Developed proprietary mapping platform (IntaleqMaps) orchestrating GraphHopper routing, OSM tile serving, and PostGIS spatial queries via a NestJS API layer — reducing mapping API costs by $10,000+/month.</li>
<li>Designed event-driven architecture for real-time driver/rider matching, live tracking, and automated fare calculation.</li>
</ul>
</div>
<div class="job-block">
<div class="job-header">
<div class="job-title">Lead Backend Engineer — Tripz Egypt &nbsp;|&nbsp;</div>
<div class="job-meta">Jan 2023 Present | Cairo / Remote</div>
<div class="clear"></div>
</div>
<ul>
<li>Built complete ride-hailing platform: PHP backend system, Flutter rider and driver apps, real-time WebSocket communication layer, and local payment gateway integrations.</li>
<li>Engineered event-driven driver/rider matching system serving 4,318 drivers with a $0.78 customer acquisition cost — the lowest in the Egyptian market.</li>
<li>Integrated local digital payment gateways and designed automated driver payout infrastructure supporting an 8% commission model.</li>
</ul>
</div>
<div class="job-block">
<div class="job-header">
<div class="job-title">Senior Backend Engineer — Freelance &nbsp;|&nbsp;</div>
<div class="job-meta">Jan 2017 Dec 2023 | Jordan / Remote</div>
<div class="clear"></div>
</div>
<ul>
<li>Delivered 25+ applications for MENA clients across healthcare, logistics, HR technology, sports platforms, and utility management systems — full lifecycle from architecture to deployment.</li>
<li>Built automated customer support platform: designed Flutter application (GetX/Cubit) connected to high-concurrency PHP backend APIs handling real-time query resolution.</li>
<li>Developed document processing system: engineered async processing pipelines using vision models for automated KYC and invoice data extraction.</li>
</ul>
</div>
<div class="section-title">Notable Projects</div>
<ul>
<li><strong>IntaleqMaps Engine:</strong> Proprietary mapping platform orchestrating GraphHopper routing, OSM tile serving, and PostGIS spatial queries via a NestJS API layer — replacing Google Maps API across the MENA region.</li>
<li><strong>Tripz Egypt Platform:</strong> End-to-end ride-hailing system with 8 ride types, real-time matching, custom payment infrastructure, and AI-powered KYC verification.</li>
<li><strong>Customer Support Automation Platform:</strong> Built an automated query resolution system connecting a Flutter application (GetX/Cubit) to high-concurrency PHP backend APIs.</li>
<li><strong>Document Processing Platform:</strong> Engineered automated KYC and invoice processing using vision models and asynchronous processing pipelines.</li>
<li><strong>Meta Ads Manager (SaaS):</strong> Deployed multi-tenant platform using NestJS/React for automated ad campaign management.</li>
<li><strong>WhatsApp Bridge:</strong> High-concurrency Node.js service managing headless Puppeteer sessions in Docker for automated messaging operations.</li>
</ul>
<div class="section-title">Open Source Contributions</div>
<ul>
<li><strong>intaleq_maps (Flutter SDK):</strong> Published on <a href="https://pub.dev/packages/intaleq_maps" style="color: #1a237e; text-decoration: none; font-weight: bold;">pub.dev/packages/intaleq_maps</a>. Custom map rendering, offline caching, and route plotting package optimized for low-bandwidth environments.</li>
<li><strong>intaleq-maps-gl (NPM Library):</strong> Published on <a href="https://libraries.io/npm/intaleq-maps-gl" style="color: #1a237e; text-decoration: none; font-weight: bold;">npmjs.com/package/intaleq-maps-gl</a>. Web-based Mapbox GL compatible library optimized for custom OSM tiles and routing integration.</li>
</ul>
<div class="section-title">Education &amp; Certifications</div>
<ul>
<li><strong>BS Mathematics (Applied Computing &amp; Algorithms)</strong>, Mutah University (20032007)</li>
<li><strong>Google Data Analytics</strong> Professional Certificate (Coursera)</li>
<li><strong>IBM Data Analyst</strong> Professional Certificate (Coursera)</li>
<li><strong>Meta APIs &amp; Django Web Framework</strong> Course Certificates (Coursera)</li>
<li><strong>AWS Cloud Practitioner &amp; Cloud Architecture Fundamentals</strong></li>
</ul>
<div class="section-title">Languages</div>
<p><strong>Arabic:</strong> Native | <strong>English:</strong> Professional Working Proficiency | <strong>Turkish:</strong> Limited Working Proficiency</p>
<div class="section-title">Availability</div>
<p style="text-align: center; font-weight: bold; color: #1a237e; margin-top: 10px;">
Based in Amman, Jordan — Available Immediately | Open to On-site, Hybrid &amp; Remote Roles in Jordan &amp; MENA
</p>
</body>
</html>

View File

@@ -57,7 +57,28 @@ $geminiUrl = "https://generativelanguage.googleapis.com/v1beta/models/{$model}:g
// ========================================== // ==========================================
if ($action === 'generatePdf') { if ($action === 'generatePdf') {
$jobDescription = $data['jobDescription'] ?? ''; $jobDescription = $data['jobDescription'] ?? '';
$template = $data['template'] ?? 'default'; // 'amman' or 'default'
// --- Amman Market Prompt (Senior Backend Engineer & Technical Lead) ---
if ($template === 'amman') {
$prompt = "You are an expert ATS CV tailor for the Jordan/Amman local tech market. Read the following job description and generate tailored content.
STRICT INTEGRITY RULES:
1. NEVER invent skills I do not have. My TRUE technical stack is: PHP (Workerman), Node.js, NestJS, Python (FastAPI/Flask), PostgreSQL/PostGIS, Docker, Flutter, GetX, BLoC, WebSockets, OpenStreetMap.
2. Do NOT add data science skills like TensorFlow, PyTorch, Scikit-learn, Hadoop, or MLOps.
3. My title MUST be aligned with 'Senior Backend Engineer', 'Technical Lead', or 'Lead Backend Engineer'. NEVER use 'Solutions Architect', 'AI Developer', or 'CTO'.
Return ONLY a valid JSON object with EXACTLY three keys: 'headline', 'summary', and 'skills'.
The 'headline' should be a clean, confident title based on my TRUE skills — matching Amman market expectations (Senior/Lead Backend Engineer).
The 'summary' should open with a hook about building and scaling production systems in the MENA region, emphasizing delivery, cost optimization, and hands-on engineering. Connect my real achievements to the job requirements. Keep it professional and direct — NO academic fluff, NO 'I leverage my expertise' phrases.
The 'skills' should be a comma-separated list of 10 highly relevant ATS keywords from MY ACTUAL SKILLS that match the job. Prioritize backend, API, database, and infrastructure skills over GIS.
Do NOT use markdown blocks like ```json, just return raw JSON text.
Job Description:
" . substr($jobDescription, 0, 4000);
}
// --- Default Prompt (Current — Enterprise/GCC) ---
else {
$prompt = "You are an expert ATS CV tailor. Read the following job description and generate tailored content for my CV to maximize my chances of getting an interview. $prompt = "You are an expert ATS CV tailor. Read the following job description and generate tailored content for my CV to maximize my chances of getting an interview.
STRICT INTEGRITY RULES: STRICT INTEGRITY RULES:
@@ -73,6 +94,7 @@ Do NOT use markdown blocks like ```json, just return raw JSON text.
Job Description: Job Description:
" . substr($jobDescription, 0, 4000); " . substr($jobDescription, 0, 4000);
}
$payload = json_encode([ $payload = json_encode([
"contents" => [["parts" => [["text" => $prompt]]]], "contents" => [["parts" => [["text" => $prompt]]]],
@@ -99,12 +121,17 @@ Job Description:
$aiText = str_replace(['```json', '```'], '', $aiText); $aiText = str_replace(['```json', '```'], '', $aiText);
$parsedJson = json_decode(trim($aiText), true); $parsedJson = json_decode(trim($aiText), true);
$headline = $parsedJson['headline'] ?? "Solutions Architect & Technical Leader"; $defaultHeadline = ($template === 'amman')
? "Senior Backend Engineer & Technical Lead"
: "Solutions Architect & Technical Leader";
$headline = $parsedJson['headline'] ?? $defaultHeadline;
$summary = $parsedJson['summary'] ?? "Experienced professional with a strong background in software engineering."; $summary = $parsedJson['summary'] ?? "Experienced professional with a strong background in software engineering.";
$skills = $parsedJson['skills'] ?? "Architecture, APIs, Cloud, Backend Systems, System Design"; $skills = $parsedJson['skills'] ?? "Architecture, APIs, Cloud, Backend Systems, System Design";
$templatePath = __DIR__ . '/cv_template.html'; $templateFile = ($template === 'amman')
$html = file_get_contents($templatePath); ? __DIR__ . '/cv_template_amman.html'
: __DIR__ . '/cv_template.html';
$html = file_get_contents($templateFile);
$html = str_replace('{{JOB_HEADLINE}}', htmlspecialchars($headline), $html); $html = str_replace('{{JOB_HEADLINE}}', htmlspecialchars($headline), $html);
$html = str_replace('{{TAILORED_SUMMARY}}', htmlspecialchars($summary), $html); $html = str_replace('{{TAILORED_SUMMARY}}', htmlspecialchars($summary), $html);
$html = str_replace('{{DYNAMIC_SKILLS}}', htmlspecialchars($skills), $html); $html = str_replace('{{DYNAMIC_SKILLS}}', htmlspecialchars($skills), $html);