Learn why exporting Lovable project files is key to collaboration. Discover how to share projects and apply best practices.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
Export is required because Lovable projects live inside Lovable’s single‑workspace/chat environment and are not automatically available as a standard, shareable repository (files, Git history, and local-run workflows) that other developers can clone, run, and open PRs against. Exporting produces the repository-style project files and git metadata collaborators need to work outside Lovable (locally or in CI), reproduce builds, and use normal code-review tools.
// Create a new file docs/why-export.md with the following content.
// This doc explains to collaborators why exporting is required; do not include export instructions here.
Create file docs/why-export.md with content:
# Why project files must be exported to enable collaboration
Exporting converts the Lovable workspace into standard repository files and git metadata that other developers and CI systems can clone, run, and review.
Key reasons:
- Lovable's chat/workspace is not a multi-user git server: collaborators need a repo to branch, open PRs, and review changes.
- No terminal inside Lovable: running installs, tests, and builds requires exported files and local/CI command execution.
- Reproducibility: exported manifests, Dockerfiles, and configs let others reproduce the environment.
- Secrets and env: secrets in Lovable's UI are not the same as repo files; exported repo should contain placeholders and a note explaining secrets handling.
Include a short "What exporting gives you" list and a "When to export" section at the bottom.
// Append a short note to README.md explaining where to find the above doc.
// Update README.md: append the following section at the end of the file.
Append to README.md:
## Why export to collaborate
This project was developed in Lovable (lovable.dev). To collaborate from your own machine or CI, export the project files so you get a standard repository, build scripts, and configuration files. See docs/why-export.md for the rationale.
This prompt helps an AI assistant understand your setup and guide you through the fix step by step, without assuming technical knowledge.
To share a Lovable project with others, prepare the repo inside Lovable (README, .env.example, Secrets placeholders), publish a Preview link for quick review, and export or sync the project to GitHub so others can clone or open it in Lovable. Use Lovable’s Secrets UI to keep credentials out of the repo; instruct collaborators to set matching keys in their Lovable workspace or locally. When you need terminal-level steps (install, build, run) route people to the GitHub repo — those steps run outside Lovable (terminal required).
Paste these prompts into Lovable chat one at a time. Each tells Lovable to create files or make changes that make the project exportable and easy to share.
Please create a file at /README.md with clear instructions for collaborators. Include sections: "Open in Lovable", "Preview / Publish", "GitHub export & clone", "Set secrets", and "Local (outside Lovable) run". Use the exact text below for the file content.
# Project name
## Open in Lovable
// Tell collaborators how to open this project inside Lovable
Open lovable.dev, sign in, then use "Import from GitHub" (if synced) or ask the owner for the repo link. If the repo is private, the owner must connect the repo through Lovable’s GitHub sync.
## Preview / Publish
// Explain how to share a live preview link within Lovable
Use the Preview button inside Lovable to test changes. To share a running preview with non-editors, click Publish and copy the shareable preview URL.
## GitHub export & clone
// Explain the GitHub path for deeper collaboration or local development
From Lovable: connect GitHub in Project Settings → GitHub Sync, then export or push the project. After it's on GitHub, collaborators can clone locally or import the repo back into Lovable.
## Set secrets
// Map env var names to Lovable Secrets keys
This project expects these secret names (set them in Lovable Secrets UI or as environment variables locally):
- SUPABASE_URL
- SUPABASE_ANON_KEY
- OPENAI_API_KEY
## Local run (outside Lovable - terminal required)
// Provide basic commands for local development
// These are example commands; adjust for your stack
npm install
npm run dev
Please create a file at /.env.example with placeholders for required environment variables. Use the exact content below.
# Example environment variables (do not store real secrets here)
// Replace values with real secrets in Lovable Secrets UI or in your local .env (outside Lovable)
SUPABASE_URL=
SUPABASE_ANON_KEY=
OPENAI_API_KEY=
# Notes:
// In Lovable, go to Project → Secrets and create keys that match these names.
// Do not commit .env with real values.
Please create /CONTRIBUTING.md with step-by-step instructions for new contributors. Use the exact content below.
## Collaborating
### If you want to review quickly (no code edits)
1. Open the project in Lovable.
2. Use Preview → Publish to get a shareable URL.
### If you want to contribute code
1. Ensure the project is exported to GitHub:
- Owner: Project Settings → GitHub Sync → Connect repo → Push.
2. Clone the GitHub repo locally (terminal required).
3. Follow the Local run commands in README.md.
4. Open a pull request. Once merged, the owner can pull changes into Lovable by syncing with GitHub.
### Secrets
// Important: secrets are not committed to GitHub
- Add required keys in Lovable: Project → Secrets.
- Locally, use .env populated from .env.example.
Please create /docs/share-preview.md with a short checklist for sharing a Preview link from Lovable. Use this exact content.
# Share preview checklist
- Click Preview in the Lovable editor to verify the app.
- Click Publish to make a public preview (or shareable) link.
- Confirm the preview works without secrets, or temporarily set demo/test keys in Project → Secrets.
- Send the Publish URL to reviewers.
If you want, paste each prompt above into Lovable now and I’ll produce any small edits to the files (README, .env.example, CONTRIBUTING.md) you want before you export or publish.
The best practice is to treat Lovable projects as self-contained, documented, and secrets-safe workspaces you can preview and publish from Lovable — and to explicitly provide a clear handoff path (README, CONTRIBUTING, .env.example, Secrets docs, and a GitHub sync note) for anyone who needs terminal access or local development outside Lovable.
// Prompt 1: Create a README that explains sharing/collaboration in Lovable
// Action: create file README.md at project root with exact content below
Create or replace README.md at the project root with the following content:
# Project name
// Short: how to preview and collaborate inside Lovable
## Using this project inside Lovable
- Use <b>Preview</b> to run and interact with the app inside Lovable.
- Use <b>Chat Mode</b> to request code edits, and review proposed file diffs/patches before accepting.
- Use <b>Publish</b> when you want to create a sharable, immutable snapshot for reviewers.
## Secrets & environment variables
- Add secrets using the Lovable Secrets UI (the project's Secrets tab). Do not commit secrets to the repository.
- See .env.example for variable names expected by the app.
## When terminal/CLI is required
- Some tasks (local dev, advanced CI, building container images) require exporting/syncing to GitHub and running commands outside Lovable. Those steps are <b>outside Lovable (terminal required)</b> — follow the GitHub/CI notes in docs/GITHUB_NOTES.md.
// Prompt 2: Create CONTRIBUTING.md with Lovable-specific workflow guidance
// Action: create file CONTRIBUTING.md at project root with exact content below
Create CONTRIBUTING.md at the project root with the following content:
# Contributing
- <b>Start in Lovable:</b> propose changes using Chat Mode so collaborators can see diffs and discuss in-line.
- <b>Run Preview:</b> validate logic and UI inside Lovable Preview before publishing.
- <b>Set required secrets:</b> ensure needed secrets are present in the Lovable Secrets UI for Preview to work.
- <b>Use small commits:</b> accept focused patches so reviewers can easily comment.
- <b>If you must work locally:</b> export/sync to GitHub and follow docs/GITHUB_NOTES.md for local steps.
// Prompt 3: Create .env.example to document expected env variables
// Action: create file .env.example at project root with placeholders
Create .env.example at the project root with the following content:
# Example environment variables used by this app
# Fill these via Lovable Secrets UI or locally after exporting to GitHub
NEXT_PUBLIC_API_URL=https://example.com
DATABASE_URL=postgres://user:pass@host:5432/dbname
SUPABASE_URL=https://your.supabase.url
SUPABASE_KEY=your-public-key
# Add any other variables your app reads via process.env
// Prompt 4: Add docs explaining how to set secrets and when to export
// Action: create file docs/SECRETS.md with step-by-step text
Create docs/SECRETS.md with the following content:
# Secrets & Environment Variables
- In Lovable: open the project's Secrets UI and add keys from .env.example. These are injected into Preview and Publish runs.
- Never store sensitive values in files committed to the repository.
- If you export/sync to GitHub for local development or CI, add these variables to your local .env or to your CI secret store. Any CLI commands to use them must be run outside Lovable.
// Prompt 5: Optional - create a short PR template to remind reviewers about Preview and Secrets
// Action: create file .github/PULL_REQUEST_TEMPLATE.md with this content
Create .github/PULL_REQUEST_TEMPLATE.md with:
Please confirm:
- [ ] I ran Preview in Lovable and verified the change.
- [ ] Required secrets are set in the Lovable Secrets UI (or documented for export).
- [ ] This change does not expose any secret values.
From startups to enterprises and everything in between, see for yourself our incredible impact.
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.