Skip to content

This is a REST API with aim to learning about new features of Spring security with JWT from Spring version 6.

Notifications You must be signed in to change notification settings

LauroSilveira/alura-flix-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alura-flix-api

This is an application with aim to learning about new features of Spring security from Spring version 6. The application is available at: https://alura-flix-api-production.up.railway.app

About this project

About

This is an application with aim to learning about new features of Spring security from Spring version 6. It is possible to access swagger documentation through url: https://alura-flix-api-production.up.railway.app

The username for test is: guest@aluraflix.com and the password is: 123456, please notice this user has ROLE_USER.

alura-flix-api-swagger.png

Technologies

  • Java 17
  • Spring boot 3
  • Spring 6
  • MongoDB Atlas
  • Lombok
  • Spring Security
  • JWT Token library
  • Docker
  • Junit, Mockito
  • Jacoco Report

Generate swagger with openApi

In order to generate swagger openApi without run the application, you can execute

mvn verify

This will generate the swaager on directory /src/main/resources/swagger

How to Run

Run with docker-compose

Before run with docker-compose - Necessary set up environments

There's two environments variables tha should be setup:

- JWT_SECRET=${JWT_SECRET}
- DATABASE_PRO=${DATABASE_PRO}

After that it is possible to run just executing docker-compose.yml this will download the latest version

docker-compose up

Run with mvn spring-boot

mvn spring-boot:run

Login

In the authentication-controller use the credentials

username: guest@aluraflix.com / password: 123456 to log in.

login.png

After that copy the Token JWT

token-jwt.png

And paste it in the Authorize button

authorize-token.png

That's it, you are already logged and can try out all endpoints 😉

Contributors

@LauroSilveira

Fell free to fork and contribute 😉