From 6fe463b02922c40f91fca92645ad6224aeb97eb2 Mon Sep 17 00:00:00 2001 From: Kyle Belanger Date: Sat, 22 Feb 2025 06:31:01 -0500 Subject: [PATCH] add test mode --- public/index.html | 14 ++++++++++ public/js/test.js | 68 +++++++++++++++++++++++++++++++++++++++++++++++ server.js | 4 +++ 3 files changed, 86 insertions(+) create mode 100644 public/js/test.js diff --git a/public/index.html b/public/index.html index 50fccdb..c34b1ba 100644 --- a/public/index.html +++ b/public/index.html @@ -46,6 +46,20 @@ + + \ No newline at end of file diff --git a/public/js/test.js b/public/js/test.js new file mode 100644 index 0000000..9560ed3 --- /dev/null +++ b/public/js/test.js @@ -0,0 +1,68 @@ +// This script is used for Testing Purposes +// Will only load if ENV TEST_MODE is set to true +// Script loads test data, displays all elements as needs, and stops LLM's from running + +const MOCK_CANDIDATE_PROFILE ={ + name: "James Bond", + location: "England", + experience: "MI6 British Secret Intelligence Service", + skills: ["Espionage", "Multilingual", "Cybersecurity", "Combat"] +}; + +const MOCK_JOB_DESCRIPTION = "A prestigious private security firm is seeking an experienced professional to provide elite security consulting for high-profile clients."; +const MOCK_KEY_POINTS = "Strong skills in security, business intelligence, and combat."; +const MOCK_COVER_LETTER = ` +Dear Hiring Manager, + +As a former MI6 operative, I have conducted global intelligence missions, +provided executive protection under extreme conditions, +and developed strategic security solutions for sensitive operations. +My expertise in counter-surveillance, crisis management, +and tactical response makes me uniquely suited to safeguarding elite clients and corporate assets. +Additionally, my ability to navigate high-society settings while maintaining vigilance ensures seamless security without disruption. + +Sincerely, +James Bond +`; + +const MOCK_TAILORED_RESUME = ` +James Bond +England | bond.james@shakennotstired.com | (555)555-5555 + +PROFESSIONAL SUMMARY +Former MI6 intelligence officer with extensive experience in high-stakes security, risk assessment, and executive protection. + +TECHNICAL SKILLS +ā€¢ Executive Protection & Risk Mitigation +ā€¢ Counterintelligence & Surveillance +ā€¢ Tactical & Evasive Driving +`; + + +// Function to populate test data +function populateTestData() { + document.getElementById('resumePreviewSection').style.display = "grid" + document.getElementById('profileJson').value = JSON.stringify(MOCK_CANDIDATE_PROFILE, null, 2); + document.getElementById('jobDescription').value = MOCK_JOB_DESCRIPTION; + document.getElementById('keyPoints').value = MOCK_KEY_POINTS; +} + + // Function to simulate cover letter and resume generation +function simulateGeneration() { + document.getElementById('coverLetterOutput').value = MOCK_COVER_LETTER; + document.getElementById('tailoredResumeOutput').value = MOCK_TAILORED_RESUME; + document.getElementById('keyResumeUpdates').textContent = "ā€¢ Skills section updated to emphasize SQL, R, and automation.\nā€¢ Summary tailored to match job description."; + + document.getElementById('coverLetterSection').style.display = "grid"; + document.getElementById('tailoredResumeSection').style.display = "grid"; +} + + +// Override the generate button functionality +document.getElementById("generateCoverLetterBtn").addEventListener("click", function(event) { + event.preventDefault(); + simulateGeneration(); +}); + + +populateTestData() diff --git a/server.js b/server.js index 9bc4e29..ec8b0ba 100644 --- a/server.js +++ b/server.js @@ -16,6 +16,10 @@ app.use(express.json()); const generateRoute = require('./routes/generate'); app.use('/generate', generateRoute); +app.get('/env', (req,res) => { + res.json({TEST_MODE: process.env.TEST_MODE || false}) +}) + app.listen(PORT, () => { console.log(`Server running on http://localhost:${PORT}`); });