ReactJS inside a Spring Boot Container.

Поделиться
HTML-код
  • Опубликовано: 7 сен 2024
  • This tutorial shows how to setup a Spring Boot Project and within that have a ReactJS frontend running. When developing we want to use the built in react development web server on port 3000 which proxies to the Spring Boot Backend. This makes it possible to use the Spring Boot backend in the react frontend.
    There is another way of achieving the same without ejecting the ReactJS application. The other way is by using Gradle plugins and can be watched here: • Spring Boot with React... . The code is located in bitbucket here:
    bitbucket.org/...

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

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

    this tutorial was what i desperately needed! thanks for the in-depth content :)

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

    Also How To pass URL from gradle application properties to React UI to use same URLs

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

      It is 2 different applications. Configure the frontend with .json files and then pick the right one from the browser url. ie. x = dev environment.

  • @alexandersmirnov4274
    @alexandersmirnov4274 4 года назад +1

    Awesome video!!!

    • @MikesTechCorner
      @MikesTechCorner  4 года назад

      Thank you

    • @alexandersmirnov4274
      @alexandersmirnov4274 4 года назад

      @@MikesTechCorner Thank you. I just have one question would it work with spring boot 2.3 feature buildpack when runned build docker image task?

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

    Thanks for giving detailed solution. I want to do same by using yarn not npm.

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

    Hi @Mike
    For production, can you mention what changes required in build.gradle file for PROD

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

      I would split the applications up for production and use build packt for Spring Boot application and the docker image I have on my website for the frontend. www.codeinvestigator.com

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

    Hi ​ @Mike Møller Nielsen For production, In Code what changes i need to do to start single App with React & Spring Boot

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

      Only pom.xml or build.gradle file. The react files need to end up in static folder

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

      @@MikesTechCorner Also can you mention what changes required in build.gradle file for PROD

  • @dskuhi12345xyz
    @dskuhi12345xyz 3 года назад +1

    Nice video. But, only static part can be rendered from the container isn't it? This video is more about consolidating the source under one bucket with a build + running the static content. We still need a Node Js server if ReactJS application has to function fully as a dynamic webapp right?

    • @MikesTechCorner
      @MikesTechCorner  3 года назад

      No everything can run inside the Tomcat web container that is a part of the Spring Boot Application. That is the beauty of it!

  • @srkreddydendi
    @srkreddydendi 3 года назад +1

    Why do you need still two servers(node and tomcat). this application in not running within the tomcat container.

    • @MikesTechCorner
      @MikesTechCorner  3 года назад

      Node is for development only. Tomcat is used to host the html and js files in the static folder in production

  • @0791679
    @0791679 5 лет назад +2

    Hi Mike. I like ur video, I was looking for something like this.
    Do you know the setup for Maven too ? Our company is using maven :( .

    • @MikesTechCorner
      @MikesTechCorner  5 лет назад +1

      Ill create a video with maven when I have time. (Its in the pipeline) :)

    • @MikesTechCorner
      @MikesTechCorner  5 лет назад +1

      Check out this video. ruclips.net/video/7XxH-G9ckeU/видео.html

  • @samramzez1777
    @samramzez1777 4 года назад +1

    It’s nice video ) but there is video about Jenkins ?

    • @MikesTechCorner
      @MikesTechCorner  4 года назад

      There is a video with multistage build and Jenkins. Thank you for commenting.

  • @wamv420
    @wamv420 4 года назад +1

    Thank you for the solution. It really helped a lot. But I am kind of new to this spring boot and reactjs area. So I wanted to know what if I need a multi page setup rather than a single page setup in my application. Can you suggest me anything handy ?
    Thank you again.

    • @MikesTechCorner
      @MikesTechCorner  4 года назад

      Yes. You can have as many as you like. I have added this to my backlog

    • @wamv420
      @wamv420 4 года назад

      @@MikesTechCorner so you mean for each page I need to set separate react application the same way ??

    • @MikesTechCorner
      @MikesTechCorner  4 года назад

      No you can have multiple pages in your reactJS app