Setup A Ruby on Rails 7 API With React JS

Поделиться
HTML-код
  • Опубликовано: 7 июн 2024
  • Ruby On Rails 7 just released, and after watching DHH's Rails 7: The Demo I wanted to take a look at how easy it is to create a Ruby on Rails 7 API React project. This Ruby on Rails API idea is something I've covered before on the channel, but this time we'll just get the bare bones setup.
    Join this channel to help support these videos:
    / @deanin
    React + Rails CRUD Tutorial:
    • Setup React CRUD With ...
    Previous React + Rails playlist: • React + Material UI Fr...
    Source code for this video:
    github.com/Deanout/bookstore-...
    Timestamps
    0:00 Setup a Ruby on Rails 7 API
    5:28 Creating The React JS App for our Rails 7 API
    9:57 How to access the Rails 7 API From Javascript with Axios
    13:02 How To Render Rails 7 JSON Data in React
    Follow me on social media:
    linktr.ee/deanin
    If you liked this video, please consider subscribing for deanin rails new tutorials: t.co/RZ4EwP0F2a
    #Deanin #Rails #RubyonRails

Комментарии • 82

  • @junmarkchi8538
    @junmarkchi8538 Год назад +21

    I think we need more of this React Rails content

  • @salimmalik302
    @salimmalik302 6 месяцев назад +1

    This is such an amazing tutorial! Has to be one of the best tutorial videos i have came across. Thanks for doing this

  • @willmattwood
    @willmattwood Год назад

    I found this video extremely helpful. I am a React developer currently with a Ruby background, still brand new to Rails. So it actually took me a few hours to go through it because at each step I had to add something new to my mental model of rails. But all in all - really a great tutorial and also helped me build out my understanding of web dev generally. Really appreciated this!

  • @wanna_1_year_vacation
    @wanna_1_year_vacation 2 года назад +5

    I'm always enjoying watching your videos as a rails developer. Thank you for the video.

    • @Deanin
      @Deanin  2 года назад

      Thank you for the kind words, I'm glad you enjoy the videos!

  • @Mixesha001
    @Mixesha001 2 года назад +19

    In Depth Rails 7 API auth, json caching, User roles, pagination etc is something needed.

    • @Deanin
      @Deanin  2 года назад +4

      I'll add these to the list, I really appreciate the suggestions!
      I did cover user roles with Devise last wek if that's something that interests you: ruclips.net/video/FdCsBwI7raY/видео.html

  • @randerins
    @randerins 2 года назад +5

    "Posted 1 day ago"
    I swear this couldn't come up anymore handy. It's 4:54 AM here and I'm struggling to set these 2 frameworks together for a project. Thanks a LOT! One more sub

    • @Deanin
      @Deanin  2 года назад +1

      Hahaha, that's some pretty convenient timing, glad it helped!

  • @nonanik112
    @nonanik112 2 года назад +3

    You are one of the valuable educators on this platform

    • @Deanin
      @Deanin  2 года назад +1

      Thanks haha, I really appreciate the kind words!

  • @EnjoytheMents
    @EnjoytheMents 2 года назад +1

    Very nice video Deanin!

    • @Deanin
      @Deanin  2 года назад

      I appreciate it!

  • @wesleygrant2245
    @wesleygrant2245 Год назад +6

    What extension are you using for those React autocompletes? Also could you explain the mounted cleanup function in your useEffect a little? I run into a lot of issues with empty dependency arrays. Super awesome video though, thank you for this!

  • @Deanin
    @Deanin  2 года назад +6

    The channel has a discord where we'll try to answer your questions: discord.gg/vumKwDk
    Hope the video is helpful, more to come soon! (hopefully lol)
    Edit2: User Authentication with Rails and React using the Doorkeeper Gem is live now! ruclips.net/video/KnTtdxRlEE0/видео.html
    Edit: React + Redux + TypeScript CRUD app with Rails 7 API is up here: ruclips.net/video/ZGnMqKg-Cq4/видео.html

  • @developerfoe
    @developerfoe Год назад +1

    quite appreciatable thing ... someone working on courses/videos of latest ROR version....

  • @shiccorama
    @shiccorama Год назад +1

    Thank you so much Deanin

  • @vuminhtien5841
    @vuminhtien5841 Год назад

    Thanks for your sharing. It helps me a lot.

  • @user-hi3ud3um7m
    @user-hi3ud3um7m Год назад

    Thanks, it's exactly what I need :)

  • @ThEReAlCrAnTlY
    @ThEReAlCrAnTlY Месяц назад

    great tutorial

  • @manuelmens8558
    @manuelmens8558 Год назад

    My first time watching you and you're awesome and swagerize

  • @SachinSingh87
    @SachinSingh87 Год назад

    Helped a lot.

  • @shreyasrajagopal4433
    @shreyasrajagopal4433 7 месяцев назад

    11:20 "fancy but also unsettling" :)

  • @cherylcollier466
    @cherylcollier466 2 года назад

    Thanks for this, when I try to run a simple model test I get a whole load of console errors, do you know why this could be?

  • @salomaonovacena6198
    @salomaonovacena6198 Год назад

    Deanin, Is Vue technology more viable than react or is it a matter of personal choice?

  • @williamromerovela
    @williamromerovela 2 года назад +4

    Thank you for this great video. It could be nice if you create a video for each way to create react-rails apps. Thank you in advance.

    • @williamromerovela
      @williamromerovela 2 года назад +1

      There are many text tutorials to create a react rails apps but doesn’t go deep on the pros and cons to uses each way to implement it.
      Thank you again.

  • @jhonacosta8450
    @jhonacosta8450 Год назад

    never had used rails. So impresed by scaffold command. I'd like to see more extend use of rails power for backend. Tysm

  • @eoghanfeighery7383
    @eoghanfeighery7383 Год назад

    Would this tutorial work in an existing RoR project?

  • @beynod_ordinary
    @beynod_ordinary 6 месяцев назад

    I have never seen declaring let mounted = true and to clear side effects mounted = false. Could you explain the usage a bit? Thanks

  • @hawkespoulter556
    @hawkespoulter556 4 месяца назад +1

    10/10

  • @alemiralles8961
    @alemiralles8961 Год назад +1

    Thanks

    • @Deanin
      @Deanin  Год назад

      Glad it was helpful, and thank you too!

  • @bobbyd1231
    @bobbyd1231 2 года назад

    Is there no way to compile bookable to the public folder?

  • @celina6204
    @celina6204 2 года назад +5

    Would love to see the CRUD functionality in React. I'm working on a small personal project and I had trouble figuring out where to start. Thanks a lot for this.

    • @Deanin
      @Deanin  2 года назад +1

      Glad it helped! I'll take a look at getting something up ASAP to help out with your project. 🙂

    • @Deanin
      @Deanin  2 года назад +6

      Just wanted to follow this up that the CRUD tutorial is now up. Hope it helps!
      ruclips.net/video/ZGnMqKg-Cq4/видео.html

    • @Lucas-bh3et
      @Lucas-bh3et 2 года назад +1

      @@Deanin i love u, thanks 🥵🥵

    • @fabricio-garcia
      @fabricio-garcia 2 года назад +1

      I don't know if someone told you this already Dean, but you are a real superhero 😊

  • @focusme-tv3650
    @focusme-tv3650 Год назад +1

    Hey Deanin! 🔥
    I have a question for you: How to deploy such an app? Indeed the Rails API and React apps are inside the same project folder. But how to handle it?
    I wanted to find a solution to deploy both Rails API + React on the same server.
    I think there's probably a solution with the "react-rails" gem, injecting the components in the views with a helper, but I'm not a fan...
    Is it actually possible with your implementation? And if yes how?
    Thank you in advance!
    A.MLL

    • @mellonaudion4870
      @mellonaudion4870 Год назад

      Hi,
      I've the same question here ! Did you manage this ?

  • @DevBishwasBh
    @DevBishwasBh Год назад

    Can I use react without making apis?

  • @siyaram2855
    @siyaram2855 2 года назад +1

    How does it perform in concurrency test?
    The integration has improved a lot and it is much simpler now.
    I remember trying rails last year and trying it with react and the process was so weird that I stopped learning it.

    • @Deanin
      @Deanin  2 года назад +2

      I think its concurrency has improved quite a bit, and considering the applications it's used for it's probably fine.
      I think the biggest issue for me is that if I'm honestly going to build an application that I expect to have a life cycle, I'm going to use something like DotNet or a stack like MERN.
      At this point I really just create these tutorials to help people who still use Rails, but if someone asks me what to learn I almost always tell them that there's better options.
      There's either more job opportunities with a JS stack, or there's more open positions as a C# developer. You're also just getting more innovation than you seem to get from Rails these days, as a lot of the features are just extractions from Basecamp it seems.
      Just my opinion though, so take it with a grain of salt.

    • @siyaram2855
      @siyaram2855 2 года назад

      @@Deanin couldn't agree more with you

    • @siyaram2855
      @siyaram2855 2 года назад +2

      I still feel we have nothing as comparable to rails in Js ecosystem.
      Though many futile attempts have been made.

    • @Deanin
      @Deanin  2 года назад +1

      That's so true, and it's unfortunate. I miss a lot of the magic sometimes, and the magic that some JS frameworks create is instead just really annoying lol.

  • @RaedTulefat
    @RaedTulefat 2 года назад +1

    Thank you! What is the co-pilot extension?

    • @Deanin
      @Deanin  2 года назад

      It's just GitHub CoPilot. They launched it to perform suggested code based on a ML algorithm they trained from (what they claim was only) public repositories. It's very nice for casual use, but for anything production grade there's a big warning: it has been shown to grab licensed code from repositories even if it goes against what the license states is legally allowed, and then branding that code with a new license.
      Basically for businesses it's a disaster waiting to cause lawsuits. But for learning how a new tool works, it's a godsend. You can sign up at this link, and then just search the extension on VS Code after you get into the program, which can take months sometimes because it's still a preview build.
      copilot.github.com/

    • @RaedTulefat
      @RaedTulefat 2 года назад +1

      @@Deanin wow very interesting. Thanks for sharing!

  • @siyaram2855
    @siyaram2855 2 года назад +1

    I feel so much at home when I see people using Windows Machine for Dev related stuff

    • @Deanin
      @Deanin  2 года назад +1

      It's really funny how unpopular it is with people who do tutorials, but how common it is in industry lol.
      I'm glad that it seems to be helpful for people to see it done in an environment that you can also play games in 😂

    • @siyaram2855
      @siyaram2855 2 года назад +1

      @@Deanin With WSL, Windows machine is a development beast.
      I was on mac for 3 months, I felt so much restrictive when it comes to proper softwares(free) or even productive workflow.
      I switched back to windows now. It gives you so much more option to customize. Setting it up msy tske time but once you do it, it works like a charm.

  • @minmaunghein7236
    @minmaunghein7236 Год назад +1

    Rails API, how to receive photo from react native

  • @abdu5822
    @abdu5822 Год назад

    Hey Deanin, please create full site clone with React and rails api with jwt authentication, email sending and background jobs. Thanks buddy.

  • @siyaram2855
    @siyaram2855 Год назад +2

    Hello, Deanin. How are things going for you?
    Have you experimented with Rails and a CMS?
    I haven't heard much about CMS in the Rails community. CMS for small-intermediate apps is common in the JS Ecosystem, such as JAMStack. Some people use CMS solely as a backend.
    I was considering creating something with Rails but with CMS integration so that non-tech team members could also use it.
    Strapi is what we use. Is it possible to connect it to Rails? I was wondering how it would turn out.
    Rails' monolithic approach appeals to me. But I'm not sure if that'll work. It could be a rails API and a Strapi API that is consumed in a NextJS frontend. Ahhh... I'm not sure, please let me know.

    • @Deanin
      @Deanin  Год назад

      Haven't personally tried a CMS in Rails. If I ever need a CMS, 9 times out of 10 I just spin up WordPress so that I don't have to reinvent the wheel lol.

    • @siyaram2855
      @siyaram2855 Год назад +1

      Thanks man.
      Rails look so wise to me.
      I am learning it after hiatus from JS frameworks.
      Why don't you build a course on it?

    • @Deanin
      @Deanin  Год назад

      I actually just started my first course! It's $10 and still a work in progress, but it covers creating a Linktree Clone. I made the first two hours of lessons free which covers creating a basic version, with the premium lessons covering stuff like analytics and that mobile phone preview panel that Linktree has lol. I tried to make the paid version as a way to polish the app, so that people don't feel like they're missing out too much by only following the free lessons.
      You can checkout the free version at learn.deanin.com 🙂

    • @siyaram2855
      @siyaram2855 Год назад +1

      @@Deanin That's a great news.
      Mix and Go channel has also released a course this year, but I feel it is unaffordable for a lot of people.
      Will check it out

    • @siyaram2855
      @siyaram2855 Год назад +1

      I guess you should do more n more courses on cloning.
      Something that code4startup use to do few years back.
      You can market it well.

  • @Msmykolas17
    @Msmykolas17 2 года назад +3

    Crud please with react and rails

    • @Deanin
      @Deanin  2 года назад +4

      Will do!

  • @pedropaulino6289
    @pedropaulino6289 2 года назад +1

    Instead of using create-react-app , have you tried using Next.JS ?

    • @Deanin
      @Deanin  2 года назад +1

      I've been wanting to look into it, but from what I'm seeing it seems like it'd be really useful. I'm hoping to branch out towards more JS stuff in the near future to grow the channel, so if you see a NextJS tutorial just know that you're the catalyst that caused it haha.

    • @pedropaulino6289
      @pedropaulino6289 2 года назад +1

      @@Deanin lol ! I asked because I am studying to use Next with Rails for a project, because, integrates better with my UX tooling.

  • @katejohnson2648
    @katejohnson2648 2 года назад +1

    what extension does all that autocomplete?

    • @Deanin
      @Deanin  2 года назад

      GitHub CoPilot does the more advanced autocomplete,, tab nine does the smaller suggestions (I'm using the free version)
      They can get in each other's way sometimes, but overall they can be very helpful when writing code. 🙂

    • @katejohnson2648
      @katejohnson2648 2 года назад +1

      @@Deanin thank you!

  • @nafcho1
    @nafcho1 Год назад +1

    Step Bro xd

  • @pablo6263a
    @pablo6263a 2 года назад +2

    can you share this repo?

    • @Deanin
      @Deanin  2 года назад +1

      Oops! Good catch, looks like I forgot to push up the code. When I get back on my computer I'll push it up and reply to this again. Give me an hour or two. Sorry about that!

    • @Deanin
      @Deanin  2 года назад +1

      Sorry about the delay. Should be up now at github.com/Deanout/bookstore-react-video

  • @siyaram2855
    @siyaram2855 2 года назад +1

    Do a CRUD Tutorial with NEXT.js, GraphQL and Rail 7

    • @Deanin
      @Deanin  2 года назад +1

      Added it to the list! 🙂

    • @siyaram2855
      @siyaram2855 2 года назад

      @@Deanin You are awesome.

  • @ethanfreeman9074
    @ethanfreeman9074 2 месяца назад

    this was way too confusing for how simple it is