Question

React frontend (nodejs) and Ruby on Rails (w/ postgres db) backend on a single droplet?

Posted August 3, 2020 986 views
Ruby on RailsReact

Is it possible to do a full stack React + Rails (w/ postgresql database) on a single $5/month droplet or do I need to have two separate droplets for frontend & backend?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi there @GiancarloZ,

Yes, I believe that it should be ok to have both on 1 Droplet when starting. In case that your project grows, then you could plan to scale up with multiple Droplets.

Regards,
Bobby

  • Hi @bobbyiliev thanks for your response. I currently have my react frontend code on my droplet but i don’t know how to get the rails code on the same droplet.

    • Hi there @GiancarloZ,

      You could follow this tutorial here on how to build a Rails app on your Droplet:

      https://www.digitalocean.com/community/tutorials/how-to-build-a-ruby-on-rails-application

      One thing that you need to keep in mind is that your Rails and React applications should run on different ports.

      Regards,
      Bobby

      by Kathleen Juell
      Rails is a web application framework written in Ruby. It takes an opinionated approach to application development, assuming that set conventions will best serve developers in cases where there is a common end goal. In this tutorial, you will build a Rails application that will enable users to post information about sharks and comment on other users' posts, creating a larger conversation about sharks and their behavior.
      • If I have a nodejs droplet with a React frontend on it. Is tehre a way to put my ruby on rails project backend onto the nodejs droplet? or is there another way of doing it? I’ve already built the backend project i just woudl like to put it on the same droplet as my frontend but I can’t find anywhere if that is possible. Thanks for your help!

        • Hi there @GiancarloZ,

          Yes, it should be ok to start your rails project on the same Droplet, you just need to make sure that it is running on a different port.

          Another thing that you could do is run both your applications in Docker containers on different ports, that way you would have better isolation.

          Regards,
          Bobby