From fe87f4ad6a9b1f74735be77f508d8acbcb0bb5bd Mon Sep 17 00:00:00 2001 From: Jaya Prasad Kavuru Date: Tue, 28 Apr 2026 13:33:22 +0530 Subject: [PATCH] feat: Integrate Explore Apps studio with backend parity and premium dark theme --- app/layout.js | 8 +- components/StandaloneShell.js | 7 +- packages/studio/src/components/AppsStudio.jsx | 377 ++++++++++++++++++ packages/studio/src/index.js | 1 + packages/studio/src/muapi.js | 30 ++ 5 files changed, 421 insertions(+), 2 deletions(-) create mode 100644 packages/studio/src/components/AppsStudio.jsx diff --git a/app/layout.js b/app/layout.js index 48922f9..5b9cc0d 100644 --- a/app/layout.js +++ b/app/layout.js @@ -1,4 +1,10 @@ import './globals.css'; +import { Inter } from "next/font/google"; + +const inter = Inter({ + variable: "--font-inter", + subsets: ["latin"], +}); export const metadata = { title: 'Open Generative AI — Free AI Image & Video Studio', @@ -8,7 +14,7 @@ export const metadata = { export default function RootLayout({ children }) { return ( - {children} + {children} ); } diff --git a/components/StandaloneShell.js b/components/StandaloneShell.js index 699dca5..be910b8 100644 --- a/components/StandaloneShell.js +++ b/components/StandaloneShell.js @@ -2,7 +2,7 @@ import { useState, useEffect, useCallback } from 'react'; import { useParams, useRouter } from 'next/navigation'; -import { ImageStudio, VideoStudio, LipSyncStudio, CinemaStudio, MarketingStudio, WorkflowStudio, AgentStudio, getUserBalance } from 'studio'; +import { ImageStudio, VideoStudio, LipSyncStudio, CinemaStudio, MarketingStudio, WorkflowStudio, AgentStudio, AppsStudio, getUserBalance } from 'studio'; import axios from 'axios'; import ApiKeyModal from './ApiKeyModal'; @@ -14,6 +14,7 @@ const TABS = [ { id: 'marketing', label: 'Marketing Studio' }, { id: 'workflows', label: 'Workflows' }, { id: 'agents', label: 'Agents' }, + { id: 'apps', label: 'Explore Apps' }, ]; const STORAGE_KEY = 'muapi_key'; @@ -44,6 +45,7 @@ export default function StandaloneShell() { const getInitialTab = () => { if (idFromParams || slug.includes('workflow')) return 'workflows'; if (slug.includes('agents')) return 'agents'; + if (slug.includes('apps')) return 'apps'; const firstSegment = slug[0]; if (firstSegment && TABS.find(t => t.id === firstSegment)) return firstSegment; return 'image'; @@ -68,6 +70,8 @@ export default function StandaloneShell() { setActiveTab('workflows'); } else if (slug.includes('agents')) { setActiveTab('agents'); + } else if (slug.includes('apps')) { + setActiveTab('apps'); } else { const firstSegment = slug[0]; if (firstSegment && TABS.find(t => t.id === firstSegment)) { @@ -306,6 +310,7 @@ export default function StandaloneShell() { {activeTab === 'marketing' && } {activeTab === 'workflows' && } {activeTab === 'agents' && } + {activeTab === 'apps' && } {/* Settings Modal */} diff --git a/packages/studio/src/components/AppsStudio.jsx b/packages/studio/src/components/AppsStudio.jsx new file mode 100644 index 0000000..cd6b752 --- /dev/null +++ b/packages/studio/src/components/AppsStudio.jsx @@ -0,0 +1,377 @@ +"use client"; + +import React, { useState, useEffect } from 'react'; +import { + FaUserTie, FaImage, FaMagic, FaVideo, FaFileAlt, + FaBriefcase, FaHome, FaMicrophone, FaHandSparkles, FaBuilding, + FaUserInjured, FaStethoscope, FaCar, FaPaw, FaBalanceScale, FaTruck, FaMapMarkerAlt, + FaGithub, FaExternalLinkAlt, FaDollarSign, FaRocket, FaCreditCard +} from "react-icons/fa"; +import { registerAppInterest, getAppInterests } from '../muapi.js'; +import toast, { Toaster } from 'react-hot-toast'; + +const templateApps = [ + { + name: "AI Headshot Studio", + description: "Launch a headshot SaaS in minutes. Charge $5–$20 per set, keep all profits. Stripe payments & user accounts included.", + icon: FaUserTie, + color: "blue", + repo: "https://github.com/SamurAIGPT/ai-headshot-generator", + hosted: "https://ai-headshot-generator-xi.vercel.app/", + thumbnail: "https://cdn.muapi.ai/apps/d9c39378f60e48098f6b6ce657dc18b5.png", + isTemplate: true + }, + { + name: "Nano Banana Studio", + description: "Your own AI image generation platform, ready to monetize. Add credit packs or subscriptions and start earning from day one.", + icon: FaHandSparkles, + color: "amber", + repo: "https://github.com/SamurAIGPT/nano-banana-generator", + hosted: "https://nano-banana-generator-psi.vercel.app", + thumbnail: "https://cdn.muapi.ai/data/2/874086171651/Screenshot_2026-04-15_103743.png", + isTemplate: true + }, + { + name: "Seedance V2 Studio", + description: "Deploy a premium AI art studio and sell access to users. Full Stripe integration lets you collect revenue immediately after launch.", + icon: FaMagic, + color: "purple", + repo: "https://github.com/SamurAIGPT/seedance-2-generator", + hosted: "https://seedance-2-generator.vercel.app/", + thumbnail: "https://cdn.muapi.ai/apps/4cd1f49d48934d448e7f493f9d5e476e.png", + isTemplate: true + }, + { + name: "AI Clipping Studio", + description: "Launch your own AI-powered video clipping SaaS. Download YouTube videos and extract viral highlights with ease.", + icon: FaVideo, + color: "emerald", + repo: "https://github.com/SamurAIGPT/ai-clipping-generator", + hosted: "https://ai-clipping-generator.vercel.app/", + thumbnail: "https://cdn.muapi.ai/data/2/883345778103/cca8b5bb-25f1-40fe-928e-53dce2c8c928.png", + isTemplate: true + }, + { + name: "EasyVeo Studio", + description: "The complete Veo 3.1 video generation suite. Monetize text-to-video, image-to-video, and reference-to-video workflows with ease.", + icon: FaVideo, + color: "indigo", + repo: "https://github.com/SamurAIGPT/veo4-video-generator", + hosted: "https://veo4-video-generator.vercel.app/", + thumbnail: "https://cdn.muapi.ai/data/2/901343404247/94ac6d86-be4e-4b70-b1e6-96d7e3692604.png", + isTemplate: true + } +]; + +const dummyAppsData = [ + { thumbnail: "https://cdn.muapi.ai/apps/Pet_Product_Studio.jpg", name: "Pet Product Studio", description: "High-end product photography specifically for pet toys and food.", icon: FaPaw, category: "Lifestyle" }, + { thumbnail: "https://cdn.muapi.ai/apps/Resale_Photo_Enhancer.png", name: "Resale Photo Enhancer", description: "Boost sales by elevating low-quality product photos to studio level.", icon: FaImage, category: "Business" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Recruiter.png", name: "AI Recruiter", description: "Smart candidate screening and interview assistant.", icon: FaBriefcase, category: "Business" }, + { thumbnail: "https://cdn.muapi.ai/apps/Talk_to_PDF.png", name: "Talk to PDF", description: "Interactive document chat for deep research and summarization.", icon: FaFileAlt, category: "Productivity" }, + { thumbnail: "https://cdn.muapi.ai/apps/Blogger_CMS.png", name: "Blogger CMS", description: "AI-powered content management for high-velocity SEO blogs.", icon: FaBriefcase, category: "Business" }, + { thumbnail: "https://cdn.muapi.ai/apps/Amazon_Product_Studio.webp", name: "Amazon Product Studio", description: "Perfect Amazon-ready product shots with AI backdrops.", icon: FaImage, category: "Business" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Business_Card.webp", name: "AI Business Card", description: "Digital-first business card generator with AI networking.", icon: FaBriefcase, category: "Business" }, + { thumbnail: "https://cdn.muapi.ai/apps/MailWise.png", name: "MailWise", description: "Intelligent email drafting and scheduling assistant.", icon: FaBriefcase, category: "Business" }, + { thumbnail: "https://cdn.muapi.ai/apps/My_Podcast.webp", name: "My Podcast", description: "Automated podcast editing and show-note generation.", icon: FaMicrophone, category: "Creative" }, + { thumbnail: "https://cdn.muapi.ai/apps/EZScribe.png", name: "EZScribe", description: "Instant transcription and meeting minute automation.", icon: FaFileAlt, category: "Productivity" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Knowledge_Base.png", name: "AI Knowledge Base", description: "Train an AI on your company data for instant support.", icon: FaBriefcase, category: "Business" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Outbound.webp", name: "AI Outbound", description: "Personalized cold outreach at scale for sales teams.", icon: FaBriefcase, category: "Business" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Royal_Portrait.png", name: "AI Royal Portrait", description: "Transform your photos into 18th-century royal oil paintings.", icon: FaHandSparkles, category: "Creative" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_MEME.png", name: "AI MEME", description: "Viral-ready meme generation based on trending topics.", icon: FaMagic, category: "Creative" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Real_Estate_Stager.webp", name: "AI Real Estate Stager", description: "Virtually furnish and stage empty homes for sale.", icon: FaHome, category: "Real Estate" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Logo.png", name: "AI Logo", description: "Dynamic brand identity and logo generator.", icon: FaHandSparkles, category: "Business" }, + { thumbnail: "https://cdn.muapi.ai/apps/OldPhoto.png", name: "OldPhoto", description: "Restore, colorize, and sharpen vintage family photos.", icon: FaImage, category: "Creative" }, + { thumbnail: "https://cdn.muapi.ai/apps/AITryOn.png", name: "AITryOn", description: "Virtual fitting room for fashion brands and enthusiasts.", icon: FaHandSparkles, category: "Lifestyle" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Age_Transformation.webp", name: "AI Age Transformation", description: "Visualize yourself at different stages of life with high fidelity.", icon: FaImage, category: "Lifestyle" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Professional_Makeup_Generator.webp", name: "AI Professional Makeup Generator", description: "Try on hundreds of makeup looks virtually.", icon: FaHandSparkles, category: "Lifestyle" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Flash_Cards.webp", name: "AI Flash Cards", description: "Turn any text or PDF into pedagogical flashcards.", icon: FaFileAlt, category: "Education" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Group_Photo.webp", name: "AI Group Photo", description: "Seamlessly combine individual portraits into a group photo.", icon: FaImage, category: "Creative" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Tattoo_Try_On.webp", name: "AI Tattoo Try-On", description: "Visualize tattoos on your body before getting inked.", icon: FaHandSparkles, category: "Lifestyle" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Hair_Style_Simulator.webp", name: "AI Hair Style Simulator", description: "Try on new haircuts and colors with zero commitment.", icon: FaHandSparkles, category: "Lifestyle" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Kids_to_Adult_Prediction.webp", name: "AI Kids-to-Adult Prediction", description: "Ever wonder what your kid will look like as an adult?", icon: FaImage, category: "Lifestyle" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Room_Declutter.webp", name: "AI Room Declutter", description: "Instantly clean up messy room photos for listings.", icon: FaHome, category: "Real Estate" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Fitness_Body_Simulator.webp", name: "AI Fitness Body Simulator", description: "Visualize your fitness goals on your own body.", icon: FaImage, category: "Lifestyle" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Pet_Portrait.webp", name: "AI Pet Portrait", description: "Elegant, artistic portraits for your beloved pets.", icon: FaPaw, category: "Lifestyle" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Kissing_Video_Generator.webp", name: "AI Kissing Video Generator", description: "Expressive AI video generation for romantic moments.", icon: FaVideo, category: "Creative" }, + { thumbnail: "https://cdn.muapi.ai/apps/Chat_with_PDF.webp", name: "Chat with PDF", description: "Ask questions and extract data from massive PDF files.", icon: FaFileAlt, category: "Productivity" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Travel_Studio.png", name: "AI Travel Studio", description: "Create stunning travel posters and visuals from prompts.", icon: FaMapMarkerAlt, category: "Lifestyle" }, + { thumbnail: "https://cdn.muapi.ai/apps/Prompt_Architect.webp", name: "Prompt Architect", description: "Refine and optimize complex prompts for high-tier AI models.", icon: FaMagic, category: "Creative" }, + { thumbnail: "https://cdn.muapi.ai/apps/ClearMark_AI.webp", name: "ClearMark AI", description: "Automated watermark removal and brand cleanup for assets.", icon: FaImage, category: "Business" }, + { thumbnail: "https://cdn.muapi.ai/apps/PlantVision_AI.webp", name: "PlantVision AI", description: "Identify plants and generate gardening care guides.", icon: FaHandSparkles, category: "Lifestyle" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Wedding_Photo.png", name: "AI Wedding Photo", description: "Cinematic wedding photography enhancements and filters.", icon: FaImage, category: "Lifestyle" }, + { thumbnail: "https://cdn.muapi.ai/apps/User_Account_Registration_Form.webp", name: "User Account Registration Form", description: "Beautiful, conversion-optimized signup flows.", icon: FaBriefcase, category: "Development" }, + { thumbnail: "https://cdn.muapi.ai/apps/Social_Post.webp", name: "Social Post", description: "AI-generated social media scheduling and copy creator.", icon: FaBriefcase, category: "Marketing" }, + { thumbnail: "https://cdn.muapi.ai/apps/MagicSelf_AI.webp", name: "MagicSelf AI", description: "The ultimate AI selfie and avatar generation engine.", icon: FaMagic, category: "Creative" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Resume_Builder.webp", name: "AI Resume Builder", description: "Craft the perfect, ATS-friendly resume in seconds.", icon: FaFileAlt, category: "Productivity" }, + { thumbnail: "https://cdn.muapi.ai/apps/GEO_Checker.webp", name: "GEO Checker", description: "AI-powered location tagging and geodata validation.", icon: FaMapMarkerAlt, category: "Business" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Character_Studio.webp", name: "AI Character Studio", description: "Consistent character design for animators and writers.", icon: FaUserTie, category: "Creative" }, + { thumbnail: "https://cdn.muapi.ai/apps/Luxury_Hair_Studio.webp", name: "Luxury Hair Studio", description: "High-end hair visualization for top-tier salons.", icon: FaHandSparkles, category: "Lifestyle" }, + { thumbnail: "https://cdn.muapi.ai/apps/ProFlow_Plumbing.webp", name: "ProFlow Plumbing", description: "AI scheduling and diagnostics for plumbing services.", icon: FaHome, category: "Services" }, + { thumbnail: "https://cdn.muapi.ai/apps/Solace_AI.webp", name: "Solace AI", description: "Empathetic AI assistant for mental well-being support.", icon: FaHandSparkles, category: "Health" }, + { thumbnail: "https://cdn.muapi.ai/apps/ReLive_AI.webp", name: "ReLive AI", description: "Immersive memory and historical visualization engine.", icon: FaHandSparkles, category: "Creative" }, + { thumbnail: "https://cdn.muapi.ai/apps/AI_Chiropractic_Service.webp", name: "AI Chiropractic Service", description: "Postural analysis and exercise recommendation AI.", icon: FaUserInjured, category: "Health" }, + { thumbnail: "https://cdn.muapi.ai/apps/Tabla___ReserveAI.webp", name: "Tabla - ReserveAI", description: "Intelligent table reservation engine for restaurants.", icon: FaBuilding, category: "Services" }, + { thumbnail: "https://cdn.muapi.ai/apps/Dental_ReserveAI.webp", name: "Dental ReserveAI", description: "Smart dental appointment and follow-up management.", icon: FaStethoscope, category: "Health" }, + { thumbnail: "https://cdn.muapi.ai/apps/CounselMate.webp", name: "CounselMate", description: "Legal research and document drafting aid for lawyers.", icon: FaBalanceScale, category: "Legal" }, + { thumbnail: "https://cdn.muapi.ai/apps/Intelligent_Real_Estate_Agent.webp", name: "Intelligent Real Estate Agent", description: "Automate leads and property matches with AI agents.", icon: FaHome, category: "Real Estate" }, + { thumbnail: "https://cdn.muapi.ai/apps/Fixera.webp", name: "Fixera", description: "Home repair diagnosis and pro-finding ecosystem.", icon: FaHome, category: "Services" }, + { thumbnail: "https://cdn.muapi.ai/apps/Velora___Yoga_AI.webp", name: "Velora - Yoga AI", description: "Personalized AI yoga and posture guidance engine.", icon: FaHandSparkles, category: "Health" }, + { thumbnail: "https://cdn.muapi.ai/apps/Nova_AssuranceAI.webp", name: "Nova AssuranceAI", description: "Smart insurance quote and claim processing assistant.", icon: FaBalanceScale, category: "Legal" }, + { thumbnail: "https://cdn.muapi.ai/apps/TurboGlow_Auto_Spa.webp", name: "TurboGlow Auto Spa", description: "AI booking and customization for luxury auto detailing.", icon: FaCar, category: "Services" }, + { thumbnail: "https://cdn.muapi.ai/apps/Paws___Pals.webp", name: "Paws & Pals", description: "AI-powered pet care and walking coordination hub.", icon: FaPaw, category: "Lifestyle" }, + { thumbnail: "https://cdn.muapi.ai/apps/Vertex_Tax_Strategy.webp", name: "Vertex Tax Strategy", description: "Intelligent tax planning and deduction spotting AI.", icon: FaBalanceScale, category: "Business" }, + { thumbnail: "https://cdn.muapi.ai/apps/LedgerSync.webp", name: "LedgerSync", description: "Automated bookkeeping and financial reconciliations.", icon: FaBriefcase, category: "Business" }, + { thumbnail: "https://cdn.muapi.ai/apps/Nova_Care_Clinic.webp", name: "Nova Care Clinic", description: "Patient scheduling and medical intake automation.", icon: FaStethoscope, category: "Health" }, + { thumbnail: "https://cdn.muapi.ai/apps/Opulent_Drive.webp", name: "Opulent Drive", description: "Luxury car rental and fleet management AI.", icon: FaCar, category: "Services" }, + { thumbnail: "https://cdn.muapi.ai/apps/ProFix_Auto.webp", name: "ProFix Auto", description: "Engine diagnostics and preventive maintenance alerts.", icon: FaCar, category: "Services" }, + { thumbnail: "https://cdn.muapi.ai/apps/TowMate.webp", name: "TowMate", description: "Smart roadside assistance and dispatch coordination.", icon: FaTruck, category: "Services" }, + { thumbnail: "https://cdn.muapi.ai/apps/SwiftLink_Logistics.webp", name: "SwiftLink Logistics", description: "AI route optimization and fleet tracking system.", icon: FaTruck, category: "Services" }, + { thumbnail: "https://cdn.muapi.ai/apps/Lumea_Residence.webp", name: "Lumea Residence", description: "Smart home property management and tenant portal.", icon: FaHome, category: "Real Estate" } +]; + +export default function AppsStudio({ apiKey }) { + const [selectedApp, setSelectedApp] = useState(null); + const [isRequesting, setIsRequesting] = useState(false); + const [requestedApps, setRequestedApps] = useState([]); + + useEffect(() => { + if (apiKey) { + getAppInterests(apiKey) + .then(setRequestedApps) + .catch(err => console.error("Error fetching interests:", err)); + } + }, [apiKey]); + + const handleRequestAccess = async () => { + if (!selectedApp || !apiKey) return; + + setIsRequesting(true); + try { + await registerAppInterest(apiKey, selectedApp.name); + setRequestedApps(prev => [...prev, selectedApp.name]); + toast.success("Got it! We'll send you the template details shortly."); + setTimeout(() => setSelectedApp(null), 1500); + } catch (error) { + console.error(error); + toast.error("Failed to register interest. Please try again later."); + } finally { + setIsRequesting(false); + } + }; + + const renderAppCard = (app, isDummy = false, index = 0) => { + // Premium Vibrant Gradients for placeholders + const gradients = [ + "from-blue-600/20 to-indigo-600/20", + "from-purple-600/20 to-pink-600/20", + "from-amber-500/20 to-orange-600/20", + "from-emerald-500/20 to-teal-600/20", + "from-rose-500/20 to-red-600/20", + "from-cyan-500/20 to-blue-600/20", + ]; + const cardGradient = gradients[index % gradients.length]; + + return ( +
+ {/* Thumbnail Section */} +
+ {app.thumbnail ? ( + {app.name} + ) : ( +
+ +
+ )} +
+
+ + {/* Content Section */} +
+
+
+ +
+
+

{app.name}

+

{app.category || 'Template'}

+
+
+ +

{app.description}

+ + {/* Action Buttons */} +
+ {isDummy ? ( + <> + + + + ) : ( + <> + + + Github + + + + Demo + + + )} +
+
+
+ ); + }; + + return ( +
+ + +
+ + {/* Header Section */} +
+
+ + Revenue-Ready Templates +
+

+ LAUNCH AN AI APP.
START EARNING TODAY. +

+

+ Each template is a fully-functional, Stripe-integrated AI SaaS you can deploy in minutes. + Charge your users, keep the revenue — muapi handles the AI infrastructure. +

+
+ + {/* Monetization Steps */} +
+ {[ + { + icon: FaRocket, + step: "01", + title: "Deploy in Minutes", + body: "Fork the open-source template, add your muapi key, and push to Vercel. No backend setup needed." + }, + { + icon: FaCreditCard, + step: "02", + title: "Collect Payments", + body: "Stripe is pre-wired. Set your own pricing — one-time credits, subscriptions, or pay-per-use." + }, + { + icon: FaDollarSign, + step: "03", + title: "Keep the Revenue", + body: "Payments go straight to your Stripe account. You own the product, the brand, and the profits." + } + ].map(({ icon: Icon, step, title, body }) => ( +
+
+ +
+
+

Step {step}

+

{title}

+

{body}

+
+
+ ))} +
+ + {/* Apps Grid */} +
+ {templateApps.map((app, index) => renderAppCard(app, false, index))} + {dummyAppsData.map((app, index) => renderAppCard(app, true, index + templateApps.length))} +
+ + {/* Footer Accent */} +
+
+ + Muapi Ecosystem — More templates coming soon +
+
+
+ + {/* Get Template Modal */} + {selectedApp && ( +
+
setSelectedApp(null)} /> +
+
+
+ +
+

+ Deploy {selectedApp.name} +

+

+ Enter your details and we'll send you the {selectedApp.name} template along with setup instructions so you can deploy and start earning immediately. +

+
+ +
+ + +
+
+
+ )} + + +
+ ); +} diff --git a/packages/studio/src/index.js b/packages/studio/src/index.js index 551f718..c7a4399 100644 --- a/packages/studio/src/index.js +++ b/packages/studio/src/index.js @@ -7,4 +7,5 @@ export { default as CinemaStudio } from './components/CinemaStudio'; export { default as MarketingStudio } from './components/MarketingStudio'; export { default as WorkflowStudio } from './components/WorkflowStudio'; export { default as AgentStudio } from './components/AgentStudio'; +export { default as AppsStudio } from './components/AppsStudio'; export * from './muapi'; diff --git a/packages/studio/src/muapi.js b/packages/studio/src/muapi.js index 4805658..cd15168 100644 --- a/packages/studio/src/muapi.js +++ b/packages/studio/src/muapi.js @@ -585,3 +585,33 @@ export async function calculateDynamicCost(apiKey, taskName, payload) { } return await response.json(); } + +export async function registerAppInterest(apiKey, appName) { + const response = await fetch(`${BASE_URL}/app/interest`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'x-api-key': apiKey + }, + body: JSON.stringify({ app_name: appName }) + }); + if (!response.ok) { + const errText = await response.text(); + throw new Error(`Failed to register interest: ${response.status} - ${errText.slice(0, 100)}`); + } + return await response.json(); +} + +export async function getAppInterests(apiKey) { + const response = await fetch(`${BASE_URL}/app/interests`, { + headers: { + 'Content-Type': 'application/json', + 'x-api-key': apiKey + } + }); + if (!response.ok) { + const errText = await response.text(); + throw new Error(`Failed to fetch interests: ${response.status} - ${errText.slice(0, 100)}`); + } + return await response.json(); +}