DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Stop Writing Database Migration Scripts: Declarative Schema Sync for Java
  • Testing Java and Spring Applications With Kotlin: Low-Risk to Adoption
  • Going All In On the JVM 25 Virtual Threads
  • Kafka With Spring Boot: Introduction

Trending

  • Spring AI on Local LLMs
  • How an AI Software Factory Works: From Developer Intent to Production
  • GenAI Security Gateway: An End-to-End Architecture
  • One Database, Two Models: Building AI-Friendly Java Applications With MySQL JSON Duality Views

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Coding
  3. Frameworks
  4. Spring Boot: Nice and Easy [Video]

Spring Boot: Nice and Easy [Video]

Want a fun and engaging intro to the whole Spring Boot ecosystem? Check out this live-coding session on a new episode of "Marco Codes."

By 
Marco Behler
·
Apr. 21, 22 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
10.9K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

Ever looked for a comprehensive intro to Spring Boot that is fun and entertaining at the same time? Then have a look at this brand-new episode of the "Marco Codes" YouTube channel: Spring Boot - Nice & Easy.

In this video, we will build a tiny Google Photos-like clone with Spring Boot. Additionally, along the way, you'll learn plenty about Spring's Dependency Injection and MVC frameworks, Validation and File Handling, Spring Data and Databases, and you'll even deploy your application at the end. 

What’s in the Video?

Every new Spring Boot project starts with the question: How do I create my new project (hint: Spring Initializr) and what do I need to watch out for when setting up my project? Hence, we'll start off with that.

While the end goal of the video is to program a tiny Google Photos-like clone, we'll first continue with a quick win, Writing a Hello World @RestController, teaching you the very basics of Spring Boot such as project structure, classes, and beginner concepts.

Next, we'll be off to some real-life REST API Design. We want to store and retrieve photos, so we'll need to model our domain as Java classes. After modeling the domain, it's time to think about what our REST API would look like, what classes we need, and how to structure them and our project. That means we will get familiar with Spring Boot's mapping annotations, including @GetMapping, @PostMapping, or @DeleteMapping, and start sending very simple String messages via HTTP. 

Building stuff on the backend is, however, just one part of the coin. We'll also need a way to test our REST endpoints. A very simple way of doing that is by executing JavaScript inside your browser's developer console. We'll do that first, instead of resorting back to a full-blown HTTP client.

At some point, sending strings only takes you so far. We'll need to change our Spring Boot backend so it can handle JSON messages as well as validate those JSON messages so users cannot send invalid or even dangerous contents to make our server crash. Validation also means displaying error messages and we'll find out how you can handle those with Spring Boot.

With that many learnings under our belt, we'll dig into Spring Boots basics (i.e., dependency injection) in much more detail and talk about the pros and cons of different injection styles.

What would a real-life application be without database access? Let's change our application so that it stops saving photos on a hard disk, but instead saves them to a database. That way, you'll learn about Spring Data (JDBC) and the various ways you can access databases with Spring Boot. 

Last but not least, you'll also want to be able to deploy your application. Building final deployables with Spring Boot is rather simple and you'll learn how to run your Spring Boot application on any production server you like.

If you managed to watch the entire video, you'll be presented with some hints, tips, and resources, that will help you continue your Spring Boot learning journey on your own.  Check it out and let us know what you think! 

Spring Boot

Opinions expressed by DZone contributors are their own.

Related

  • Stop Writing Database Migration Scripts: Declarative Schema Sync for Java
  • Testing Java and Spring Applications With Kotlin: Low-Risk to Adoption
  • Going All In On the JVM 25 Virtual Threads
  • Kafka With Spring Boot: Introduction

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook