/lovable-issues

Managing Multiple Workspaces in Lovable

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

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 Multiple Workspaces Need Manual Organization in Lovable

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.

 

Why this matters (detailed explanation)

 

  • Workspace isolation — Each workspace is an independent project area. Files, previews, and publish targets live per-workspace, so Lovable won’t implicitly merge or synchronize structure across them.
  • Secrets and environment vars are scoped — Secrets configured in one workspace don’t automatically appear in another. This prevents accidental leakage but requires deliberate duplication when services must match.
  • Preview and publish targets are per-workspace — Deploy settings, Preview builds, and domain mappings are configured per workspace, so coordinating environments (staging/prod) needs manual alignment.
  • No in-app terminal or scripting — You can’t run cross-workspace scripts inside Lovable to reorganize files, move packages, or run migrations. For heavy automation you must export/sync to GitHub and run CLI tooling outside Lovable.
  • GitHub/export boundaries — When you sync to GitHub from different workspaces you might end up with separate repos or branches; Lovable won’t automatically reconcile repo-level structure for you.
  • Naming and conventions matter — Because there’s no global index, consistent workspace names, README guidance, and folder conventions are the reliable ways to express relationships between workspaces.

 

Lovable prompts you can paste to create an onboarding note that explains this to your team

 

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

 

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 Manage Multiple Workspaces Efficiently in Lovable

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.

 

Create per-workspace metadata files

 

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"]
}

 

Create a single env loader and explicit env checks

 

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.

 

Create or update README with a short sync & Secrets checklist

 

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.

 

Optional: record a registry entry for a central view (export when needed)

 

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

  • Secrets must be added via the Lovable Secrets UI per workspace — the env loader will fail loudly in Preview if a Secret name is missing, which is intentional.
  • Use Publish → Export / Sync to GitHub when you need to perform terminal tasks or centralize the registry; label the target repo in .lovable/WORKSPACE.md first.
  • Keep naming consistent (WORKSPACE.md and manifest keys above) so you can script or manually assemble a central registry from exported repos 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 Organizing Multiple Projects in Lovable

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

 

Layout changes Lovable should make (paste this into Lovable chat)

 

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

 

Per-project README and package.json edits (paste into Lovable chat)

 

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"
  }
}

 

Secrets and naming conventions (paste into Lovable chat)

 

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

 

GitHub and CI files (create inside Lovable, but deployment runs on 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


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