/lovable-issues

Best Practices for Using Lovable in Client Workflows

Discover why scoped, exportable projects are key in Lovable. Learn safe practices and top tips for delivering stellar client work.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

Why Client Work Requires Scoped and Exportable Projects in Lovable

Scoped, exportable projects are essential because client work must be handoff-ready, auditable, and runnable outside Lovable — and Lovable doesn’t include a terminal. Without a clearly scoped repo, explicit env/secret mapping, and export-friendly scripts/docs, you end up with surprises when developers or CI need to run, test, or deploy the app outside Lovable.

 

Why this matters

 

Keeping client projects scoped (one clear deliverable per repo) and exportable (complete runnable code + env mapping + docs) prevents the usual breakage when moving from Lovable to local machines, CI, or a client’s infrastructure.

  • Reproducible local dev: Developers need package scripts and a .env.example so they can run the app after git clone. Lovable has no terminal, so export must include CLI-ready scripts.
  • Secrets & ownership: Map Lovable Secrets to .env names and record which values live only in Lovable Cloud vs what to set locally or in CI.
  • Clear scope and acceptance: A small, scoped repo makes it explicit what’s delivered, what’s out of scope, and what the client gets when you export to GitHub.
  • CI / Deploy readiness: Exports need standard scripts (build/start/test) so CI pipelines or client ops teams can adopt the repo with minimal friction.

 

Lovable prompts to make the project scoped and exportable

 

// Prompt 1: Create scoped docs, env example, and secret mapping
// Paste this into Lovable chat to create/update files.

Please create or update these files exactly as described.

1) Create /CLIENT_SCOPE.md with:
# Client scope and deliverables
// Describe the single deliverable and what is excluded
Deliverable: The web app at / (single-page app) with endpoints under /api.
Included: UI, API endpoints implemented in src/api, tests for critical flows.
Excluded: Hosting setup outside Lovable, analytics beyond basic page views.

2) Create /LOVABLE_EXPORT_INSTRUCTIONS.md with:
# Export and local run instructions
// Clarify what to do inside Lovable and outside (terminal required)
Inside Lovable:
- Use Preview to verify UI and Secrets UI to set runtime secrets.
Outside Lovable (terminal required; use GitHub sync/export):
- git clone <repo>
- cp .env.example .env
- npm install
- npm run dev
Map Lovable Secrets to .env variables; see /secrets.map.json.

3) Create /.env.example with keys (do not include real secrets):
# Example env variables
DATABASE_URL=
SUPABASE_ANON_KEY=
NEXT_PUBLIC_API_BASE=/api

4) Create /secrets.map.json with:
{
  // Map Lovable Secret names (left) to .env variable names (right)
  "LOVABLE_SUPABASE_KEY": "SUPABASE_ANON_KEY",
  "LOVABLE_DATABASE_URL": "DATABASE_URL"
}

4) Update /.gitignore to include:
node_modules
.env
/dist

 

// Prompt 2: Ensure package.json has standard scripts
// Paste this into Lovable chat to update /package.json (create if missing).

Open /package.json and ensure it includes these scripts under "scripts":
{
  // keep existing fields; add or update "scripts"
  "scripts": {
    "dev": "next dev || vite", // // Use your project's dev command (adjust if not Next/Vite)
    "build": "next build || vite build",
    "start": "next start || node ./dist/index.js",
    "test": "jest --passWithNoTests"
  }
}
// If package.json is missing, create a minimal one with name, version, and the scripts above.

 

// Prompt 3: Add a README section explaining Secrets and GitHub sync
// Paste into Lovable chat to update /README.md.

Update /README.md to include a "Lovable Notes" section:
## Lovable Notes
// How Secrets and export work
- Runtime secrets are stored in Lovable Cloud via the Secrets UI. Names are documented in /secrets.map.json.
- To run locally or in CI, use the .env keys from .env.example and populate values manually or via CI secrets.
- For anything requiring a terminal (install, build, local dev), export or sync this repo to GitHub and run commands outside Lovable (terminal required).

 

