This repository contains a REST API for a blog built using Spring Boot. With endpoints for creating, updating, and retrieving blog posts and users, and organized code and clear documentation, it's a useful resource for developers looking to learn about REST API development with Spring Boot.
This REST API provides the following endpoints:
-
This endpoint is used to authenticate users by allowing them to sign in using their email and password.
POST /api/v1/auth/signin
-
This endpoint is used to register new users by allowing them to sign up with their email and password.
/api/v1/auth/signup
-
This endpoint is used to retrieve a list of all posts.
GET /api/v1/posts
-
This endpoint is used to retrieve a specific post by its ID.
GET /api/api/posts/{postId}
-
This endpoint is used to create new post.
POST /api/v1/posts
-
This endpoint is used to update a specific post by its ID.
PUT /api/v1/posts/{postId}
-
This endpoint is used to delete a specific post by its ID.
DELETE /api/v1/posts/{postId}
-
This endpoint is used to retrieve all comments for a specific post.
GET /api/v1/posts/{postId}/comments
-
This endpoint is used to retrieve a specific comment for a specific post.
GET /api/v1/posts/{postId}/comments/{commentId}
-
This endpoint is used to create a new comment for a specific post.
POST /api/v1/posts/{postId}/comments
-
This endpoint is used to update a specific comment for a specific post.
PUT /api/v1/posts/{postId}/comments/{commentId}
-
This endpoint is used to delete a specific comment for a specific post.
DELETE /api/v1/posts/{postId}/comments/{commentId}
-
To run the projects, you'll need to have Java installed on your machine. You can download Java from the official website.
-
Install an Integrated Development Environment (IDE) such as IntelliJ or Visual Studio Code.
-
To install IntelliJ IDEA, follow the instructions on the official website
-
To install Visual Studio Code, follow the instructions on the official website.
-
To run the application, please follow these steps:
-
Clone the repository using the following command:
git clone https://github.com/aamirxshaikh/spring-boot-blog-rest-api.git
-
Navigate into the project directory using the following command:
cd spring-boot-blog-rest-api
-
You can simply run the project in the IntelliJ IDEA by clicking the "run" icon or you can run the application using the following command:
mvn spring-boot:run
-
After the application is running, you can interact with the API by making HTTP requests to the endpoints listed above using tools like curl or Postman.
Feel free to contribute to this repository by improving the existing codebase or adding new features. Simply fork the repository, make your changes, and create a pull request. I'll be happy to review and merge your changes.
This repository is licensed under the MIT License. See the LICENSE file for details.