/lovable-issues

Duplicating and Remixing Existing Lovable Projects

Discover why Lovable Remix projects require manual cloning. Duplicate, remix, and follow best practices for project success.

Book a free  consultation
4.9
Clutch rating 🌟
600+
Happy partners
17+
Countries served
190+
Team members
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 Cloning Requires Manual Setup in Lovable Remix Projects

Cloning a Lovable Remix project copies the code but not the runtime state and secrets the app needs to actually run: environment variables (local .env files are gitignored), cloud service resources (Supabase projects, Stripe accounts, OAuth apps), database schema/migrations, and Lovable/CI deployment links. Because Lovable does not expose a terminal, those external steps can’t be run inside the app — they must be recreated in provider consoles and added to Lovable’s Secrets UI or performed outside Lovable (via GitHub export and a terminal). That’s why a cloned project requires manual setup.

 

Key reasons cloning needs manual setup

 

  • Secrets and env files aren’t copied: .env, .env.local, and service keys are intentionally gitignored. You must add them to Lovable’s Secrets UI (or GitHub secrets) after cloning.
  • External services aren’t duplicated: Supabase projects, Stripe accounts, OAuth app registrations, storage buckets, etc. live in other consoles — you must create/configure them and paste keys into Secrets.
  • Database schema and migrations: Migrations are code, but running them requires CLI access or provider consoles. Lovable can’t run prisma migrate inside the app — you’ll run migrations locally or via GitHub workflows.
  • Build/deploy metadata and linked repos: Lovable’s preview/publish state and GitHub link aren’t identical after a clone. You may need to re-link GitHub and configure build env vars in Lovable Cloud.
  • Ignored/generated files: node\_modules, build artifacts, and service-role keys aren’t in the repo — those are created or provided at runtime.
  • No terminal in Lovable: Because you can’t run commands, anything that requires cli (migrations, seeding, provider CLIs) must be handled outside Lovable or via GitHub sync/export.

 

Lovable prompt to help the cloned project be self-describing and fail early

 

Please make these repository changes to make cloning less confusing and to surface missing manual steps.

1) Create a file at SETUP.md in the project root with the human-friendly checklist below (exact content shown).
2) Add a runtime environment checker:
   - Create src/utils/checkEnv.ts exporting a function ensureEnv(required: string[]) that throws a clear Error listing missing keys.
   - Import and call ensureEnv from the server entry file: update src/entry.server.ts or src/entry.server.tsx or src/server.ts (whichever exists) to call ensureEnv([...]) early during startup with the specific env keys this project requires.
3) Add the specific list of required env keys inside both SETUP.md and the ensureEnv array.

File: SETUP.md
// explain what must be done in Lovable and in external consoles
# Setup checklist
// Required: add these secrets in Lovable Cloud > Secrets (do not commit .env)
- LIST_REQUIRED_SECRETS: SUPABASE_URL, SUPABASE_ANON_KEY, SUPABASE_SERVICE_KEY, DATABASE_URL, SESSION_SECRET, STRIPE_SECRET_KEY, NEXTAUTH_URL
// External consoles:
- Create Supabase project, run migrations, copy service keys into Lovable Secrets.
- Create Stripe account and API keys, add to Lovable Secrets.
- If OAuth is used, create OAuth app and add client ID/secret to Secrets.
// Terminal-required steps (outside Lovable)
- Run database migrations locally or via GitHub Actions after linking repo.

File: src/utils/checkEnv.ts
// create this file
export function ensureEnv(required) {
  // iterate and collect missing keys
  const missing = required.filter(k => !process.env[k]);
  if (missing.length) {
    throw new Error(
      `Missing required environment variables: ${missing.join(', ')}. ` +
      `Add them in Lovable Cloud > Secrets or set them in your deployment. See SETUP.md.`
    );
  }
}

File edit: src/entry.server.ts (or the server entry file present)
// at the top, add
import { ensureEnv } from './utils/checkEnv';
// then call early
ensureEnv([
  'SUPABASE_URL',
  'SUPABASE_ANON_KEY',
  'SUPABASE_SERVICE_KEY',
  'DATABASE_URL',
  'SESSION_SECRET'
]);

// If the project uses a different entry file, apply the same import+call there.

 

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 Duplicate or Remix Existing Lovable Projects

