Skip to main content

Rails API backend with Electron Frontend

Rails • Asked by shakycode

I'm working on a SaaS platform that will be heavily API driven with a React or Vue front end. But there's a requirement for a desktop app to give the customer something "tangible" to hold in their hands (marketing is pushing for this).

What are my options if any for making a desktop app that connects to a Rails API backend. I've been looking at Electron and I think it's doable, but was wondering if anyone has done anything like this before and could offer some tips in getting started. In the meantime I'm reading the electron docs and seeing what's possible. At the surface since it's all JS it looks like it's just a matter of heavy javascript front end work making tons of API calls but I could be wrong.

Any guidance for an Electron newb like me is greatly appreciated.

And yes, I know this is not the best idea trying to make a desktop client for a web framework backed app, but gotta pay the bills :)


I think its a very viable proposition. Infact I recommend to go with it. I created one for a client. Same SaaS platform API, React Frontend, ReactNative Mobile App and a Electron Desktop App. If you are familiar with React/Redux then you can implement that in Electron as well. I also went ahead with some offline capabilities by using Postgres as a local DB. Checkout https://github.com/brianc/node-postgres .

I cannot stress on how affordable it is to build one. Its just Javascript end of day and moreover if you have worked with React enough this shouldn't be difficult at all.

Go ahead! Give it a shot!

Cheers!


Thanks Aniket. I just don't have enough exposure to electron to speak intelligibly about it yet. However I saw that Basecamp has an electron client for basecamp3 and they are an all rails/api backend so like you said, it's just a ton of javascript.

Definitely affordable (free) to build one and it's a requirement of this new project I'm working on. If you have any examples or tutorials (I've yet to find anything decent) feel free to share!

Cheers!
-James


Hey so here is what I referred to to build or rather to understand how to build https://scotch.io/tutorials/build-a-music-player-with-react-electron-i-setup-basic-concepts

There also some material on Lynda https://www.lynda.com/Electron-tutorials/Electron-Building-Cross-Platform-Desktop-Apps/518051-2.html

Unfortunately there is not much to refer to than these. I could explain, but I am super swamped at work clocking about 14-15 sometimes 16 hours. Startup mode :|

Cheers!


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.