This project is developed using Spring Boot and MongoDB. It implements a Post object that allows users to create new posts and add comments.
This project is built using Spring Boot and MongoDB and aims to provide a platform where users can create posts and add comments. The main entity in the project is the Post object, which represents a post made by a user. Each post can have multiple comments associated with it.
The project implements all the basic CRUD (Create, Read, Update, Delete) operations for managing users, posts, and comments. Users can register, create new posts, add comments to existing posts, and perform other essential actions.
- JDK 15
- Spring Boot
- Maven
- Postman
- MongoDB Community Server
- MongoDB Compass
The application exposes the following endpoints:
Endpoint | Description |
---|---|
/users |
Get all users |
/users/{id} |
Get a specific user by ID |
/users/ |
Create a new user |
/users/{id} |
Delete a user by ID |
/users/{id} |
Update a user by ID |
/users/{id}/posts |
Get all posts by a specific user |
/posts |
Get all posts |
/posts/{id} |
Get a specific post by ID |
/posts/titlesearch |
Search posts by title |
/posts/fullsearch |
Search posts by full text |
/posts |
Create a new post |
/posts/{id} |
Delete a post by ID |
/posts/{id} |
Update a post by ID |
To get started with the project, follow these steps:
- Clone the repository.
- Install JDK 15 and set up the environment.
- Install and configure MongoDB Community Server and MongoDB Compass.
- Build the project using Maven.
- Run the application using Spring Boot.
- Use Postman or any API testing tool to interact with the exposed endpoints.
Contributions are welcome! If you'd like to contribute to this project, please follow these guidelines:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes and push them to your branch.
- Submit a pull request, explaining your changes in detail.
This project is licensed under the MIT License.