Anyone vibe-coded/vibe-converted a Rails app to Phoenix?

Anyone vibe-converted a Rails app to Phoenix?

  • How did it go?
  • Which tools did you use?
  • Any tips?

Asking for a friend :sweat_smile:

I have not but if I were to, outside-in bdd sounds like a good fit.

Have your llm port the integration tests over. Run those and see them fail. Then port the controller/unit tests and follow the standard red/green bdd methodology until everything is green.

1 Like

Not necessarily vibe-converted, but definitely LLM assisted. It wasn’t a Rails application, but it was in Ruby.

My memory is somewhat fuzzy on the specifics, but I relied on the stranger fig pattern a lot. I ended up putting a load balancer in front of both applications, and gradually moved endpoints over, as they were implemented.

The application wasn’t enormous, but had some risky parts - billing, for one. At time of migration, the Ruby application was about 16kLOC Ruby, almost zero JS (less than 200 lines).

In some sort of irony, it’s actually the first project I tried building in Phoenix way back in 2014. But I ended up grinding on an Ecto library for weeks for a feature I needed, which was an absolutely gruelling process. At that point I decided to just use what I knew, which was Ruby. But all the years past I still maintained that library, and it’s now being used in the rewrite (again).

3 Likes

:slight_smile: grinding on Ecto is also my first experience with Phoenix, but I’ve decided to abandon it almost immediately and go with stored functions/procedures in Postgres + ecto_gen that generated the code around them in Elixir.

We’ve later replaced it with db-gen, which is language/framework agnostic tool, and we are using that for years. Ecto is a big no-no in our projects. Even C# ones use db-gen instead of Entity Framework.

1 Like

Yes, I created Xamal this way.

2 Likes

My first try was would match the “vibe-converted” description: It took an existing Rails app and asked Claude 4.x to convert to Elixir using high effort. The result was messy and not something I would want to maintain or use in production, so I discarded it.

Then, I told Claude to analyze the Rails project and create a detailed spec for a team that would have to implement this in a different language but would not have access to the original code or product. With that, I asked Claude to analyze this spec and determine what order to develop all the elements in, such that a user could start playing with the app at every stage. I specifically asked it to stay away from implementation details (so it wouldn’t suggest Rails-style “solutions” for things like caching or background queues).

This gave me a bunch of .md files that I used to create a brand new Phoenix/Ash project that I then worked through step by step to implement the way you would fresh in Elixir. It was a lot more work than anything vibe-coded/converted but I am quite happy with the result.

3 Likes

Thanks for the replies everyone - very helpful!

I think for this particular project I will try an LLM to upgrade it to Rails 8 (currently on Rails 4) because it has an e-commerce component and doesn’t really need the power of Elixir/the BEAM, but definitely going to try converting one in the future!

If anyone stumbles across this thread in future and has any further tips, please add them!