Explore why clear framework preferences matter in Lovable prompts and learn how to specify frameworks and libraries effectively.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
Because Lovable has no terminal and generates, deploys, and previews from the project files and environment you provide, explicit framework preferences must be asked up front — otherwise the app will scaffold, install, or run using wrong assumptions and previews/publishes will break.
Please implement a clear onboarding flow that forces explicit framework preferences and fails early with helpful instructions when preferences are missing. Make these concrete edits:
- Create docs/LOVABLE_ONBOARDING.md with a short checklist that explains required choices and where to set them in Lovable Cloud (Project → Secrets) or after GitHub export.
- Add src/setup/framework-check.ts which reads three environment variables (LOVABLE_FRONTEND, LOVABLE_BACKEND, LOVABLE_DB), verifies they exist, and throws a clear, actionable Error listing what's missing and where to set them (Lovable Secrets UI or GitHub secrets after export).
- Import the check at the very top of the main server entry (update src/index.ts or src/main.ts — if both exist update both) so the app fails fast in Preview with the message.
- Update README.md root section to point to docs/LOVABLE_ONBOARDING.md and mention using Lovable Secrets UI.
- Commit changes.
Provide exact file contents as below.
File: docs/LOVABLE_ONBOARDING.md
// Basic onboarding for Lovable — required framework selections and where to put them
// Explain choices briefly and link to Lovable Secrets UI
Write clear paragraphs that ask the user to set LOVABLE_FRONTEND, LOVABLE_BACKEND, LOVABLE_DB in Lovable Cloud (Project → Secrets) before Preview or Publish. Explain that after GitHub export these become GitHub secrets and local developers should set matching env vars locally.
File: src/setup/framework-check.ts
// create this file
export function ensureFrameworkPrefs() {
const missing = [];
if (!process.env.LOVABLE_FRONTEND) missing.push('LOVABLE_FRONTEND');
if (!process.env.LOVABLE_BACKEND) missing.push('LOVABLE_BACKEND');
if (!process.env.LOVABLE_DB) missing.push('LOVABLE_DB');
if (missing.length) {
throw new Error(
'Missing required project framework preferences: ' +
missing.join(', ') +
".\nSet these in Lovable Cloud → Project → Secrets (or as GitHub secrets after export). See docs/LOVABLE_ONBOARDING.md for details."
);
}
}
File edits: src/index.ts (or src/main.ts)
// at the very top of the file add:
import './setup/framework-check';
// then leave the rest of the file unchanged
Update README.md root section
// add a short line: "Before Preview/Publish set LOVABLE_FRONTEND, LOVABLE_BACKEND, LOVABLE_DB in Lovable Cloud (see docs/LOVABLE_ONBOARDING.md)."
After these edits, open Preview so errors show up for missing selections. If any step requires actions outside Lovable (e.g., adding GitHub secrets after export), clearly label those steps in docs/LOVABLE_ONBOARDING.md as "outside Lovable (terminal/CI or GitHub settings)."
This prompt helps an AI assistant understand your setup and guide you through the fix step by step, without assuming technical knowledge.
Paste one of the ready-to-use Lovable prompts below into your Lovable chat. Each prompt tells Lovable exactly which files to change, what to add to package.json, and where to put secrets (via the Lovable Secrets UI) so Lovable can implement framework/library choices without asking you to run terminal commands.
// Project preference: use React + TypeScript + Vite as the app framework and bundler.
// Make explicit edits to files and package.json so the repo reflects this choice.
// Files to create/update:
// - package.json: set name, scripts, and dependencies for react, react-dom, vite, typescript.
// - tsconfig.json: add a basic TS config.
// - index.html and src/main.tsx: minimal Vite React entry.
// - src/App.tsx: basic component with a <Routes> placeholder.
// Please perform exact file changes below.
// update package.json (create if missing)
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"vite": "^5.0.0",
"typescript": "^5.0.0",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0"
}
}
// create tsconfig.json with a minimal config
// create index.html and src/main.tsx, src/App.tsx as Vite/React entry files
// update README.md to state: "Framework: React + TypeScript + Vite"
// Note: Do not attempt to run npm install here. Add these files and leave instructions in README
// for local/GitHub CI installation. If CI setup is desired, add .github/workflows/node-ci.yml.
// Add Supabase to the project and wire in secrets via Lovable's Secrets UI.
// Changes to make:
// - package.json: add "supabase-js": "^2.0.0" to dependencies.
// - create src/lib/supabase.ts with a standard Supabase client initializer.
// - update src/pages/Login.tsx (or src/App.tsx if Login doesn't exist): import the client and show a simple auth usage comment.
// - update README.md with instructions: "Set SUPABASE_URL and SUPABASE_KEY in Lovable Secrets."
// update package.json dependencies (merge with existing)
"dependencies": {
// ...existing deps...
"supabase-js": "^2.0.0"
}
// create src/lib/supabase.ts
// // Supabase client wrapper
import { createClient } from "@supabase/supabase-js";
const supabaseUrl = process.env.SUPABASE_URL;
const supabaseKey = process.env.SUPABASE_KEY;
export const supabase = createClient(supabaseUrl || "", supabaseKey || "");
// update src/pages/Login.tsx or src/App.tsx to import { supabase } from "../lib/supabase"
// and add a small example comment demonstrating signIn/signUp usage.
// Instruction for Secrets:
// In Lovable Cloud, open the Secrets UI and add two Secrets:
// - SUPABASE_URL (value: your Supabase project URL)
// - SUPABASE_KEY (value: your anon/public key)
// Replace/enable React Router usage. Make direct edits as follows:
// - package.json: add "react-router-dom": "^6.8.0" to dependencies.
// - update src/main.tsx or src/index.tsx to wrap <App /> in BrowserRouter.
// - update src/App.tsx: replace current route handling with <Routes> and <Route> components.
// - update any file that referenced the old router to use react-router-dom's useNavigate/useParams as needed.
// update package.json dependencies
"dependencies": {
// ...existing deps...
"react-router-dom": "^6.8.0"
}
// update src/main.tsx (replace where App is rendered)
// // wrap App with BrowserRouter
import { BrowserRouter } from "react-router-dom";
import App from "./App";
root.render(
<BrowserRouter>
<App />
</BrowserRouter>
);
// update src/App.tsx in the <Routes> block
// // Example Routes
import { Routes, Route } from "react-router-dom";
import Home from "./pages/Home";
import About from "./pages/About";
function App() {
return (
<Routes>
<Route path="/" element={<Home />} />
<Route path="/about" element={<About />} />
</Routes>
);
}
export default App;
// This migration requires running CLI commands (install/build/migrate). I want a Git-aware PR with changes plus a clear checklist for local or CI execution.
// Actions for Lovable:
// - Create a branch named "migrate-next-to-vite" and modify files to reflect the target structure (package.json, tsconfig.json, vite config, src/*).
// - Add .github/workflows/migrate-ci.yml that runs npm install and tests on push to this branch.
// - Create README-MIGRATION.md with step-by-step commands the developer must run locally (marked "outside Lovable (terminal required)"), e.g. npm install, node scripts, etc.
// Do not attempt to run installs in Lovable; produce files and a migration checklist.
The simplest, most reliable approach in Lovable is to record explicit framework preferences in repository files and in Lovable’s UI (Secrets) so the chat agent and reviewers always know the exact framework, version, package manager, build and dev commands, runtime (Node) version, and any SSR vs CSR expectations — then surface those in package.json and a small repo manifest so Lovable previews and exports behave predictably. Do this entirely with Chat Mode edits (create/update files), the Preview, and the Secrets UI; use GitHub sync/export only for actions that truly require a terminal.
engines, explicit scripts, and a comment-like section in a manifest file so Lovable can edit confidently.
Paste each prompt into Lovable chat separately. They tell Lovable exactly what files to create or update.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.