A step by step guide to build an entire web service for a squares application using Java Spring Boot, Spring Data, and a MySQL database. This repo will serve as the "final" product for this application, along with lessons to break down how we got there. The goal is to start an application from scratch, and use this as a guide to get to the same product.
- This guide assumes that IntelliJ Idea is installed, and that you are able to create and run a Java application using the tool. A helpful tutorial can be found here.
- It would be beneficial to get familiarized with Git so you can follow along and commit as you go. A helpful tutorial can be found here.
Tip: Commit a lot. Any time you are at a point where you have made a change that accomplished something, commit that change. Then you will always have it as a reference point to revert back to if something goes wrong.
Click on each lesson header below to get more information.
Build a squares application with a command line interface to manage the grid.
Add services and controllers to make squares more robust.
Save data into a database.
Wrap the application in a Spring Boot web service, replacing our old Command Line Interface. After this, we should be able to make HTTP requests to control our grids and persons in the same way as our previous CLI.
Add Spring Data, and simplify our code for manipulating our data. We will have code that is very agnostic to the actual database schemas, and avoid the need to write any complicated queries to do simple things that the app needs.
Create reusable abstract classes for all of our boilerplate CRUD (Create, Retrieve, Update, Delete) operations so we can avoid duplicating code for this common functionality across all of our entities.
Add a simple html page at the root of our app to showcase.
After following this guide, you should have a basic understanding of creating a web service in Java Spring Boot, connecting to a database. Pieces of this will be helpful to reuse in plenty of scenarios. The goal is that you can now take this knowledge, and start creating your own apps, using your previous work as a guide, and never stop learning!