This project is a server-side implementation for a blogging platform. It provides a simple API to perform CRUD (Create, Read, Update, Delete) operations on blog posts using a unique post_id
. The platform is designed to manage posts with categories and tags, facilitating efficient content organization and retrieval.
- Create a Post: Create a blog post with a title, content, and a specific category. Optionally, tags can be appended to enhance searchability.
- Delete a Post: Delete an existing post using its unique ID.
- Retrieve All Posts: Fetch all blog posts stored in the database.
- Retrieve a Specific Post: Fetch details of a single post using its unique ID.
- Search Posts: Search for posts containing a specific term in their title, content, or tags.
- Update an Existing Post: Modify the title, content, category, or tags of an existing post.
- Java 21: The primary programming language used for development.
- Spring Boot 3.4.0: A powerful framework for backend development, offering seamless integration and scalability.
- OpenAPI Generator 7.7.0: Used to generate REST API implementations based on an OpenAPI
.yaml
specification file. - PostgreSQL 14.1: A robust relational database system for storing and managing blog posts.
- Docker Container: Facilitates containerized deployment, providing scalability, portability, and consistency across different environments.
- Gradle: A versatile build automation tool to manage dependencies and build processes.
Ensure you have the following installed:
- Java JDK 21
- Docker
- Docker Compose
- Clone the repository:
git clone <repository_url> cd blogserver
- Build the project:
./gradlew bootJar
- Use Docker Compose to build and start the containers:
docker-compose up --build
- Access the API at
http://localhost:8080
.
API documentation is generated during the build process and is available in the build/generated/docs/index.html
. You can open the HTML documentation file in your browser to explore the API endpoints interactively.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes with clear and concise messages.
- Open a pull request to the
main
branch.
This project is licensed under the MIT License.
Sample solution for the Blogging Platform API challenge from roadmap.sh.