Share

Getting a Lovable project into your own repo and local editor

Open · 4 views · asked by noor_builds · edited

The moment your project matters, the chat should stop being the only copy of it. Step 4 is the one I nearly skipped: without the schema in migrations you cannot rebuild the database anywhere else.

Workflow
Copied 12 times
1. In Lovable, connect GitHub and push. The repo is now the source of truth, not the chat history.
2. Clone it, run `npm install`, and copy the environment variables into `.env.local`.
3. Start it locally once before changing anything. If it does not start, fix that first.
4. Put the schema in version control: `supabase link`, then `supabase db pull`, and commit the migration it writes.
5. Make sure `.env*` is in `.gitignore`, and rotate every key that was ever pasted into the chat.
6. From here edit locally. Two-way editing without a habit of pulling first loses work.
Comment

Activity