https://github.com/sandundil2002/springboot_crud
Simple crud operations(Create, Read, Update, Delete) using springboot
https://github.com/sandundil2002/springboot_crud
ajax css html java javascript jpa-hibernate jquery mysql-database spring-boot
Last synced: 2 months ago
JSON representation
Simple crud operations(Create, Read, Update, Delete) using springboot
- Host: GitHub
- URL: https://github.com/sandundil2002/springboot_crud
- Owner: sandundil2002
- Created: 2024-08-10T12:45:35.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-08-13T18:11:19.000Z (11 months ago)
- Last Synced: 2025-03-30T21:33:18.395Z (3 months ago)
- Topics: ajax, css, html, java, javascript, jpa-hibernate, jquery, mysql-database, spring-boot
- Language: JavaScript
- Homepage:
- Size: 748 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
##
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:
```bash
https://github.com/sandundil2002/Springboot_CRUD.git
cd Springboot_CRUD
```Configure the Database:
```bash
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:
```bash
mvn clean install
mvn spring-boot:run
```The application will start on http://localhost:8080.
## API Reference#### Get all blogs
```http
GET "/blog/getAllBlog"
```#### Get a blog
```http
GET "/blog/getBlog?id=1"
```| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `int` | **Required**. Id of blog to fetch |#### Add new blog
```http
POST "/blog/saveBlog"{
"title": "Main",
"content": "Test"
}
```#### Update a blog
```http
PUT "/blog/updateBlog"{
"title": "Main",
"content": "Updated"
}
```#### Delete a blog
```http
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.