Optimize multiple Lovable workspaces with manual organization techniques and best practices. Boost project efficiency now.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
Multiple workspaces in Lovable need manual organization because Lovable treats each workspace as an isolated, editor-first environment with its own settings, secrets, preview/deploy targets, and optional GitHub mapping — there’s no automatic cross-workspace linking or centralized project index, and you can’t run terminal commands inside the app to reconcile or script across workspaces.
// Prompt 1: Create a workspace doc explaining why manual organization is required
// Instruction: Create file docs/multiple-workspaces.md with the exact content below.
Create file at docs/multiple-workspaces.md with this content:
# Why multiple workspaces need manual organization
Summary:
Lovable workspaces are intentionally isolated: files, previews, secrets, and publish settings live per-workspace. There is no automatic cross-workspace sharing or terminal to run cross-project scripts. Because of that, we must organize things manually: duplicate secrets when needed, align publish settings, and use consistent naming and docs to communicate relationships.
Key points:
- Workspace isolation prevents automatic merging or syncing between workspaces.
- Secrets and environment variables are scoped to each workspace.
- Preview/build/publish configurations are per-workspace and must be aligned manually.
- Lovable does not include a terminal — for scripted reorg or repo-level changes, use GitHub export/sync and run commands outside Lovable.
- GitHub mapping can create separate repos/branches per workspace; plan repository layout intentionally.
Recommendations (brief):
- Use clear workspace names and a top-level README linking related workspaces.
- Duplicate required secrets deliberately; keep a single source-of-truth (outside Lovable) if you need automation.
- Use GitHub sync when you need CLI or CI to do cross-repo tasks.
End of file.
// Prompt 2: Update root README to reference the new doc
// Instruction: Edit README.md at project root. If it exists, append a "Workspace organization" section linking to docs/multiple-workspaces.md. If README.md doesn't exist, create it with the section below.
Create or update README.md with the following section added near the top:
## Workspace organization
See docs/multiple-workspaces.md for why we manually organize Lovable workspaces and how to coordinate secrets, publish targets, and GitHub exports across projects.
This prompt helps an AI assistant understand your setup and guide you through the fix step by step, without assuming technical knowledge.
Use small, consistent workspace metadata files, a single in-repo place for Secrets references + an env loader, and a lightweight central registry (exported to GitHub when you need cross-workspace operations). Do those four things inside each Lovable workspace: create a WORKSPACE.md with canonical name + preview URL, add a .lovable/manifest.json for automated tooling, add a tiny src/lib/workspaceConfig.ts that reads named env vars (so Secrets UI names are consistent), and keep a workspace-registry entry you can export to GitHub when you need a central view. That lets you manage many workspaces predictably from Lovable’s UI (Preview, Publish, Secrets) and via GitHub sync when deeper control is required.
This prompt will create a clear, editable in-repo place to document the workspace name, primary branch, preview URL, GitHub repo, and required Secret keys.
// Please create these two files exactly at the paths below with the given content.
// The first is human-readable; the second is machine-readable for tools or a central registry.
create file .lovable/WORKSPACE.md
// WORKSPACE.md - open and editable record for this Lovable workspace
# Workspace metadata - fill values below
name: "REPLACE_WITH_WORKSPACE_NAME" // example: customer-portal-dev
owner: "team-or-person" // example: frontend-team
primary_branch: "main"
preview_url: "PASTE_PREVIEW_URL_FROM_LOVABLE_PREVIEW_PANEL"
github_repo: "github.com/owner/repo" // optional, if you export/sync to GitHub
deploy_target: "lovable-preview / external" // short note where this workspace is deployed
required_secrets:
- NAME: "SUPABASE_URL"
- NAME: "SUPABASE_KEY"
// Save and keep this file updated whenever you rename or change preview links.
create file .lovable/manifest.json
// manifest.json - machine readable summary for registry/export
{
"name": "REPLACE_WITH_WORKSPACE_NAME",
"owner": "team-or-person",
"primary_branch": "main",
"preview_url": "PASTE_PREVIEW_URL",
"github_repo": "github.com/owner/repo",
"secrets": ["SUPABASE_URL","SUPABASE_KEY"]
}
This prompt will add a small module that reads required env names consistently. Use these variable names when you add Secrets in Lovable Cloud Secrets UI.
// Create a file that centralizes env access and throws clear errors when a Secret is missing.
// This makes workspace-level Secrets naming consistent across many workspaces.
create file src/lib/workspaceConfig.ts
// src/lib/workspaceConfig.ts
export function getRequiredEnv(name: string): string {
const v = process.env[name];
if (!v) {
// Throwing early gives a clear error in Preview logs and makes it obvious which Secret to add
throw new Error(`Missing required env "${name}". In Lovable Cloud, open the Secrets panel for this workspace and add a Secret named ${name}.`);
}
return v;
}
// Example exported helper usage:
// export const SUPABASE_URL = getRequiredEnv('SUPABASE_URL');
// export const SUPABASE_KEY = getRequiredEnv('SUPABASE_KEY');
// Please add the two example exports above (uncomment) if this workspace uses Supabase.
This prompt will add a checklist so teammates know how to set Secrets in Lovable, publish, and export to GitHub—without requiring a terminal inside Lovable.
// Add a short checklist so contributors know the exact UI steps and the Secret names to add.
append file README.md
// Workspace checklist (for Lovable users)
// - Open Lovable workspace -> Secrets (right-hand panel) and add:
// SUPABASE_URL
// SUPABASE_KEY
// - Use Preview to verify app boots without "Missing required env" errors.
// - To persist to GitHub: use Lovable Publish -> Export / Sync to GitHub (choose the repo indicated in .lovable/WORKSPACE.md).
// - For cross-workspace overview, export this repo to a central registry repo on GitHub and add the .lovable/manifest.json entry.
If you want a global view across workspaces, keep a simple registry file you can export to a central GitHub repo from Lovable Publish → Export to GitHub. Do this when you need cross-workspace automation (this step is outside Lovable only if you create a separate central repo locally).
// Create or update a registry entry file in this workspace that you can copy/export to a central repo.
// To combine many workspaces, export each .lovable/manifest.json into a central "workspace-registry" repo via GitHub.
create file .lovable/registry-entry.json
// .lovable/registry-entry.json
{
"workspace": "REPLACE_WITH_WORKSPACE_NAME",
"manifest_path": ".lovable/manifest.json",
"last_updated": "REPLACE_WITH_DATE",
"notes": "Short note on purpose or owner"
}
Important operational notes
Keep each project in its own folder, add a single top-level index that maps names → paths → how to Preview/Publish, keep shared code in a packages/ folder, use consistent Secrets naming per-project, and use Lovable’s Chat edits to create the files plus Preview/Publish and the Secrets UI for env values. Use GitHub sync only for CI/deeper control (marked where terminal/GitHub actions run outside Lovable).
Prompt: Create a clear monorepo layout and index so other teammates (and Lovable Preview) know how to open each project.
// Create files and folders for multi-project layout
// Create projects.json at workspace root
create file /projects.json with content:
{
// map of project name -> folder -> preview file -> publish notes
"web": {
"path": "apps/web",
"previewEntry": "apps/web/src/main.tsx",
"buildCommand": "npm run build --workspace=apps/web",
"publishHint": "Use Lovable Publish on apps/web or GitHub Actions"
},
"api": {
"path": "apps/api",
"previewEntry": "apps/api/src/index.ts",
"buildCommand": "npm run build --workspace=apps/api",
"publishHint": "Use Lovable Publish to push the function or deploy via GitHub"
}
}
// Add root README that tells how to Preview each project in Lovable
create file /README.md with content:
# Workspace index
// Use Lovable Preview to open the previewEntry path for each project.
// Use Lovable Secrets UI to set per-project secrets (see /docs/secrets-guidelines.md).
// Use GitHub sync for CI/deploy workflows (files under .github/ created here).
Prompt: Add per-project README and scripts so Preview and future CI understand how to run each project.
// Create per-project README and package.json scripts
create file /apps/web/README.md with content:
# web
// Preview this project in Lovable by opening apps/web/src/main.tsx in Preview.
// Scripts are in package.json.
create file /apps/web/package.json with content:
{
"name": "web",
"version": "0.0.1",
"scripts": {
"dev": "vite --port=5173",
"build": "vite build",
"preview": "vite preview --port=5173"
}
}
create file /apps/api/README.md with content:
# api
// Preview this project in Lovable by opening apps/api/src/index.ts in Preview.
create file /apps/api/package.json with content:
{
"name": "api",
"version": "0.0.1",
"scripts": {
"dev": "ts-node-dev src/index.ts",
"build": "tsc -p tsconfig.json"
}
}
Prompt: Add a docs file that instructs teammates how to set per-project Secrets in the Lovable Secrets UI and how to name them.
// Create guidance for Secrets
create file /docs/secrets-guidelines.md with content:
# Secrets Guidelines
// Use Lovable Secrets UI (Workspace Settings → Secrets) to add secrets.
// Use naming: PROJECTNAME_KEY (uppercase) to avoid collisions, e.g. WEB_SUPABASE_URL, API_JWT_SECRET.
// Reference secrets in code via process.env.WEB_SUPABASE_URL (or through your runtime environment).
// For GitHub Actions, create corresponding repo secrets in GitHub (outside Lovable).
Prompt: Add a simple GitHub Actions workflow file to run tests/builds when you push. Note: running CI and connecting to GitHub requires enabling GitHub sync outside Lovable.
// Create GitHub workflow file (this file will run when the repo is pushed to GitHub)
// Outside Lovable: enable GitHub sync or push this repo to GitHub to use CI.
create file /.github/workflows/ci.yml with content:
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
// install node, run workspace build
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm ci
- run: npm run build --workspace=apps/web
- run: npm run build --workspace=apps/api
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.Â