Это видео недоступно.
Сожалеем об этом.

Build an ENTIRE Blog from Scratch in JUST 120 MINUTES - Java Spring Boot BEGINNER Tutorial!

Поделиться
HTML-код
  • Опубликовано: 14 авг 2024
  • Looking to create your own web application? Look no further! In this exciting tutorial, we'll take you step-by-step through the process of creating your very own Blog web application using Java Spring Boot for our server and Thymeleaf for the frontend.
    Whether you're a seasoned developer or just getting started, this tutorial is perfect for anyone looking to learn more about web application development. You'll get a hands-on experience building your own app, as well as gaining valuable skills in Java Spring Boot and Thymeleaf.
    👉👉Grab the source (on github): t.ly/6SrAa
    🔗 Grab My Other Available Product(s):
    - Build Your First Web Service API Using Java Spring Boot wazoowebbytes....
    👋🏻Connect with me:
    Twitter: / eyuzwa
    ===---=== Concepts ===---===
    - Spring Data JPA
    - Spring Security
    - Thymeleaf
    - Spring Web
    - H2 Database
    ===---=== Chapters ===---===
    00:00 - introduction
    00:25 - simple blog demo
    05:05 - create project at start.spring.io
    06:46 - opening project in IntelliJ
    08:30 - configuring h2 in application.properties
    00:12:20 - first look at h2-console
    00:13:16 - adding the Post model
    00:15:58 - adding the PostRepository object
    00:17:01 - adding a PostService object
    00:20:31 - creating SeedData
    00:24:17 - checking seed data in h2-console
    00:24:54 - creating the HomeController
    00:27:00 - creating the home template with Thymeleaf
    00:33:20 - first run with home view
    00:34:20 - creating the PostController
    00:37:43 - creating the Post and 404 view templates
    00:42:30 - adding an Account model
    00:45:30 - setting up OneToMany in Account with Post
    00:46:39 - setting up ManyToOne in Post with Account
    00:48:02 - creating an AccountRepository
    00:48:44 - creating an AccountService
    00:49:46 - updating the SeedData
    00:52:38 - checking relationships in h2-console
    00:56:45 - adding a LoginController
    00:57:17 - adding a RegisterController
    00:57:40 - creating login and register templates
    01:01:50 - adding register endpoint to controller
    01:03:10 - creating login and register links
    01:06:21 - checking registration in h2-console
    01:07:01 - adding support for a new Post
    01:07:28 - adding /posts/new GET in PostController
    01:11:58 - adding post_new.html template
    01:14:45 - adding /post/new POST in PostController
    01:16:00 - first test of new post template
    01:18:28 - adding Spring Boot Security
    01:19:52 - updating the pom.xml
    01:21:31 - adding a WebSecurityConfig
    01:25:48 - first pass of whitelisted endpoints
    01:26:57 - allowing /posts/* in whitelist
    01:28:00 - allowing /h2-console/* in whitelist
    01:30:42 - setting up login handling and validation
    01:34:27 - setting up MyUserDetailsService object
    01:39:37 - creating Authority model
    01:40:43 - creating Account-Authority relationship
    01:45:09 - updating SeedData with roles
    01:46:26 - creating AuthorityRepository
    01:47:42 - checking database for Authority
    01:49:00 - debugging login and loadUserByUsername
    01:51:24 - adding thymeleaf security to home.html
    01:54:46 - adding PasswordEncoder to WebSecurityConfig
    01:57:24 - successful login
    01:58:10 - adding Post.updatedAt property
    02:05:58 - adding delete to PostController
    02:08:27 - adding modifiedAt to templates
    #Java
    #SpringBoot
    #Tutorial
    🔗Resources & Links mentioned in this video:
    Spring Initializr: start.spring.io/​
    Visual Studio Code: code.visualstu...

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

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

    Having been learning Spring Boot for a while, I was looking for a project I could work on just to practice what I've learned. This video has been very helpful.

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

      thanks so much, glad I could try to help - and good luck on your practice!

  • @ThatGuyMwangangi
    @ThatGuyMwangangi 10 месяцев назад +2

    Thank you for this. I'm going to use it as a basis for my portfolio project.

    • @wazoowebbytes
      @wazoowebbytes  10 месяцев назад +2

      You're very welcome! Glad it was helpful and good luck with the portfolio!

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

    coming last todo project, this very very helpful to understand a working project with all the functionality, many thanks to you wazoo, as a junior developer I found very hard to understand existing code bases in client projects, thats where this kind of videos help , please continue making these videos levelling up the functionality and extending the projects to be a full stack projects. thank you very much again.

    • @wazoowebbytes
      @wazoowebbytes  2 месяца назад +1

      thank you so much for the feedback, and best of success on your own developer journey!

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

      @@wazoowebbytes thanks man you are an inspiration.

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

    This is helping me so much in preparing for my upcoming hackathon. If all goes well, I will be landing my first dev job in a few weeks! Thank you for the tutorial!!

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

      wow - thank you so much! Praying for your future and landing that first dev job!

  • @ramunasj
    @ramunasj 10 месяцев назад +2

    .headers(HeadersConfigurer::disable), add this to security configuratios after http so xframe disabled and h2 loads

    • @wazoowebbytes
      @wazoowebbytes  10 месяцев назад

      thanks! you might be needing this in a newer version of spring boot? I'll take a look - much appreciated!!

    • @784r3
      @784r3 3 месяца назад

      thank you! You really helped me. I didn't know how to solve this problem.

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

    Amigos gracious amazing. Keep spreading valuable knowledge our spring boot guru🙂

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

    you are amazing, im waiting for next videos in curios.

  • @nikita-shamrai
    @nikita-shamrai Год назад +3

    Small but important fact.
    In newer version of Spring Security you have to add @Configuration annotation in addition to @EnableWebMvc

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

      Thanks for spotting that and sharing! Yeah I'll have to make an updated version of this video for spring boot 3

    • @sachindiary
      @sachindiary 4 месяца назад

      My code is perfectly running but table is not showing as shown in 24:40 . what to do??

  • @EthanZitting-pg7te
    @EthanZitting-pg7te 2 месяца назад

    Thank you for releasing this!!

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

      you're so welcome! Thanks for stopping by!

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

    Thank you so much for this project. I have learnt many things from you. Keep going please

  • @jesper7605
    @jesper7605 Год назад +3

    Great tutorial :) Would be awesome to see more projects at the intermediate level using Spring Boot, preferably with React!

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

      thanks for the feedback, I appreciate it. Yes, I'm working on more intermediate tutorials right now!

    • @119_vaibhavthobbi2
      @119_vaibhavthobbi2 Год назад

      got error at 27.47 as Resource registered by this uri is not recognized (Settings | Languages & Frameworks | Schemas and DTDs) ,what to do next?

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

      @@119_vaibhavthobbi2 interesting - I'll take a look!

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

      @@119_vaibhavthobbi2 do you mean the reference to the thymeleaf namespace in the html node? (xmlns:th="www.thymeleaf.org")? That could just be a weird error from your IDE that you can ignore. Does it prevent the page from working?

    • @119_vaibhavthobbi2
      @119_vaibhavthobbi2 Год назад +1

      @@wazoowebbytes sir I have fixed it , thanks for your reply...

  • @MrAxeres
    @MrAxeres 4 месяца назад

    Thank you for perfect lesson of spring boot!

    • @wazoowebbytes
      @wazoowebbytes  3 месяца назад

      thank you so much, I really appreciate it and am trying to be as clear as I can in each video!

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

    Very helpful tutorial with great explanations, thank you!

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

      thanks so much! Glad it helped you out - appreciate you leaving a comment

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

    this is an amazing tutorial. thank you so much

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

      thank you so much! I'm really happy to hear that it's helped you!

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

    Please make more videos sir... Thank you so much very comprehensible.

  • @sailisurve4603
    @sailisurve4603 2 месяца назад +1

    Hey !! After running server 12:34 it url and username on db console is still default even though i have changed the username to admin in application property file.What i need to check for this as i am facing similar issues from many days

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

      interesting! Are you sure that you've deleted the existing database after changing the username and password in the application properties? Maybe it was created with the other username / password..? Hope that helps and thanks for stopping by!

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

    Amazing!!! Congratulations!

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

      Thank you so much! I really appreciate the kind words!

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

    I see you updated image feature in github project. Can i ask where that video is (sorry for my bad english)

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

      thanks! Your english is perfect here my friend! To tell you the truth, I haven't yet recorded that video. My humble apologies, I should sit down and do it. Thanks for mentioning it, I appreciate it!

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

    it was perfect.

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

    Amazing to pracitce!!

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

    Hi! This is so helpful video, I am learning Spring and what I didn`t understand, I understand in this video. Thank You! I have a question for you: I write code like you, but when I want to edit, I get 403 error. Why it could be happen?

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

      In which part we define role of normal user and admin?

    • @ramunasj
      @ramunasj 10 месяцев назад

      same issue here. Cant find the issue
      @@oulvibakirli

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

    From all youtube only you who have complete tutorial about spring boot with good understandeble english

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

    can you also add some css to this ?

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

    Hello, when I declare HomeController @RestController instead of @Controller, it returns a blank page with only "home" in it. Why is that?

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

      great question! A big difference between them is that @Controller returns a view (aka. "home.html") whereas the @RestController cannot return a view (used for fetching data mostly)

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

      @@wazoowebbytes Thank you! So when I need to return a .html file, i need to use @Controller. There isn't any way for @RestController right? Because I heard somewhere that @Controller is an old tech and we need to use @RestController everytime.

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

      @@enesb4797 if you want to use an .html file, then correct, it's got to be @Controller. The @RestController is more for any data you're exposing through API. Maybe the "old tech" comment is about the actual approach to use a framework like React or Angular somewhere else and just talking to your Spring boot server...?

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

      @@wazoowebbytes Thank you so much!

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

    thanks, helped a lot!

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

      Glad it helped! Hope you had some fun with it!

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

    when I login it doesn't redirectr to home page whereas when debugging no error is showed

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

    Hi Mr Wazoo, first of thank you very much for this wonderful project. my version finally compiled and works. I will like to ask if there a module to add media to posts, such as pictures, audio and videos. I am working on some styling features too.

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

      awesome! So happy to hear you got it up and running! I haven't yet made one, but that's a great idea for a followup video. Also maybe upgrading this project to the newly released spring boot 3 - really appreciate the feedback!

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

    I wish you explained spring security some more

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

      thanks! yeah -- it's a huge topic, but important for sure

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

    Hey Guru, can you teach us a complete ecommerce project with jwt role based authorization. Full of actual ecommerce sites functionality using spring boot and angular

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

      I'll put that on my list - thanks for the suggestion!

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

      @@wazoowebbytes Please make a descriptive project on requested topics. I've been searching for this. Thank you.

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

      @@abhishekkumargupta9106 You bet - sorry RUclips tends to hide some of these comments on me!

  • @cs3k3
    @cs3k3 10 месяцев назад

    I know it's been a while, but still, I have a small problem that I can't really figure out.
    When I'm logged in with user1 I can edit other people's posts too, any idea?

    • @wazoowebbytes
      @wazoowebbytes  9 месяцев назад

      sorry for the delay getting back to you! Yeah I see what's happening. In the PostController "updatePost" method there's no check to see if the principal (aka. current account) is the same one as the one on the Post field. Hope that helps you out!

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

    How can i add comment section to posts

    • @wazoowebbytes
      @wazoowebbytes  4 месяца назад

      hey - should be fairly straight forward. I should make a followup video. But you'd likely start with a Comment model, then a @OneToMany relationship between Post and Comment (in other words, each Post can have many Comments).

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

    Very helpful video. no one has explained spring boot integration with react so well. can you please create a video for Java+springboot+React+One To Many Bidirectional Mapping+Spring Security +swagger

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

      thanks for the feedback and suggestion! I'll see what I can put together

  • @aniketvajpayee8509
    @aniketvajpayee8509 9 месяцев назад

    getting error with edit button ....it always redirect me to page not found ....anyone can help !

    • @wazoowebbytes
      @wazoowebbytes  9 месяцев назад

      THANK YOU! That bug must've been in there for a long time. My humble apologies. If you pull the latest code from the repo, you'll see the change that needed to be made there. Hope that helps you out!

  • @gigacatillustrations
    @gigacatillustrations 8 месяцев назад

    why is the database on the repository mysql and not h2?

  • @Channel-iu6de
    @Channel-iu6de 2 года назад +1

    is there any reason you don't use the spring boot add-on for IntelliJ so as to just create spring applications from within Intelli j?

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

      none at all - it works great! Maybe I'll use it in more videos, I was just trying to show that you can also generate a project outside of an IDE

    • @Channel-iu6de
      @Channel-iu6de 2 года назад +1

      @@wazoowebbytes No worries, great vids, thanks.

  • @kennedy-of8gn
    @kennedy-of8gn Год назад +1

    Any insight as to how you would integrate JMS into this? Or some sort of messaging service between registered users? Amazing tutorial btw - thanks!

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

      thanks! Hmm it's worth some planning for that capability for sure. JMS has come in handy when working with async events such as needing to update something when a webhook is triggered, etc so that's where I would start...

    • @kennedy-of8gn
      @kennedy-of8gn Год назад

      @@wazoowebbytes Sorry to be a bother - which files would I begin this type of configuration in? I've been researching this for the last 2 weeks and have made no progress

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

      @@kennedy-of8gn not a bother at all - I've been there many times my friend. I'll see what I can do for you...

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

      @@kennedy-of8gn SORRY! RUclips really makes it difficult notifying me of comments! This is a basic starting point - spring.io/guides/gs/messaging-jms/ - but you may have found this already but maybe the demo git repo will help you with a starting point! good luck!

  • @sachindiary
    @sachindiary 4 месяца назад

    My code is perfectly running but table is not showing as shown in 24:40 . what to do??

    • @wazoowebbytes
      @wazoowebbytes  4 месяца назад

      I don't know that's pretty vague. Are you getting any kind of error? does your page work at all but just not seeing a table?

    • @sachindiary
      @sachindiary 4 месяца назад

      @@wazoowebbytes it is showing "There was an unexpected error (type=Not Found, status=404)" in white label error page and table is also not getting created

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

    Please can you do a Tutorial About Spring Security including DB authentication?

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

      I'll put it on my list! Thanks for stopping by and thanks for the suggestion!

  • @codewriter3000
    @codewriter3000 4 месяца назад

    Real back-end engineers don't need styling

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

    I do the same in Eclipse IDE
    but the property 'server.port=3000' is always ignored and set to default (8080)
    project: .jar, embedded tomcar server
    what can I do?

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

      Thanks for the feedback. It sounds to me like Eclipse has a default setting in the debug configuration for your server to force that port to be 8080. I don't use Eclipse though, but do you see a configuration settings type of dialog?

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

      @@wazoowebbytes kind of.
      I just opened the config. settings, created one configuration, then removed it. result:
      Tomcat started on port(s): 3000 (http) with context path ''
      😁😜

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

      @@goolkinsnose3936 haha nice one!

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

    awesome

  • @shubhsinghal9502
    @shubhsinghal9502 2 месяца назад +1

    does anyone else needed to install docker to run this project

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

      hmm you're correct! I see what's happened. I made a few follow up videos to this project that make use of Docker. I'll see what I can do to the code repo - maybe create different branches depending on the video you're looking at?? I'll give it some thought. Thanks!!

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

      @@wazoowebbytes i figured it out and made the changes and I really appreciate your efforts

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

      awesome! Happy to hear that you got it up and running!

  • @nikita-shamrai
    @nikita-shamrai Год назад

    Is it ok that client recieves a domain entity in a responce, but not dto's from that entities?

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

      yeah...I've personally never been sold on DTO's - they've always felt like extra objects I didn't need

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

      and I'm working on some content now which actually makes some use of small DTO's to hopefully help explain things. Let's see how that goes...

    • @nikita-shamrai
      @nikita-shamrai Год назад

      @@wazoowebbytes I've subscribed)

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

      @@nikita-shamrai thanks - much appreciated

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

    Hello,
    I have a problem with your code, in WebSecurityConfig, when inserting .antMatchers(WHITELIST).permitAll(), when I try to run the code I get an error:
    java: cannot find symbol
    symbol: method antMatchers(java.lang.String[])
    location: class org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer.ExpressionInterceptUrlRegistry
    What should I do? Till then I did everything as you did.

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

      Hi, thanks for the question - yeah in newer versions of Spring Security, the team has removed AntMatchers and want everyone to use RequestMatchers instead. I should get around to updating the github repository to reflect that, to help newer visitors out! Try using ".requestMatchers(WHITELIST).permitAll()" instead and see if that helps you move forward - meanwhile I'll look at the repo!

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

      Yes, it works with RequestMatchers. It s not showing errors, but it wont let me past that security login page.@@wazoowebbytes