Fetch data from Rails API with Next.js

  Рет қаралды 1,098

Ken Greeff

Ken Greeff

Күн бұрын

In this episode we will setup a repo that contains a Rails app running in API mode as well as a Next.js app for the frontend. I'll walk you through setting up each app from scratch and showing you how to connect them so that they can communicate via the API.
Tutorial Code:
github.com/ken...
Ruby on Rails:
rubyonrails.org
Next.js:
nextjs.org
TanStack Query:
tanstack.com/q...
--
Follow along to watch us build a Rails / SaaS / B2C app from the ground up.
Clipflow.co
www.clipflow.co
Twitter
Darrell - / craftbuildcut
Ken - / kennng

Пікірлер: 38
@tillcarlos664
@tillcarlos664 5 ай бұрын
This is exactly what my team needed - one guy works on this and hasn't done it before. Just forwarded it.
@kengreeff
@kengreeff 5 ай бұрын
Nice!
@KierynMoore
@KierynMoore 5 ай бұрын
Thanks Ken. Videos are very helpful to follow along
@kengreeff
@kengreeff 5 ай бұрын
Thanks mate! Hope you got something useful out of it :)
@EnjoytheMents
@EnjoytheMents 25 күн бұрын
Sick editing. Would be nice more series on this.
@kengreeff
@kengreeff 24 күн бұрын
Maybe in the future but I’m working on a big series building a directory with Rails! Similar concepts just without Next.js
@DestinoDello
@DestinoDello 5 ай бұрын
Wow i have been waiting for this thank you ken always
@kengreeff
@kengreeff 5 ай бұрын
Hope you enjoyed it!
@kengreeff
@kengreeff 5 ай бұрын
Let me know what you want to see next!
@DestinoDello
@DestinoDello 5 ай бұрын
@@kengreeff rails graphql api, clean architecture and more production stuff logging monitoring... 🙏
@danimusbar
@danimusbar 5 ай бұрын
Awesome... Suddenly appear in my home KZbin, keep up Sir
@kengreeff
@kengreeff 5 ай бұрын
Thanks and welcome :)
@sepehrkashani824
@sepehrkashani824 5 ай бұрын
Love it 🔥🔥🔥🔥🔥
@kengreeff
@kengreeff 5 ай бұрын
Thanks mate!
@768hiddenneurons
@768hiddenneurons 5 ай бұрын
Wow thank you! Was just looking for this kind of setup for my app! Wanna move my React & Rails project from a monolith to a monorepo like this one.
@kengreeff
@kengreeff 5 ай бұрын
Love that it was useful. I’ve just released a follow up which shows how to add the crud endpoints as well :)
@mark-ball
@mark-ball 5 ай бұрын
Thanks Ken, good to see some basic React Query stuff, and the auto-generated types from the rails schema was interesting too. Would love to see create, update, delete functionality the React Query way with useMutation.
@kengreeff
@kengreeff 5 ай бұрын
Thanks mate! Had another request for the same so I think I’ll have to add it to the list
@nadetdevfullstack7041
@nadetdevfullstack7041 5 ай бұрын
Excellent!
@kengreeff
@kengreeff 5 ай бұрын
Glad it helped!
@suiteyousir
@suiteyousir 11 күн бұрын
rails with intertia may an interesting one to try
@kengreeff
@kengreeff 10 күн бұрын
yea, I'm keen to give it a shot soon - just haven't found the need just yet. Stimulus + ViewComponents have been good enough so far :)
@tillcarlos
@tillcarlos 5 ай бұрын
Question: how do you deploy these 2 repositories together? Any kind of versioning needed?
@kengreeff
@kengreeff 5 ай бұрын
We ran separate repos in production and never had any real issues without versioning. I would probably setup the pipeline to deploy API first then the frontend after. Could also use feature flags. I think you can even have these issues when using next.js only - vercel tried to solve but not sure how well it works as I’ve never used that feature.
@redwansikder3847
@redwansikder3847 5 ай бұрын
whats the difference between using app directory directly vs src/app directory?
@kengreeff
@kengreeff 5 ай бұрын
To be honest, not sure. It’s been a convention to use the src directory for many years in js so probably just a preference thing. You can throw all your other directories into src as well, but either way probably works!
@suiteyousir
@suiteyousir 11 күн бұрын
which shortcut did you use to sort the json.extract! ?
@kengreeff
@kengreeff 10 күн бұрын
Do you know timestamp?
@suiteyousir
@suiteyousir 10 күн бұрын
@@kengreeff 24:10
@kengreeff
@kengreeff Күн бұрын
It's just F9 in my VSCode setup. I'm using the Sort lines extension - marketplace.visualstudio.com/items?itemName=Tyriar.sort-lines
@pablovillar4424
@pablovillar4424 5 ай бұрын
Can u make a simple crud with ror and nextjs for us? Button create, edit, delete and show more
@kengreeff
@kengreeff 5 ай бұрын
Hey Pablo, thanks for the great suggestion. I'll see what I can do if you make sure you subscribe and hit the bell icon ;)
@pablovillar4424
@pablovillar4424 5 ай бұрын
Done ;)
@youyoumu
@youyoumu 2 ай бұрын
🎉
@danimusbar
@danimusbar 5 ай бұрын
Btw, please make another tutorial using Phoenix Framework with Next JS
@kengreeff
@kengreeff 5 ай бұрын
Unfortunately I have zero experience with Phoenix so can’t provide much value there. I do have a follow up to this video though :)
@eltonsantosoficial
@eltonsantosoficial 12 күн бұрын
No way, it's hard mode. Jesus, there is a an easier and simpler way to do this. You made things too complicated to do something simple.
@kengreeff
@kengreeff 12 күн бұрын
Lots of ways to solve the same problems. This is just one of them if you want to use Rails as the API for Next.js frontend.
How to FETCH data from an API using JavaScript ↩️
14:17
Bro Code
Рет қаралды 179 М.
Fetching Data Doesn't Get Better Than This
6:58
Josh tried coding
Рет қаралды 144 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Next.js App Router: Routing, Data Fetching, Caching
14:32
Vercel
Рет қаралды 341 М.
This is How I Scrape 99% of Sites
18:27
John Watson Rooney
Рет қаралды 244 М.
The TSConfig Cheat Sheet
5:36
Matt Pocock
Рет қаралды 39 М.
NextJS 14 - How to FETCH DATA, SERVER API Routes
15:26
Codr Kai
Рет қаралды 22 М.
Next.js with React Testing Library, Jest, TypeScript
25:04
Dave Gray
Рет қаралды 74 М.
I tried 8 different Postgres ORMs
9:46
Beyond Fireship
Рет қаралды 445 М.
All Rust features explained
21:30
Let's Get Rusty
Рет қаралды 335 М.
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 239 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН