SpringBoot Boilerplate with JWT Refresh Token
- Docker and docker-compose.
- Java 11 or higher.
- Clone this repository to your machine and open the terminal already in the project directory.
- Use the command
docker-compose up -d
, to start the MySQL. - Use the command
./mvnw clean package
to generate the .jar. - Use the command
./mvnw spring-boot:run
to start the server.
Everything must be working properly.
By default, an admin user will be created when the users table is empty with this data:
{
"email": "[email protected]",
"password": "admin123",
"username": "Admin"
}
To change this default information you can add the values in your properties file(application.properties, application.yml), for example:
app:
init:
user:
email: [email protected]
password: somepass
username: testname
For better security, it is also recommended that you change the properties for JWT creation.
app:
jwt:
secret: YOUR_SECRET_KEY
expirationMs: 3600000 # 1 hour
refreshExpirationMs: 2592000000 # 30 days