Initial commit: LinkedIn Analyzer with Gemini 2.5 Flash and PHP Backend

This commit is contained in:
Hamza-Ayed
2026-05-17 01:28:17 +03:00
commit 8445affc78
18 changed files with 3323 additions and 0 deletions

206
prompts.js Normal file
View File

@@ -0,0 +1,206 @@
// prompts.js — All AI prompts v3
// LANGUAGE RULES: Analysis = match job language. Everything else = ENGLISH ALWAYS.
function buildPromptV2(tab, job, userProfile, language) {
// Only analysis follows job language; rest is always English
const analysisLang = language === 'arabic' ? 'Respond entirely in Arabic.'
: language === 'english' ? 'Respond entirely in English.'
: 'Respond in the same language as the job posting.';
const ctx = [
'Job Title: ' + (job.jobTitle || 'Not specified'),
'Company: ' + (job.company || 'Not specified'),
'Location: ' + (job.location || 'Not specified'),
'Type: ' + (job.jobType || 'Not specified'),
'Description:\n' + (job.description || 'No description available'),
job.skills.length ? 'Required Skills: ' + job.skills.join(', ') : ''
].filter(Boolean).join('\n');
const prof = 'MY PROFESSIONAL PROFILE:\n' + userProfile;
const co = job.company || 'this company';
const loc = job.location || 'Middle East';
const P = {};
P.analysis = `You are an elite career strategist with 15+ years hiring for top tech companies in MENA.
${analysisLang}
Perform a DEEP strategic analysis. Be brutally honest and specific.
${prof}
JOB POSTING:
${ctx}
IMPORTANT: Analyze the ACTUAL job being shown: "${job.jobTitle}" at "${job.company}". Do NOT confuse with any other role.
Respond in this EXACT structure:
## MATCH SCORE: X/100
### Score Breakdown:
- **Technical Skills Match:** X/30 — [1-line why]
- **Experience Level Match:** X/25 — [1-line why]
- **Domain/Industry Match:** X/20 — [1-line why]
- **Location & Logistics:** X/15 — [1-line why]
- **Culture & Soft Skills:** X/10 — [1-line why]
## WHERE I CRUSH IT
- [specific skills from MY profile that match job requirements]
## HONEST GAPS
- [what the job asks that I am missing — be specific]
## STRATEGIC ANGLE
How should I position myself? What is my unfair advantage?
## VERDICT
**[APPLY NOW / APPLY WITH PREP / LONG SHOT / SKIP]**
[2-3 sentence honest reasoning. If SKIP: explain why this job is not suitable and I should not waste time on it.]
## BEST CV TO USE
**[Solutions Architect / Flutter Developer / GIS Developer / FinTech Engineer]**
[Why this variant and what 2-3 bullet points to modify]
## APPLICATION STRATEGY
- [3-5 tactical steps to maximize chances]`;
P.coverletter = `You are an expert career writer. Write a COMPLETE, READY-TO-SEND cover letter.
IMPORTANT: Write ENTIRELY in English regardless of the job posting language.
${prof}
JOB:
${ctx}
FORMAT — follow EXACTLY:
Dear ${co} Team,
[PARAGRAPH 1 — HOOK (3 sentences max): Compelling connection between my background and this role. Mention the company by name. NO generic "I am writing to apply" openers.]
[PARAGRAPH 2 — PROOF (4-5 sentences): Match 3-4 job requirements to my REAL achievements with NUMBERS. Use "At Intaleq, I..." or "When building Tripz, I..." Be concrete.]
[PARAGRAPH 3 — CLOSE (2-3 sentences): Enthusiasm for THIS company. Confident call to action requesting an interview.]
Best regards,
Hamza Ayed
hamzaayed@intaleqapp.com
+962 79 858 3052
CRITICAL RULES:
- MUST be in English
- NO brackets or placeholders — use ACTUAL names and data
- Every sentence specific to THIS job at ${co}
- Under 300 words total`;
P.cvtips = `You are a LinkedIn optimization expert and ATS specialist.
IMPORTANT: Respond ENTIRELY in English regardless of the job posting language.
${prof}
JOB:
${ctx}
Respond EXACTLY:
## LINKEDIN HEADLINE
[One headline, max 120 chars, ATS-optimized for this role]
## PROFESSIONAL SUMMARY
[3-4 sentences tailored summary ready to paste — in English]
## ATS KEYWORDS TO ADD
- [10-15 specific keywords from this job that MUST appear in CV]
## EXPERIENCE TO LEAD WITH
- [Which role first and which 3-4 bullet points to highlight]
## REMOVE OR MINIMIZE
- [What to de-emphasize for this application]
## SKILLS SECTION (priority order)
1. [Most important skill]
2. [Second]
3. [Continue 8-10 skills]
## NEW BULLET POINTS TO ADD
- [2-3 new achievement bullets ready to paste into CV — in English]`;
P.qa = `You are a career coach. Generate ready-to-paste application answers.
IMPORTANT: ALL answers MUST be in English regardless of the job posting language.
${prof}
JOB:
${ctx}
Generate answers for ALL:
## 1. Why are you interested in this role?
[3-4 sentences specific to ${co} and this role — in English]
## 2. Why ${co}?
[2-3 sentences referencing something specific about the company]
## 3. Relevant experience
[4-5 sentences — most relevant achievements for this role]
## 4. Expected salary
[Competitive range for ${loc} market — USD and local currency]
## 5. When can you start?
Available immediately or within 2 weeks.
## 6. Visa sponsorship needed?
Based in Jordan. Open to relocation. Willing to process visa requirements.
## 7. Notice period
Available immediately — currently seeking new opportunities.
## 8. Willing to relocate?
Yes, open to ${loc} and broader Middle East.
## 9. Why are you the best candidate?
[3-4 sentences — unique differentiators for THIS role]
## 10. Key technology experience
[Identify top 2-3 technologies from the job description and write specific answers about my experience]
RULES: ALL answers in English. Ready to paste. No brackets. Concise. Use numbers.`;
P.benefits = `You are a career analyst specializing in tech compensation in MENA.
IMPORTANT: Respond ENTIRELY in English regardless of the job posting language.
${prof}
JOB:
${ctx}
Respond EXACTLY:
## COMPENSATION ESTIMATE
- **Mentioned salary:** [exact text or "Not disclosed"]
- **Market estimate:** [realistic range in USD based on role, seniority, location]
- **Benefits listed:** [bonuses, equity, insurance]
## WORK SETUP
- **Type:** [Remote / Hybrid / On-site]
- **Location:** [where + relocation support]
## CAREER VALUE
- **Growth potential:** [what this leads to in 2-3 years]
- **Skills I will gain:** [new skills/tech]
- **Resume value:** [how it improves my CV]
## WHAT IS ATTRACTIVE
- [3-5 appealing aspects for MY profile]
## RED FLAGS
- [Concerning requirements or red flags]
## OVERALL RATING: X/10
**Worth applying?** [YES / MAYBE / NO]
[2-3 sentence honest assessment]`;
return P[tab] || P.analysis;
}