π Spring Blog API
Welcome to Spring Blog API! This is a modern, secure, and scalable RESTful backend service for managing blog posts and user authentication, built with Spring Boot. The project is currently under active development and new features are coming soon.
π± Newcomers Welcome! We encourage developers of all experience levels to contribute. Whether you're new to open source or a seasoned pro, your ideas and code are valued here. Check out our CONTRIBUTING.md for easy ways to get started!
π οΈ Technologies Used
- Java 24
- Spring Boot 3.5
- Spring Security
- Spring Data JPA
- Hibernate ORM
- PostgreSQL
- JWT (JSON Web Token)
- Lombok
- Spring Mail
- Gradle
- Docker & Docker Compose
- JUnit 5
- PgAdmin
- Resilience4j (Rate Limiting & Circuit Breaker)
β‘ Getting Started
Prerequisites
- Java 24
- Docker (optional, for containerization)
- Gradle
π¦ Setup
- Clone the repository:
git clone <repository-url> cd spring-blog-api - Build the project:
./gradlew build - Run Docker:
docker-compose up - Use the API service on:
http://localhost:8082/api/v1/
βοΈ Configuration
Edit src/main/resources/application.yml to configure database and other settings.
π API Documentation
Interactive API documentation is available via Swagger UI.
Most requests require an Authorization: Bearer <JWT> header.
http://localhost:8082/api/v1/swagger-ui/index.html#/
Notes
- Duplicate prevention is enforced by a unique database constraint
(user_id, blog_id)and idempotent service logic. - The current user is resolved from the JWT claim
uid. - Error codes:
401 Unauthorizedβ missing/expired token404 Not Foundβ blog does not exist
π‘οΈ Rate Limiting & Circuit Breaker
This API implements robust rate limiting and circuit breaker patterns to protect against abuse and service failures:
Rate Limiting
- Default API endpoints: 20 requests/60 seconds
- Authentication endpoints: 5 requests/60 seconds
Circuit Breaker
- Automatic database failure detection
- Service degradation during outages
- Graceful error responses (503 Service Unavailable)
Star History
β¨ Contributors
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
π€ Contributing
See CONTRIBUTING.md for guidelines.
π License
This project is licensed under the MIT License.
π§ Status
This project is in active development and not yet complete. Features and documentation may change.