Skip to content

sandundil2002/Springboot_CRUD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Typing SVG

project-image

This is a Spring Boot project that demonstrates basic CRUD (Create, Read, Update, Delete) operations with a RESTful API. The project is built using Spring Boot, Spring Data JPA, and a MySQL database (or any other database as per your configuration).

Features

  • Create: Add new records to the database.
  • Read: Fetch single or multiple records.
  • Update: Modify existing records.
  • Delete: Remove records from the database.
  • Cross-Origin Resource Sharing (CORS) enabled for frontend communication.

Tech Stack

Java 17: The programming language used for the backend.

Spring Boot: For creating the RESTful API.

Spring Data JPA: For interacting with the database.

MySQL: The database used for storing data (configurable).

Maven: For managing project dependencies.

Installation

Clone the repository:

https://github.com/sandundil2002/Springboot_CRUD.git
cd Springboot_CRUD

Configure the Database:

spring.datasource.url=jdbc:mysql://localhost:3306/your_database_name
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update

Build & Run the project:

mvn clean install
mvn spring-boot:run

The application will start on http://localhost:8080.

API Reference

Get all blogs

GET "/blog/getAllBlog"

Get a blog

GET "/blog/getBlog?id=1"
Parameter Type Description
id int Required. Id of blog to fetch

Add new blog

POST "/blog/saveBlog"

{
    "title": "Main",
    "content": "Test"
}

Update a blog

PUT "/blog/updateBlog"

{
    "title": "Main",
    "content": "Updated"
}

Delete a blog

DELETE "/blog/deleteBlog?id=1"
Parameter Type Description
id int Required. Id of blog to delete

Contributing

Contributions are always welcome!

Please submit a pull request or open an issue to discuss your ideas.

About

Simple crud operations(Create, Read, Update, Delete) using springboot

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published