Welcome to Hogwarts Artifacts Online, a sample back-end application designed to demonstrate typical use cases and best practices in Spring Boot development. I wrote this sample application line-by-line from scratch in my YouTube course titled "Learn Spring Boot 3 with Bingyang" .
Throughout the course, Hogwarts Artifacts Online serves as a running example and is developed progressively. That is, each episode introduces new Spring Boot features that add functionality or improvements to this project. This approach helps you see how different concepts fit together in a practical context.
In addition to exploring the features of Spring Boot, the course delves into essential software engineering practices. We will start by framing user stories, then move on to crafting REST APIs and applying object-oriented design principles. Embracing test-driven development, we will meticulously build and refine each feature. The culmination of this journey is setting up a comprehensive CI/CD pipeline, ensuring smooth deployment of the application.
Suitable for Muggles and Wizards Alike
Whether you're new to Spring Boot or an experienced developer looking to add some magic to your skillset, Hogwarts Artifacts Online is the perfect place to start. As you follow along with the videos, I encourage you to actively code alongside me. Engaging in hands-on practice is an excellent method for mastering programming skills. So grab your wand 🪄 (or keyboard ⌨️) and prepare to embark on a journey into "Learn Spring Boot 3 with Bingyang" !
Through my YouTube course, you will gain practical experience in:
- Dependency Injection and the use of Spring Framework's core container.
- Building the web layer with Spring MVC (Model-View-Controller).
- Data persistence in relational databases using Spring Data JPA (Jakarta Persistence API).
- User authentication and authorization with Spring Security and JWT (JSON Web Tokens).
- Deploying a Spring Boot application to a cloud platform with Spring Cloud Azure.
- Monitoring a running Spring Boot application in the production with Spring Boot Actuator.
- Making requests to OpenAI API with RestClient.
- And more.
Additionally, my course emphasizes good software engineering practices, such as:
- Defining software requirements with User Stories.
- Version control and project planning using Git and GitHub.
- The API-First Approach in designing effective REST APIs.
- Test-Driven Development (TDD): writing tests first, then coding to pass the tests, and refactoring.
- Object-Oriented Design with UML.
- CI/CD (Continuous Integration and Continuous Delivery) with GitHub Actions.
🔗 The mind map of the Hogwarts Artifacts Online user stories
🔗 Hogwarts Artifacts Online API Documentation
-
Clone the repository:
git clone https://github.com/Washingtonwei/hogwarts-artifacts-online.git
-
Navigate to the project directory:
cd hogwarts-artifacts-online
-
Run the application:
Since Hogwarts Artifacts Online is a Spring Boot application built using Maven, you can run it from Maven directly using the Spring Boot Maven plugin:
./mvnw spring-boot:run
Or on Windows:
.\mvnw.cmd spring-boot:run
There is a Dockerfile
in this project. You can build a container image (if you have a docker daemon):
docker build .
In its default configuration, Hogwarts Artifacts Online uses an in-memory database (H2) which
gets populated at startup with data. The H2 console is available at http://localhost/h2-console,
and it is possible to inspect the content of the database using the jdbc:h2:mem:hogwarts
URL.
I have defined a class edu.tcu.cs.hogwartsartifactsonline.system.DBDataInitializer
to populate the H2 database at startup.
The issue tracker is the preferred channel for bug reports, feature requests, and submitting pull requests.
The Hogwarts Artifacts Online application is released under version 2.0 of the Apache License.
- Inspired by the Spring PetClinic Sample Application.
- Inspired by J.K. Rowling's Harry Potter series.
If you're looking to enhance your understanding of this Spring Boot tutorial, I highly recommend watching the accompanying YouTube video playlist. It provides a comprehensive walk-through of the concepts and code discussed here, complete with visual demonstrations and step-by-step explanations. Whether you're a visual learner or just prefer a more interactive approach, those videos are a valuable resource to solidify your grasp of Spring Boot.
Check them out now below to dive deeper into the world of Spring Boot development!
- Introduction to Spring Boot 3 Tutorial
- What is Spring?
- Inversion of Control and Dependency Injection
- What is Spring Boot?
- Spring Boot Quick Demo
- Spring Boot Project Structure
- Spring Boot Quick Demo Implementation
- pom.xml Demystified
- spring-boot-starter-parent
- Introduction to Hogwarts Artifacts Online
- Requirements of the Project
- Creating a Spring Boot Project and Pushing it to GitHub
- Project Planning Using GitHub Issues
- API-First Approach
- Creating a Feature Branch for Issue 1 Artifact CRUD
- Object-Oriented Design Using Class Diagram
- Object-Oriented Design Using Sequence Diagram
- Creating Controller, Service, and Repository for Artifacts
- Introduction to Test Driven Development (TDD)
- Implementing ArtifactService Using TDD
- Implementing ArtifactController Using TDD
- Populating the H2 Database with Test Data
- API Integration Testing, Postman, JSON Infinite Recursion, and Data Transfer Object (DTO)
- Implementing Find All Artifacts (User Story in GitHub Issue 1)
- Implementing Add an Artifact (User Story in GitHub Issue 1)
- Implementing Update an Artifact (User Story in GitHub Issue 1)
- Implementing Delete an Artifact (User Story in GitHub Issue 1)
- Pushing a Feature Branch to GitHub and Creating a Pull Request
- Homework (Wizard CRUD APIs, Issue 2)
- Wizard CRUD APIs (Issue 2) Homework Solution
- Code Refactoring
- Implementing Artifact Assignment (Issue 3)
- Implementing User CRUD APIs
- Introduction to Spring Security
- Implementing HTTP Basic Authentication in Spring Boot
- Introduction to JWT
- Generating JWTs in Spring Boot
- Handling Spring Security Exceptions Using @ControllerAdvice
- Testing with Spring Security
- Enabling CORS in Spring Boot
- Committing and Pushing to a GitHub Repo
- Introduction to Spring Boot Packaging and Deployment
- Packaging a Spring Boot Application into an Executable JAR
- Containerizing a Spring Boot Application
- Introduction to CI and CD with GitHub Actions
- Spring Boot Continuous Integration with GitHub Actions
- Deploying Spring Boot Applications to Azure with GitHub Actions
- Setting Up Staging Environments in Azure App Service
- Connecting Spring Boot to a MySQL Database with Azure Key Vault
- Spring Boot Actuator
- Observing a Spring Boot Application with Actuator, Prometheus, Grafana, and Zipkin
- Upgrading a Spring Boot Application