Dashboard
AI system online
LY

Build. Market. Grow. 🚀

Your AI-powered business workspace for creating content, generating leads, improving sales and growing your business.

AI Generations 0 This session
Content Planned 30 Day calendar
Lead Ideas 0 Generated by AI
Connected Channels 0 Social accounts

AI Marketing Tools

🧠 AI Marketing Strategy

AI Strategy

Your strategy will appear here.

✍️ Copy Generator

Generated Copy

Your copy will appear here.

📱 Social Content

Your social content will appear here.

🎯 Lead Generator

Your lead-generation system will appear here.

📧 Email Campaigns

Your campaign will appear here.

💰 Sales Booster

Your sales recommendations will appear here.

📊 Marketing Analyzer

Your analysis will appear here.

📅 30-Day Content Calendar

🎬 AI Creative Studio

🎨 Image Prompt Generator

Your image-generation prompt will appear here.

🎬 Video Generator

Your video script and shot list will appear here.

🔗 Social Connections

Connection API Status

Press Check API to test the connection.

🗂️ Generation History

Tool Preview Time
No generations yet.
/* ========================= MARKETAI BUTTON FIX ========================= */ document.addEventListener("DOMContentLoaded", function () { function getValue(id) { const el = document.getElementById(id); return el ? el.value.trim() : ""; } async function marketAI(prompt, outputId) { const output = document.getElementById(outputId); if (output) { output.textContent = "MarketAI is thinking..."; } try { const response = await fetch("/api/generate", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ prompt: prompt }) }); const text = await response.text(); if (!response.ok) { throw new Error(text || "AI request failed"); } let result = text; try { const data = JSON.parse(text); result = data.output || data.result || data.response || data.text || text; } catch (e) {} if (output) { output.textContent = result; } toast("Done! ✨"); } catch (error) { console.error("MarketAI error:", error); if (output) { output.textContent = "MarketAI AI connection error:\n\n" + error.message; } toast("AI request failed"); } } /* STRATEGY */ const strategyBtn = document.getElementById("strategyBtn"); if (strategyBtn) { strategyBtn.addEventListener("click", function () { const input = getValue("strategyInput"); if (!input) { toast("Enter your business information first."); return; } marketAI( "Create a complete practical marketing strategy for this business. Include target audience, positioning, content strategy, lead generation, sales strategy and a 7-day action plan.\n\nBusiness:\n" + input, "strategyOutput" ); }); } /* COPY GENERATOR */ const copyBtn = document.getElementById("copyBtn"); if (copyBtn) { copyBtn.addEventListener("click", function () { const input = getValue("copyInput"); if (!input) { toast("Enter what you want to create."); return; } const type = document.getElementById("copyType")?.value || "social media caption"; marketAI( "Create a professional and persuasive " + type + " for this business. Include a strong hook and clear call to action.\n\n" + input, "copyOutput" ); }); } /* SOCIAL CONTENT */ const socialBtn = document.getElementById("socialBtn"); if (socialBtn) { socialBtn.addEventListener("click", function () { const input = getValue("socialInput"); if (!input) { toast("Enter your business information."); return; } const platform = document.getElementById("platform")?.value || "Instagram"; marketAI( "Create a social media content package for " + platform + ". Include a powerful hook, caption, CTA, hashtags and visual idea.\n\nBusiness:\n" + input, "socialOutput" ); }); } /* LEAD GENERATOR */ const leadBtn = document.getElementById("leadBtn"); if (leadBtn) { leadBtn.addEventListener("click", function () { const input = getValue("leadInput"); if (!input) { toast("Enter your business information."); return; } marketAI( "Create a lead-generation system for this business. Include lead magnets, customer acquisition ideas, outreach angles, content ideas and a simple conversion funnel.\n\nBusiness:\n" + input, "leadOutput" ); }); } /* EMAIL CAMPAIGNS */ const emailBtn = document.getElementById("emailBtn"); if (emailBtn) { emailBtn.addEventListener("click", function () { const input = getValue("emailInput"); if (!input) { toast("Enter your campaign information."); return; } marketAI( "Create a professional 5-email marketing campaign. Include subject lines and complete email copy.\n\nCampaign:\n" + input, "emailOutput" ); }); } /* SALES BOOSTER */ const salesBtn = document.getElementById("salesBtn"); if (salesBtn) { salesBtn.addEventListener("click", function () { const input = getValue("salesInput"); if (!input) { toast("Enter your offer information."); return; } marketAI( "Analyze this offer and improve its value proposition, positioning, CTA, sales messaging, objections and conversion strategy.\n\nOffer:\n" + input, "salesOutput" ); }); } /* MARKETING ANALYZER */ const analyzerBtn = document.getElementById("analyzerBtn"); if (analyzerBtn) { analyzerBtn.addEventListener("click", function () { const input = getValue("analyzerInput"); if (!input) { toast("Enter something to analyze."); return; } marketAI( "Analyze this marketing content. Give a score out of 100, strengths, weaknesses, target audience fit, clarity, conversion potential and specific improvements.\n\nContent:\n" + input, "analyzerOutput" ); }); } /* 30-DAY CALENDAR */ const calendarBtn = document.getElementById("calendarBtn"); if (calendarBtn) { calendarBtn.addEventListener("click", function () { const grid = document.getElementById("calendarGrid"); if (!grid) { toast("Calendar area not found."); return; } const ideas = [ "Educational tip", "Product showcase", "Customer problem", "Behind the scenes", "FAQ", "Customer result", "Quick tutorial", "Myth vs fact", "Industry insight", "Offer", "Founder story", "Testimonial", "Common mistake", "Checklist", "Motivation", "Product feature", "Case study", "Comparison", "Poll", "Brand story", "Objection handling", "Value post", "Special offer", "Community post", "Educational carousel", "Trend", "How it works", "Customer story", "Sales tip", "Monthly recap" ]; grid.innerHTML = ""; ideas.forEach(function (idea, index) { const day = document.createElement("div"); day.className = "day"; day.innerHTML = "Day " + (index + 1) + "
" + idea; grid.appendChild(day); }); toast("30-day calendar created 📅"); }); } /* CONNECTION CHECK */ const connectionBtn = document.getElementById("checkConnections"); if (connectionBtn) { connectionBtn.addEventListener( "click", async function () { const output = document.getElementById( "connectionStatus" ); if (output) { output.textContent = "Checking MarketAI connections..."; } try { const response = await fetch("/api/connections"); const text = await response.text(); if (!response.ok) { throw new Error(text); } if (output) { output.textContent = "Connections API is online.\n\n" + text; } toast("Connections API is online ✅"); } catch (error) { if (output) { output.textContent = "Connection error:\n\n" + error.message; } toast("Connection check failed"); } } ); } console.log( "MarketAI button fix loaded successfully." ); });