3

I currently have a website running PHP laravel. We came to a point where we want to add a user-backend -- where users sign-up and can access functions when logging in.

My question is; Is it possible to build a backend running Ruby and Ruby on Rails, while still keeping the front-end website in PHP Laravel? Would we have convert it? Or are we good running multiple languages?

Dan Pichelman
13.9k8 gold badges46 silver badges74 bronze badges
asked Mar 2, 2016 at 16:38

3 Answers 3

8

The usual way to support multiple languages is to find some way for the two to talk to each other. This is very common in the web world; you might have a ROR site talking to an Android application. The conduit being used there is XML or JSON web services.

answered Mar 2, 2016 at 16:44
3

One way is to explore micro-services.

In this case, you can have part of your application written in, for instance, PHP, and other part of the application written in RoR. These two applications communicate through HTTP, probably using REST.

answered Mar 2, 2016 at 17:00
1
  • By talking about microservices and REST, you are being too specific. More generally, every SOA approach would work, and could use both REST and SOAP. Of course, SOA is only one of the multiple approaches: there are also RPC, message queue services, etc. Commented Mar 27, 2016 at 9:57
1

It's very common to split web applications so that one part serves HTML, CSS, JS, images and so forth, while another part serves exclusively JSON through asynchronous javascript requests through some sort of API. It's usually easy to configure that to use a separate domain (api.example.com), but a different directory can work too (www.example.com/api). That way the division between the two parts (or in your case, languages) retains a logical organization.

answered Mar 2, 2016 at 17:57

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.