You can duplicate/remix a Lovable project two practical ways: export the project to GitHub and import it as a new Lovable project (best for full-fidelity duplicates including history and build tooling), or make an in-Lovable remix by copying files and updating the minimal metadata</b using chat-mode file edits/patches. Below are ready-to-paste Lovable chat prompts (one for each approach) and a short checklist of what to update after duplication.

 

Remix via GitHub (recommended for full project duplication)

 

Paste this into Lovable chat to prepare the project for a GitHub export. After Lovable applies the changes, use Lovable’s Export / Sync to GitHub UI to push to a new repo, then create/import a new Lovable project from that repo.

// Prepare repo for GitHub export and make it ready to be re-imported as a "remix"
Please update these files to prepare a GitHub-ready remix. Make these edits:

1) Update package.json at package.json
// change "name" and add a remix identifier
Replace the "name" field value with "my-app-remix" and add a "repository" field:
{
  // keep other fields intact
  "name": "my-app-remix",
  "repository": {
    "type": "git",
    "url": "https://github.com/YOUR_GITHUB_USERNAME/my-app-remix.git"
  }
}

2) Add a short remix README at README_REMIX.md
// new file
# My App (Remix)
This is a remix of the original LOVABLE project. Update secrets and environment variables before publishing.

3) Add .lovable-export-instructions.md
// new file with instructions for later import
// explain the GitHub repo name to create and steps to import into Lovable

 

Quick Duplicate inside Lovable (no external GitHub required)

 

Paste this into Lovable chat to create an in-project duplicate under a new folder /remix. Lovable will create file copies and update the duplicate's package.json and README. This is suitable for small projects or prototypes.

// Create an in-Lovable duplicate under /remix and update metadata
Please copy all project files into a new folder named "remix" and then update these files inside remix:

1) Create remix/package.json
// copy original package.json but change name and description
{
  // // keep dependencies and scripts same
  "name": "my-app-remix",
  "version": "0.1.0",
  "description": "Remix of original project (in-Lovable duplicate)"
}

2) Create remix/README.md
// new file noting this is a duplicate, and list required environment variables
# My App — Remix
This folder is an in-Lovable duplicate. Update Secrets / Environment variables via Lovable Secrets UI before previewing.

3) If the project uses an env file, create remix/.env.example
// include only placeholder keys
API_URL=https://example.com
SUPABASE_URL=your-supabase-url
SUPABASE_KEY=your-anon-key

4) Update any top-level build or config references inside remix to use relative paths if needed
// e.g. if there is a build config pointing to src/, ensure it still works under remix/

Finally, create a top-level note at DOCS/REMIX_NOTES.md explaining that the live app must use Lovable Secrets UI to set credentials.

 

Quick Checklist (do these after either approach)

 

  • Set Secrets: Open Lovable Secrets UI and add credentials (DB keys, API keys) for the new project.
  • Update project name + README: Ensure package.json and README clearly show this is the remix.
  • Preview: Use Lovable Preview to verify builds and runtime behavior.
  • Publish / Export: Use Lovable Publish to make the remix live, or Export to GitHub if you need local/CLI work later.

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 Cloning and Remixing Projects in Lovable

When you clone/remix a Lovable project, treat it like a “cloud-first” repo: add a clear setup checklist, a .env.example, runtime-safe config that reads from process.env with helpful errors, and explicit instructions to set required values in Lovable’s Secrets UI. Use Preview to validate, Publish when ready, and sync/export to GitHub only for tasks that need a terminal. Do these changes inside Lovable (Chat Mode edits + file patches) so the new project works reliably for non-terminal users.

 

Practical step-by-step best practices

 

Keep onboarding inside the repo so someone opening the remix immediately knows what to set in the Lovable Secrets UI and what will fail in Preview.

  • Create a clear SETUP.md that lists required Secrets and external services (e.g., Supabase URL + anon key), and the exact Secret names to add in Lovable.
  • Include .env.example to show variable names and sample formats (never real keys).
  • Add runtime-safe config (e.g., src/config.ts) that reads process.env and throws readable errors telling the user to open Secrets UI if a required value is missing.
  • Use Preview early to confirm environment wiring, then Publish when satisfied.
  • Use GitHub export/sync only for tasks that require a terminal (migrations, building native binaries, CI heavy-lifting) and label those steps in SETUP.md as outside Lovable (terminal required).

 

