A clone of Kinopoisk. Made using Spring Boot, Spring Data Rest and Spring Security.
For running this application you need to create properties file in src/main/resources/application.yaml
spring:
datasource:
url: jdbc:database:https://url
driver-class-name: com.mysql.cj.jdbc.Driver
username: user
password: password # This password used only as example, always use password generators!
jpa:
hibernate:
ddl-auto: update
show-sql: on # For logging SQL queries
database: mysql
data:
rest: # parameters of Spring Data REST
max-page-size: 100
default-page-size: 10
return-body-on-update: off
jwt: # Parameters of JWT generator
secret: some-secret-key
expiration: 604800
header: Authorization
In this project MySQL was used. For using your own, change database connector dependency in pom.xml and change database properties in application.yaml.
Swagger url: https://localhost:8080/swagger-ui/#/
- Generate secret key: https://www.grc.com/passwords.htm
- Hashing password: https://bcrypt-generator.com/
- Spring Security Reference documentation
- Spring Data REST Reference documentation
- Spring Security Basic Authentication guide
- Spring Boot Security Authentication with JPA, Hibernate and MySQL
- Base principles of using Spring Security video course by Eugene Suleimanov (ru)
- Working with Relationships in Spring Data REST by baeldung
- POSTing a @OneToMany sub-resource association in Spring Data REST