This is a simple CRUD (Create, Read, Update, Delete) application built using Spring Boot. It is a great beginner project to understand how to use Spring Boot, Thymeleaf, and MySQL for basic database operations.
- Spring Boot for the backend
- Thymeleaf for templating engine
- MySQL for the database
- Java 17 or higher
- MySQL installed and running
- Maven or Gradle for dependency management
Go to Spring Initializr, and generate a Spring Boot project with the following options:
- Project: Maven Project
- Language: Java
- Spring Boot version: (Select the latest stable version)
- Project Metadata:
- Group:
com.name
- Artifact:
name
- Name:
name
- Description: Simple CRUD App
- Package name:
com.packagename
- Packaging: Jar
- Java: 17 or higher
- Group:
- Dependencies:
- Spring Web
- Spring Data JPA
- MySQL Driver
- Thymeleaf
You can either clone the repository or download it as a ZIP file.
git clone https://github.com/ruturajjadhav07/Simple-CRUD-Spring-Application.git
Create a database in MySQL called springDB.
CREATE DATABASE springDB;
Before running the application, ensure that you have MySQL installed and create the database. Here's the SQL query to create the required clients
table:
CREATE TABLE clients (
id INT AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(255),
last_name VARCHAR(255),
email VARCHAR(255) UNIQUE NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
mvn clean install
mvn spring-boot:run
This CRUD app is a great project for beginners to get hands-on experience with Spring Boot, JPA, and MySQL. It will help you understand the basic flow of a Spring Boot application, how to use Thymeleaf for rendering HTML, and how to interact with a MySQL database.
Feel free to extend the project, add more features, or improve the UI!
Happy coding!