implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
implementation 'org.mariadb.jdbc:mariadb-java-client:2.7.4'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
#DATABASE
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.datasource.url=jdbc:mariadb://localhost:3306/MusicCharts
<- 3306번 포트의 MusicCharts 데이터베이스 연동
spring.datasource.username=root <-사용자명
spring.datasource.password=★★★★★ <- DB 비밀번호
#JPA
spring.jpa.hibernate.ddl-auto=update
spring.jpa.open-in-view=false
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.show-sql=true
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect'
템플릿 파일은 리소스 폴더 내부에 Templates 패키지 안에 .html 파일로 생성하면 된다. 다른 css나 js는 static 폴더에서 생성하며, 따로 html과 연결해주어야 한다.
<link rel="stylesheet" type="text/css" th:href="@{/css/LR_styles.css}">
<script src="/JS/LR.js"></script>
implementation 'org.springframework.boot:spring-boot-starter-websocket'
<script src="https://cdnjs.cloudflare.com/ajax/libs/sockjs-client/1.5.1/sockjs.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/stomp.js/2.3.3/stomp.min.js"></script>
이 코드는 웹 소켓(WebSocket)을 사용하는 라이브러리인 SockJS와 STOMP를 로드하는데 사용된다. 웹 소켓은 실시간 양방향 통신을 지원하는 프로토콜이며, SockJS와 STOMP는 웹 소켓을 브라우저에서 더 쉽게 사용할 수 있도록 도와주는 라이브러리이다.
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6'