From the course: Building Real-Time Web Apps with Spring Boot and WebSockets

Preparing a sample chat app

From the course: Building Real-Time Web Apps with Spring Boot and WebSockets

Start my 1-month free trial

Preparing a sample chat app

- [Instructor] To demonstrate the work involved in creating a Spring-based real-time app, we're gonna develop a simple chat app for our fictitious Landon Hotel. The event services staff at the Landon Hotel wants to give event planners and guests a better way to communicate with each other. For example, event planners want a quick way to request help from the hotel staff during setup or imagine being able to contact the hotel staff person as a guest and having an event-specific chat tool that allows you to communicate with other guests. We're gonna begin setting up for our example chat app's design and development. Our overall development goals involve developing the server-side and the client-side code. We'll begin developing and unit testing our server-side code first, then we'll move on to creating the HTML and JavaScript assets needed for our client-side code. For server-side development, we will be using components that should be familiar to you if you've done any development using the Spring MVC framework. We won't go into too much depth about MVC-related components because if you need it, there is another course you can take that provides everything you need to know about Spring MVC. However, what is most relevant for this course is the need for a component called a message broker. An understanding of message-oriented middleware concepts is definitely useful when configuring and coding up our message broker. The message broker must be configured to listen on a particular endpoint or server address and it manages the registry of topic or destinations. All of the messages flow through the broker and eventually onto whatever controller is configured to handle any ongoing business logic for processing messages. So, let's get started and review our project in the IDE. So, I wanna review some of our packaging and naming conventions that we're gonna use for our app, just so you know ahead of time where everything will be. Notice we have in our main package com.landon.chat. This is where we'll keep any application-level configuration classes. Our next package, our controller package, and as the name suggests, this is where all of our controllers will be kept. Finally, our model package, in this package is where we'll keep all the classes that we need to represent the different types of messages or model behavior. We'll talk more about that later. Finally, we won't write tests for this course, but we will be running them. There is a course on Spring: Test-Driven Development that you can take to learn about how to write these tests, but just so you know, as a convention, we will be keeping all of our test code in the src/test/java tree and we will package them to match the classes that they are testing.

Contents