Skip to content

Repository files navigation

SimpleBlog

A Spring Boot blog application with JWT authentication and OAuth2 social login.

Image Image

Features

  • JWT-based authentication with refresh tokens
  • Google OAuth2 social login
  • Blog article CRUD operations
  • Thymeleaf frontend
  • H2 in-memory database for development

Tech Stack

  • Spring Boot 3.x
  • Spring Security
  • Spring Data JPA
  • Kotlin
  • Thymeleaf
  • H2 Database
  • JWT (jjwt)

Setup

  1. Clone the repository
git clone https://github.com/yourusername/simpleblog.git
  1. Create src/main/resources/application.yml with 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
  1. Run the application
./gradlew bootRun

API Endpoints

  • POST /login - User login
  • GET /articles - Get all articles
  • POST /api/articles - Create article
  • PUT /api/articles/{id} - Update article
  • DELETE /api/articles/{id} - Delete article
  • POST /api/token - Refresh JWT token

Testing

./gradlew test

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages