News for hackers. Stuff that matters.
Re:Ask HN: What would be your stack if you are building an M... by foxandmouse on Thursday January 26, 2023 @12:55PM (#34535620)
I'm glad I came across your comment, I'm planning a 2-week project for learning purposes and I thought rails backend with react/ svelte would be the fastest way to prototype.

My ruby/ rails experience is very limited compared to my JS experience; I really just started experimenting with rails. I'm blown away by the magic, JS frameworks feel like toys in comparison. I also like that Rails is omakase.

Based on your experience, would you suggest trying rails or going the full JS stack route?

Re:Ask HN: What would be your stack if you are building an M... by jrvarela56 on Thursday January 26, 2023 @01:02PM (#34535780)
I was faced with this decision a month ago and started building my models and views in Rails 7. Late night tinkering with views, then trying out ViewComponent I went 'dude wtf am I doing, these apps are so easy to build in React'... Next.js with Supabase has been a breeze. Setting up db with auth and getting realtime updates and object storage with minimal setup (TS fn calls) was mind-blowing.

Caveats: setting up Supabase auth takes a bit of reading docs, using the js helpers correctly and configuring RLS, but after that it just works.

Re:Ask HN: What would be your stack if you are building an M... by weaksauce on Thursday January 26, 2023 @02:52PM (#34537771)
imo rails without react and leveraging hotwire is going to be the next big thing in web dev. react is a huge increase in complexity for not much appreciable gain. you are not facebook and don't have facebook's needs. rails is nimble by itself.
Re:Ask HN: What would be your stack if you are building an M... by JeremyNT on Thursday January 26, 2023 @03:49PM (#34538616)
I'm a fan of this too, and it honestly confuses me that people would do a Rails API with React for a MVP.

If you're already doing the backend in rails, it's hardly any more work to just do hotwire with server side rendering at the same time, and you can switch to a SPA later (if you really do need to).

Re:Ask HN: What would be your stack if you are building an M... by 0xblinq on Thursday January 26, 2023 @04:01PM (#34538778)
Most people in this thread are not suggesting a stack for an mvp. They’re just listing their favorite stacks, that’s it.

There’s a comment of somebody saying that just Postgres and Go. How on earth is that a good stack for building an mvp?? You’ll have to write a shit ton of code or glue together 10 thousand libraries.

Re:Ask HN: What would be your stack if you are building an M... by weaksauce on Thursday January 26, 2023 @06:04PM (#34540137)
it's also not a ton more work to pivot and turn the rails app with hotwire into an ios/android app with a minimal amount of work. and yeah you can also sprinkle react in if you need some component or two or even do the api that way and drop into a full SPA if you really need that. but at that point you are doubling the amount of work on the frontend for little gain in my view.

I liked the idea of react and have used it but i don't feel like it improves the situation enough for 95% of the sites out there to justify it and the enormous extra work there is in getting state/routing/etc to jive with the backend. I'm hoping strada, if it ever comes out, will be a large improvement to turbo native and at least provide a very compelling alternative react native.

Re:Ask HN: What would be your stack if you are building an M... by kirso on Friday January 27, 2023 @08:01PM (#34553958)
I would love to learn more about this. As a complete beginner though I tried to find resources for full-stack Rails and unfortunately there is nothing much there that teaches you the new front-end or shows how to build an MVP.

Compared to that JS ecosystem perhaps has too much :)

Re:Ask HN: What would be your stack if you are building an M... by weaksauce on Saturday January 28, 2023 @07:20PM (#34563469)
Hotwire is pretty new but there are some guides out there. it's a progressive enhancement thing generally so you build it normally and then sprinkle in the extra stuff.

1000 foot overview: https://boringrails.com/articles/thinking-in-hotwire-progres...

a tutorial: https://www.hotrails.dev/turbo-rails

a video tutorial: https://www.driftingruby.com/episodes/hotwire-introduction

probably a good paid option: https://pragmaticstudio.com/hotwire-rails

and then there is the main site: https://turbo.hotwired.dev/

cheers!

Re:Ask HN: What would be your stack if you are building an M... by kirso on Monday January 30, 2023 @07:38PM (#34589073)
Thank you!
Re:Ask HN: What would be your stack if you are building an M... by insane_dreamer on Thursday January 26, 2023 @03:49PM (#34538612)
I'd stick with rails unless you have a complex front-end where UI responsiveness is of the essential (i.e., highly graphical-interactive). React is many levels up in terms of complexity.
Re:Ask HN: What would be your stack if you are building an M... by pcthrowaway on Thursday January 26, 2023 @06:13PM (#34540215)
Rails and React are doing completely different things in the stack; I don't understand this argument (having worked with both, but never getting good at Rails)

React is purely about managing the frontend and user interactions. Many apps are very heavy on this. For a lot of things I've built, I think Rails would have been overkill. Even for ones that use a database, I find node.js/express/prisma much easier to work with (until you get into migrations). Activerecord's story around migrations is the best I've used.

But for an MVP you don't really need to worry about that.