Copy-paste prompts for Lovable (paste each into Lovable chat to apply)

 

Prompt 1 — Create SETUP.md and .env.example

// Create SETUP.md at project root with a clear checklist and exact Secrets names.
// Create .env.example at project root listing variable names (no real keys).

Create file: SETUP.md

# Required Secrets (set these in Lovable's Secrets UI)
- SUPABASE_URL — public URL of your Supabase project
- SUPABASE_ANON_KEY — public anon key (or SERVICE_ROLE if server-only)
- NEXT_PUBLIC_APP_URL — the public URL for Preview/Publish

# Quick steps
- Open Lovable > Secrets and add values using the names above.
- Use Preview to verify the app boots.
- If you need DB migrations or local CLI steps, see 'Outside Lovable' below.

# Outside Lovable (terminal required)
- Any CLI database migration or seeding must be run after exporting to GitHub or locally.

Create file: .env.example

SUPABASE_URL=your-project.supabase.co
SUPABASE_ANON_KEY=pk_...
NEXT_PUBLIC_APP_URL=https://your-preview-url

 

Prompt 2 — Add runtime config that reads env and errors helpfully

// Create src/config.ts that centralizes env access and gives actionable errors.

Create file: src/config.ts

// centralize access to required runtime variables
function requiredEnv(key: string) {
  const val = process.env[key];
  if (!val) {
    // instructive runtime error for Preview/Publish
    throw new Error(
      `Missing required environment variable: ${key}. ` +
      `Set this value in Lovable > Secrets using the exact name "${key}".`
    );
  }
  return val;
}

export const CONFIG = {
  SUPABASE_URL: requiredEnv('SUPABASE_URL'),
  SUPABASE_ANON_KEY: requiredEnv('SUPABASE_ANON_KEY'),
  NEXT_PUBLIC_APP_URL: requiredEnv('NEXT_PUBLIC_APP_URL'),
};

 

Prompt 3 — Add CLONED\_FROM and developer notes

// Create CLONED_FROM.md to capture origin and expectations for remix cloning.

Create file: CLONED_FROM.md

This project was cloned/remixed. When you open the project in Lovable:
- Set the Secrets listed in SETUP.md.
- Use Preview to verify behavior.
- If you need migrations or to run a local dev server, export to GitHub and follow the 'Outside Lovable' steps.

 

Prompt 4 — Add an in-app dev hint (optional) to show missing config on the UI

// Update src/App.tsx to display a helpful message if config load fails.
// Update src/App.tsx in the top-level component render to catch config errors.

Update file: src/App.tsx

// At top of file
import { CONFIG } from './config';

// Wrap main render in try/catch and show human message if error thrown
try {
  // existing app bootstrap that uses CONFIG
} catch (err) {
  // show a user-friendly UI telling them to set Secrets in Lovable
  return (
    <div style={{padding:20}}>
      <h2>Missing configuration</h2>
      <p>{err.message}</p>
      <p>Open Lovable → Secrets and add the required keys listed in SETUP.md.</p>
    </div>
  );
}

 

Workflow notes (what to do inside Lovable vs outside)

 

  • Inside Lovable: create these files via Chat Mode, set Secrets via the Secrets UI, Preview, then Publish.
  • Outside Lovable: any CLI work (database migrations, npm scripts requiring a terminal) must be done after exporting to GitHub or locally — mark those steps clearly in SETUP.md.


Recognized by the best

Trusted by 600+ businesses globally

From startups to enterprises and everything in between, see for yourself our incredible impact.

RapidDev 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.

Arkady
CPO, Praction
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!

Donald Muir
Co-Founder, Arc
RapidDev 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.

Mat Westergreen-Thorne
Co-CEO, Grantify
RapidDev is an excellent developer for custom-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.

Emmanuel Brown
Co-Founder, Church Real Estate Marketplace
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!

Samantha Fekete
Production Manager, Media Production Company
The pSEO strategy executed by RapidDev is clearly driving meaningful results.

Working with RapidDev has delivered measurable, year-over-year growth. Comparing the same period, clicks increased by 129%, impressions grew by 196%, and average position improved by 14.6%. Most importantly, qualified contact form submissions rose 350%, excluding spam.

Appreciation as well to Matt Graham for championing the collaboration!

Michael W. Hammond
Principal Owner, OCD Tech

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We’ll discuss your project and provide a custom quote at no cost.