A Spring Boot blog application with JWT authentication and OAuth2 social login.
- JWT-based authentication with refresh tokens
- Google OAuth2 social login
- Blog article CRUD operations
- Thymeleaf frontend
- H2 in-memory database for development
- Spring Boot 3.x
- Spring Security
- Spring Data JPA
- Kotlin
- Thymeleaf
- H2 Database
- JWT (jjwt)
- Clone the repository
git clone https://github.com/yourusername/simpleblog.git- Create
src/main/resources/application.ymlwith your configuration:
spring:
datasource:
url: jdbc:h2:mem:testdb
username: sa
h2:
console:
enabled: true
jpa:
hibernate:
ddl-auto: create-drop
show-sql: true
security:
oauth2:
client:
registration:
google:
client-id: YOUR_GOOGLE_CLIENT_ID
client-secret: YOUR_GOOGLE_CLIENT_SECRET
scope:
- email
- profile
jwt:
issuer: your-email@example.com
secret: your-secret-key-minimum-256-bits- Run the application
./gradlew bootRunPOST /login- User loginGET /articles- Get all articlesPOST /api/articles- Create articlePUT /api/articles/{id}- Update articleDELETE /api/articles/{id}- Delete articlePOST /api/token- Refresh JWT token
./gradlew testMIT

