- Non-technical team members can continue rapidly prototyping and iterating in the Lovable environment they’re comfortable with
- Developers can simultaneously build robust production infrastructure around the Lovable app
- Changes sync seamlessly between environments without requiring a complete rebuild
- Your team maintains a collaborative workflow instead of a one-time handoff
Understanding the Workflow
Before diving into the technical steps, let’s understand the overall workflow:-
Lovable + GitHub branches for prototyping:
- Your team continues to use Lovable for rapid prototyping
- Changes are made on feature branches, not directly on main
- Pull requests are created to review changes before merging to main
-
Turborepo + Submodule for development:
- Your Lovable app exists as a Git submodule inside the Turborepo
- Developers can build around the app (backend, services, packages)
- The main app lives in the original repo, everything else is built around it
-
Synchronized development:
- Changes to Lovable can still be made through the Lovable interface
- Technical changes can be made by developers using Cursor or any code editor
- Both workflows coexist without disrupting each other
Prerequisites
- A Lovable app ready for handoff
- Basic knowledge of Git and GitHub
- Familiarity with monorepo concepts
- Cursor IDE installed (recommended)
- Node.js and pnpm
The Setup Process
Step 1: GitHub Integration
First, connect your Lovable app to GitHub:- In Lovable, go to your project settings
- Click “Connect to GitHub”
- Authorize the GitHub integration
- Create or link to an existing repository
Step 2: Create Your Turborepo
Create a new repository for your production monorepo:Step 3: Add Lovable App as Submodule
Add your Lovable app repository as a Git submodule:Step 4: Build Production Backend
Create a backend service in your monorepo:Step 5: Connect Frontend to Backend
Update your Lovable app to use the new backend. Add environment variables to your Lovable app:Step 6: Configure Turborepo Scripts
Update your rootpackage.json
to include build scripts:
turbo.json
to include your apps:
Advanced Integration Techniques
Shared Components
Create shared UI components that both your Lovable app and other apps can use:Database Integration
Add a shared database package:Deployment Strategy
Deploy your entire monorepo using Railway or Vercel:- Frontend (Lovable app): Deploy as a static site
- Backend: Deploy as a Node.js service
- Database: Use Railway’s PostgreSQL or similar
Benefits of This Approach
- Continuous Collaboration: Non-technical team members can continue using Lovable while developers build production infrastructure
- Gradual Migration: You can gradually move pieces from Lovable to custom code as needed
- Shared Codebase: All production code lives in one place, making it easier to manage
- Version Control: Everything is properly tracked in Git with clear history
- Scalability: Easy to add new services, packages, and apps as your project grows
Maintaining the Workflow
For Lovable Changes
- Make changes in Lovable interface
- Lovable automatically pushes to GitHub
- Pull the latest changes to your submodule:
For Technical Changes
- Make changes directly in the code using Cursor or your preferred editor
- Test locally with the full monorepo setup
- Push changes to the Lovable repository
- Changes automatically sync back to Lovable