#Using NextJS and Rails API

7 messages · Page 1 of 1 (latest)

hoary crane
#

Is anyone here using NextJS application that calls to a rails api for its server data?

wintry bridgeBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

vestal tapirBOT
hushed ocean
#

Next.JS is a "fullstack" framework so it is recommended to do backend and frontend both in nextjs. However i've done something similar to what your suggesting but with a Next.JS and Laravel stack instead and it works like you'd expect and I even have it running on some personal projects that work great.

That being said your missing out on alot of next-js features like server components by fetching the data as you'd be introducing latency to your server running rails. That's why even though it works you'd be much better off doing data fetching and stuff inside of server components, entirely mitigating the data fetching entirely to your rails server.

If you really want to use rails

then it would be much better to use just react inside your rails application. I know nothing of rails but it seems like this blog post explains it well.
https://blog.logrocket.com/how-to-use-react-ruby-on-rails/

Build complex UIs with this tutorial outlining multiple ways to use and install React in a Ruby on Rails project.

hoary crane
#

Thanks so much @hushed ocean .

hushed ocean
#

np

hoary crane