Practical final notes

 

  • Use Lovable Preview and Secrets UI for iterative testing, but always keep the export docs and .env.example updated so handoffs work.
  • When terminal work is required (migrations, native builds, Docker), call out those steps in LOVABLE_EXPORT_INSTRUCTIONS.md and mark them as "outside Lovable (terminal required) — use GitHub sync/export."
  • Keep repos small and single-purpose to avoid accidental coupling when exporting to clients or other teams.

Still stuck?
Copy this prompt into ChatGPT and get a clear, personalized explanation.

This prompt helps an AI assistant understand your setup and guide you through the fix step by step, without assuming technical knowledge.

AI AI Prompt

How to Use Lovable Safely for Client Work

Use Lovable-native features: keep secrets out of code by adding a clear .env.example and runtime env checks, require the client project to set values in Lovable’s Secrets UI before Publish/Preview, create a small “delivery” scaffold (README, PUBLISH\_CHECKLIST.md, .gitignore) inside the Lovable workspace, and use GitHub export/sync when any terminal work (builds, migrations, provider CLIs) is required — all changes are done by pasting the prompts below into Lovable chat so Lovable edits files, creates the checklist, and prepares a safe, exportable repo.

 

Prompts to paste into Lovable (paste each as a separate message)

 

  • Scaffold client-safe repo files — create these files exactly as written so the project is exportable and clearly documents secret requirements. Paste this whole prompt into Lovable chat and ask it to apply the edits.
Please create these files in the workspace exactly as described.

Create README.md with this content:
// Basic project README for client delivery
# Project Name
This repo is prepared for delivery via Lovable. Follow PUBLISH_CHECKLIST.md before sharing.

Create .env.example with these keys and comments:
// List environment variables that are required but do NOT include real secrets
CLIENT_DB_URL=
// CLIENT_API_KEY=
// NEXT_PUBLIC_ANALYTICS_KEY=

Create .gitignore:
// Ignore node environment and local secrets
node_modules/
.env
.DS_Store

Create PUBLISH_CHECKLIST.md with these steps:
// Checklist the client or dev must complete in Lovable before publishing
- Ensure all values from .env.example are added to Lovable Secrets (do not paste secrets in chat or files).
- Use Preview to verify app runs with Secrets set.
- Verify README and LICENSE are correct, then Publish or export to GitHub.

Commit these files.

 

  • Add runtime environment validation — create a small config file that fails fast with clear messages when a secret is missing. Ask Lovable to add this to src/config.ts (or appropriate path) and wire it into app startup.
Please create src/config.ts with the following content and ensure the app imports it on startup (e.g., top of server entry or index):

// src/config.ts
type Env = {
  CLIENT_DB_URL: string;
  CLIENT_API_KEY?: string;
  NEXT_PUBLIC_ANALYTICS_KEY?: string;
};

// Throw clear, non-sensitive errors if required vars are missing
const required = ["CLIENT_DB_URL"];
const missing = required.filter(k => !process.env[k]);
if (missing.length) {
  throw new Error("Missing required environment variables: " + missing.join(", ") + ". Add them via Lovable Secrets UI or in your deployment.");
}

export const ENV = {
  CLIENT_DB_URL: process.env.CLIENT_DB_URL!,
  CLIENT_API_KEY: process.env.CLIENT_API_KEY,
  NEXT_PUBLIC_ANALYTICS_KEY: process.env.NEXT_PUBLIC_ANALYTICS_KEY,
} as Env;

