Skip to content

antonio-backnotfront/security-jwt-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” JWT Spring Security template

Spring Boot template with core Spring JWT-based Security setup. The implementation includes access and refresh tokens. Template utilizes modern libraries and approaches to securing application.


Technologies used β€’ Demo β€’ How to use


Technologies used

Spring Boot β€” core backend framework.
Spring Security β€” authentication and authorization system.
Spring Data JPA + Hibernate β€” ORM and data persistence.
MySQL β€” relational database.
Flyway β€” data migration tool.
JJWT β€” jwt encoding and decoding.
Gradle β€” build automation tool.
Docker & Docker Compose β€” containerization and orchestration of Spring Boot app and MySQL instance.


Demo

Image

How to use


  • Have Docker installed on your local machine

  • Clone the repository to your local machine
git clone https://github.com/antonio-backnotfront/security-jwt-template.git

  • Create .env file in the root folder (on the same level as build.gradle) following the structure specified in .env.example file:
security-jwt-template/
β”œβ”€β”€ .env.example  

  • Run docker compose
docker compose up --build

  • Access API endpoints under localhost:8080 and MySQL instance under localhost:3306.

  • Authentication is performed via /api/auth/login and /api/auth/register.

  • Access tokens are required for secured endpoints via the Authorization: Bearer <token> header.

  • To refresh tokens, use the /api/auth/refresh endpoint with your refresh token inside Authorization: Bearer <token> header.

Copyright (c) 2025 Anton Solianyk

About

πŸ” Spring Boot template setup with pre-defined user-related models, JWT-based security and its basic configuration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors