An open API service indexing awesome lists of open source software.

https://github.com/5obhan/blog-management-restful-api

A Blog Management RESTful API using Java Spring Boot that allows users to create, retrieve, and manage blogs.
https://github.com/5obhan/blog-management-restful-api

apache-maven api blog blog-api java java-spring-boot java-spring-mvc java-springboot maven mvc-architecture mvc-framework rest-api restful restful-api spring-boot spring-mvc

Last synced: about 2 months ago
JSON representation

A Blog Management RESTful API using Java Spring Boot that allows users to create, retrieve, and manage blogs.

Awesome Lists containing this project

README

        

# Blog Management Restful API

This is a RESTful API for managing blogs, built using Java.

## Features

- Create, Read, Update, and Delete blog posts.
- Search blogs by ID.
- Shows blogs with Pagination.

## Getting Started

### Prerequisites

- Java 21 _(Recomended)_ or later
- Maven 3.9.9 or later
- A database (e.g., MySQL, PostgreSQL)

### Installation

1. Clone the repository:

```sh
git clone https://github.com/5OBHAN/Blog-Management-Restful-API.git && cd Blog-Management-Restful-API
```

2. Configure the database connection in _`application.properties`_:

> **Path:** src/main/resources/application.properties

```properties
spring.datasource.url=jdbc:mysql://:/{YOUR_DB_NAME}
spring.datasource.username={YOUR_DB_USERNAME}
spring.datasource.password={YOUR_DB_PASSWORD}
```

3. Build and run the application:
```sh
mvn clean install
mvn spring-boot:run
```

## API Endpoints

### Blog Posts
- `POST /api/v1/blogs` - _Create a new blog post_
- `GET /api/v1/blogs/{id}` - _Get a single blog post by ID_
- `GET /api/v1/blogs` - _Get all blog posts_
- `PUT /api/v1/blogs/{id}` - _Update a blog post by ID_
- `DELETE /api/v1/blogs/{id}` - _Delete a blog post by ID_

## License
This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.