Commit this file and import it in the app entry (if you don't know where, update src/index.tsx or server entry to `import "./src/config";`).

 

  • Add an explicit Secrets setup doc for Lovable UI — create docs/secrets-lovable.md instructing the client/dev how to set secrets in Lovable Secrets UI and what keys to use.
Please create docs/secrets-lovable.md with this content:

// docs/secrets-lovable.md
# Setting Secrets in Lovable
Open Lovable's Secrets UI and create the following secret keys (use the values the client provides):
- CLIENT_DB_URL
- CLIENT_API_KEY (optional)
- NEXT_PUBLIC_ANALYTICS_KEY (optional)

Do NOT put secrets into files or chat. After adding these, use Preview to confirm the app starts. If the app errors about missing envs, check PUBLISH_CHECKLIST.md.

 

  • Prepare for terminal-required tasks (outside Lovable) — create EXPORT\_INSTRUCTIONS.md that clearly marks any steps that require GitHub sync and local terminal, so the client or developer knows what to do after export.
Please create EXPORT_INSTRUCTIONS.md with this content:

// EXPORT_INSTRUCTIONS.md
# Steps outside Lovable (terminal required)
If you need to run database migrations, install local dev dependencies, or use provider CLIs, export or sync this repo to GitHub (use Lovable GitHub sync). Then on your machine:
- git clone <repo>
- npm install or yarn
- run migrations or provider CLIs as documented in project README
These steps cannot be done inside Lovable's editor because Lovable has no terminal.

 

Quick safety rules (to include in README and the checklist)

 

  • Never commit real secrets — keep .env.example only; use Lovable Secrets UI.
  • Require Preview before Publish — the PUBLISH\_CHECKLIST enforces using Preview with Secrets set.
  • Use GitHub export for CLI tasks — the EXPORT\_INSTRUCTIONS file flags terminal actions as outside Lovable.

 

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Best Practices for Delivering Client Work With Lovable

Create a short, exportable project handoff inside the repo, add a .env.example plus explicit Secrets UI names, and a clear HANDOFF.md that explains how to preview in Lovable, how to Publish, and which steps require GitHub export or a terminal. This gives clients and engineers everything they need inside the project and avoids assumptions about local CLI access.

 

Lovable prompts to run now (paste each into Lovable chat)

 

  • Create DELIVERY.md at project root explaining scope, runtime, and export steps
// Create a new file DELIVERY.md at the repository root with the following content:
// - short project summary and included features
// - runtime requirements (Node version, DB provider e.g., Supabase)
// - "What Lovable provides" (Preview, Publish, Secrets UI)
// - "What requires GitHub export/terminal" with exact commands to run outside Lovable

 

  • Add a .env.example file with required env names
// Create .env.example at project root with placeholders and comments:
// NODE_ENV=production
// NEXT_PUBLIC_API_URL=https://example.com
// # Supabase example keys — actual values must be set in Lovable Secrets UI
// SUPABASE_URL=__SET_IN_SECRETS__
// SUPABASE_ANON_KEY=__SET_IN_SECRETS__

 

  • Create HANDOFF.md with step-by-step client/dev checklist
// Create HANDOFF.md at project root with the following checklist sections:
// - How to preview in Lovable (use Preview button; where to find preview URL)
// - How to add secrets in Lovable (exact names to create in Secrets UI matching .env.example)
// - How to publish from Lovable (Publish button and what it does)
// - How to export to GitHub (enable GitHub sync, then follow .github/CI instructions)
// - Which steps are outside Lovable (marked "outside Lovable (terminal required)") with the exact terminal commands to run

 

Secrets & Preview instructions (explicit steps for the client)

 

  • Prompt to add secrets using Lovable Secrets UI
// Instruct Lovable to add a file SECRETS_HELP.md that lists each secret key and how to add it.
// Example entries:
// - SUPABASE_URL — add via Lovable Secrets UI (name: SUPABASE_URL)
// - SUPABASE_ANON_KEY — add via Lovable Secrets UI (name: SUPABASE_ANON_KEY)
// Also include: "After adding secrets, click Preview to see a live build that uses the secrets."

 

When something needs the terminal / GitHub CI

 

  • Create .github/ci.yml with test & build steps and mark as "outside Lovable" actions
// Add .github/workflows/ci.yml with a basic workflow that runs tests and builds.
// In HANDOFF.md label these CI steps as "outside Lovable (requires GitHub sync/CI)". 
// Include exact commands the engineer should run locally or in CI (npm install, npm run build, migrate:up).

 

Delivery quality items to include in-repo

 

  • Add README\_CLIENT.md that tells the client how to preview, where to find support, and where to request exports
  • Add RELEASE\_CHECKLIST.md with branch naming, how to create a release, and which approvals are required

 

Paste each prompt into Lovable chat to create the files and edits. Use Lovable's Preview to confirm the site, use the Secrets UI to add real secret values matching .env.example, and use GitHub export/sync only for CI or DB migrations (labelled "outside Lovable (terminal required)" in HANDOFF.md).

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022