With the stack you can use the same language, DTOs, libraries, etc.. both server and client side.
Server side rendering ensures a graceful handoff between server rendered state and the resulting app state on the client.
I’m also using MUI which includes all the components you need for a front end app.
I also just really like react/JSX, very strongly typed coupling between the html and JavaScript. Makes it very easy to refactor and pull out new components with confidence.
I really think this is the best stack for an MVP CRUD app right now. Interested to hear of anything better.
- Validations
- Translations
- Error and request logging and auditing
- Security (CQRS, CORS, CSRF)
- Permissions and a way to integrate it with your authentication (does supabase handle this? don't know)
- Email sending
- Background jobs
- Caching
- File uploading
- Rate limiting
- ...
Every time somebody suggests "just" Next.js, just "Remix", just "flask" or just [insert minimalist framework] I think they're either building something pretty trivial, or wasting a lot of time on rebuilding or integrating things you get for free with batteries included frameworks.
Then you think about all that time doing this could have been spent in actual business logic and it makes no sense to me anymore.
We wouldn't be the best fit for all of these, but here are some:
- Validations: handled already by Postgres and if you use JSONB you can use pg_jsonschema[0]
- Translations: probably won't ever be part of our stack, but for multilingual FTS we offer the pgroonga extension[1]
- Permissions: we offer AuthN (email & social logins, MFA, SSO) [2] and AuthZ with Postgres RLS[3]
- Background jobs: pg_cron [4]
- Caching: For images we have a smart cache [5]. We'll extend this to database queries over time
- File uploading: supabase storage [6]
[0] pg_jsonschema: https://supabase.com/blog/pg-jsonschema-a-postgres-extension...
[1] pgroonga: https://pgroonga.github.io/
[2] AuthN: https://supabase.com/docs/guides/auth/overview
[3] AuthZ with Postgres RLS: https://supabase.com/docs/guides/auth/row-level-security
[4] pg_cron: https://supabase.com/docs/guides/database/extensions/pgcron
[5] smart image cache: https://supabase.com/blog/storage-image-resizing-smart-cdn#s...
[6] supabase storage: https://supabase.com/storage
Do you use the serverless functions available with Vercel/Supabase? If so, I’m curious how you choose when to go with each provider.
This is why too many companies build on Python... some thought that maybe someday they will need some AI something, and they hamstring themselves from the start with inferior tooling.
You don't have to use RLS if you BYO middleware, but the RLS approach give you the option to do `frontent <-> backend` (vs `frontend <-> middleware <-> backend`)
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?
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.
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).
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.
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.
Compared to that JS ecosystem perhaps has too much :)
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!
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.
Reasons:
- I've been using Rails as an API only, so having to grok views felt like a waste. My React skills made me feel that learning how to make complex views in my backend was a waste of time.
- One type of bug I hate is ensuring my API calls have the right schema. With Supabase and TS in the frontend, this is a non-issue: export types from db schema and all frontend requests are typed.
- Supabase is something for sure: I had been eyeing it for a while now, and it did not disappoint. Getting endpoints - even with realtime updates/subs in the frontend - after just defining a schema is magical.
- Auth is super simple with RLS - all this uses my SQL knowledge and makes me double down on it, which seems like a sane choice given it's been around for decades.
- Mantine gives me a large list of prebuilt components. This isn't exclusive to this stack but would highly recommend using something like this instead of just Bootstrap or Tailwind on its own.
Overall I'm happy with the results, feels way faster than my React/Rails workflow. Way less time in the backend (models, migrations, presenters, etc), more focus on tweaking the product.
Con: does not move me in the direction of using Python more. Feel like this is going to be a must-have for AI-powered components.