This is a User CRUD application built with Spring Boot and Java.
- Java 8 or higher
- Maven
- MySQL
- Install MySQL if you haven't already.
- Create a new database for the application.
- Note down the database name, MySQL username, and password.
Update the application.properties
file to include the necessary configuration for connecting to your MySQL database:
spring.application.name=UserCrud
spring.datasource.url=jdbc:mysql://localhost:3306/your_database_name?useSSL=false&serverTimezone=UTC
spring.datasource.username=your_mysql_username
spring.datasource.password=your_mysql_password
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.mvc.pathmatch.matching-strategy: ant_path_matcher
- Clone the repository:
git clone https://github.com/vishav-singla/Spring-project.git
- Navigate into the directory:
cd Spring-project
- Build the project:
mvn clean install
- Run the application:
mvn spring-boot:run
The application will start running at http://localhost:8080
.
Here are some example cURL commands for the API endpoints:
curl -X POST -H "Content-Type: application/json" -d '{
"username": "testUser",
"name":"test user",
"email":"[email protected]",
"password": "testPassword"
}' "http://localhost:8080/api/user/register"
curl -X GET "http://localhost:8080/api/user?username=testUser"