Replit and Lovable are great – but once you’re in them, you’re in them, right? We’ve had clients come to us asking to take their app out of Replit or Lovable, which we’ve now done a number of times and have honed a process around.
But can you go in reverse? Can you take a project that was built in Replit and then later “ejected,” and put it back into Replit to continue iterating on it?
We tested to see if you could. The short answer is, “theoretically yes” and even “for the most part yes,” with a few important caveats.
Putting Toothpaste Back in the Tube
There are a number of ways to get a project into Replit. You can upload a zip file, and you can also connect to a Github repo and import it that way. That’s what we did.
Once we had it in there, we gave it a simple prompt, asking it to get it running while changing as little code as possible. Since our intent is to eventually go back and forth between Replit and production, this ensures our diff stays small, and the code stays as clean as possible.
It explored the codebase, and got it running!
That was easy. So is the answer yes? Is it that easy?
Yes, but…
We ran into a few things as we got the app functional. None of these are massive deal-breakers, but they do make the process a little fragile, fiddly, and less desirable:
Environment Variables
Like most modern apps, the app we tried to put back into Replit uses environment variables to keep secrets hidden. Those secrets are necessary for different parts of the app to work, like making API calls to other services and things like that.
When we imported the app, the bot just started trying to boot the app, and didn’t seem to respect the .env
file we manually added to the project root. What that meant is that we needed to immediately stop the bot from trying to build the app, manually enter the environment variables in the Secrets section of the Replit app:
Once we did that, we told it to continue building the app, and it picked up the values.
Auth0 Callbacks
This app uses Auth0 to handle authentication, using an oAuth workflow which redirects to oAuth for authentication, then calls back to the app when auth is finished, finalizing the session.
However, the Replit app wasn’t running on a domain we knew, it was just running inside the Replit container. How could we get a predictable callback URL to give to Auth0?
The answer is to open the app outside of the Replit environment:
When you do this, you get a new URL, one with a UUID in it. That URL (as of Oct 2025), appears to be stable between sessions working on the app. So once you open it outside of Replit, you can grab that root URL and use it for your auth callback URLs.
Local Databases
The app we imported uses AWS, and complained about not having some tables available (despite being given the AWS connection information):
It changed things to use a local PostgreSQL database, which is actually fine (and could be preferred), but something to note about how it might handle database connections when imported.
Completing the Loop
Once we had these things patched up, the app loaded fine, and worked as it was supposed to. Honestly, we were pretty shocked at how well it went. The next test was to make a change, export the code, and submit a pull request to Github to see if you could effectively use Replit in a production code development process.
We asked the AI in Replit to build a simple feature: a new chart on the homepage of the app. It grinded for awhile, then added it perfectly. To check the changes, we exported the code and dragged the project files into the existing project to create a diff we could generate a pull request from.
Surprisingly, the PR looked really good! There wasn’t a lot of extraneous code, the diff it produced was pretty compact, and it handled the new functionality in a sensible way that matched the rest of the codebase well.
This was a simple test, but encouraging nonetheless. It’s very likely that with larger, more complex tasks, it may produce a diversion from the main codebase that’s not as tolerable.
Warning: Best Dev Practices Still Apply!
An important part of making this work well in reality is ensuring you can keep this replit -> production -> back to replit -> production loop going. This is how real life dev teams work. They take the latest version of code that’s running in production, “branch” it, make changes, then “merge” those changes back into the thing in production. Rinse, repeat.
One best practice that excellent dev teams follow: small diffs. A small diff (difference), means a small amount of code that has changed since it was branched off the code running in production. Why does it matter how much code has changed? Because best practices in excellent teams say that all code should be reviewed by a human before going to production (and sometimes 2, or 3!) as a safety check to make sure nothing unstable or insecure, or just broken or badly written, is going out into the world for real people, with real data, to use.
The smaller the diff, or amount of changes, the less code humans have to review, and the easier it is for those humans to incorporate those changes into their mental map of how the software works.
The Verdict
The final verdict? Yes, you can take a non-Replit project, and put it back into Replit, or at least, one that was initially created in Replit, ejected, worked on, then brought back in. It’s relatively likely this will work with any NextJS app, although we haven’t tested it more extensively.
As with anything in both the software development and the AI spaces, this isn’t guaranteed to stay the same for long, and may very well not work forever.
Want to Keep Going with Your Replit Prototype?
If you’ve been building something cool in Replit or Lovable and want to take it a step further, that’s exactly the kind of thing we love helping with. At Sourcetoad, we’ve worked with teams who start their ideas in Replit and need a hand turning those early prototypes into real, production-ready apps. Whether you want to audit your code, connect it to real systems, or just figure out what’s next, we can help you get there.
Enjoyed this post? Check out these others to keep leveling up your AI prototyping game: