intro

여름빛새·2023년 7월 11일

dev-diary

목록 보기
1/8

1. 들어가기 앞서

본 개발 일지는 SquadMania의 백엔드 파트의 개발 과정을 담고 있습니다.

SquadMania는 Swift와 node.js 기반으로 제작된 iOS 앱으로, 넥슨이 퍼블리싱한 피파 온라인의 공식 API를 기반으로 해당 게임의 공략 정보를 제공 하는 서비스로서, 출시 이후 긍정적인 평가를 받으며 무난한 서비스를 이어가고 있습니다.

운영 측면에서만 보자면 굳이 손대지 않아도 UI/UX 측면에선 사용자들이 다들 만족하는 편이긴 했지만, 반면에 기술적으로는 아쉬운 지점이 제게 보였고, 어쨌든 개발자의 입장에서 이를 개선하고 싶은 마음이 있었습니다.

취준생 입장인 제게 있어 목표와 개발 범위가 좀 더 구체적인 프로젝트에 기여할 수 있다는 점이 끌렸구요.

각설하고 해당 프로젝트의 개발 과정을 소개하기 앞서 기본적인 것들을 소개하자면 아래와 같습니다. 본격적인 글은 다음 회차에 이어집니다.

1.1. 개발 환경

Language : Java SE-17
framework : Springboot 30
library : Spring Security, Spring OAuth2.0 , Spring JPA , Hibernates
DataBase : MySQL 8.x, Redis
server enviroment : AWS EC2 instance, AWS RDB
app-container : docker
IDE : Microsoft VScode

1.2. 패키지 구조

(당연한 이야기지만)해당 프로젝트는 각각의 기능별로 패키지 단위로 나누었습니다. 외부 API를 사용하는 OAuthentication 2.0의 경우에는 domain의 하위 단위로 했고, 어플리케이션의 자체적인 보안, 인가 체계는 domain과 구분되어 auth로 설정했습니다.

이 글을 쓰기에 앞서, 몇몇 불편함을 이유로 패키지 구조를 몇 번 바꾸긴 했는데요. 당연하지만 이러면 좋지 않습니다.

1.3. 빌드와 프로퍼티 설정

build.gradle

plugins {
	id 'java'
	id 'war'
	id 'org.springframework.boot' version '3.0.2'
	id 'io.spring.dependency-management' version '1.1.0'
}

group = 'com.fleaplay'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'

configurations {
	compileOnly {
		extendsFrom annotationProcessor
	}
}

repositories {
	mavenCentral()
}

dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
	implementation 'org.springframework.boot:spring-boot-starter-data-rest'
	implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
	implementation 'org.springframework.boot:spring-boot-starter-security'
	implementation 'org.springframework.boot:spring-boot-starter-web'
	implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.5'
	runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.5'
	runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.5'
	
	compileOnly 'org.projectlombok:lombok'
	developmentOnly 'org.springframework.boot:spring-boot-devtools'
	runtimeOnly 'com.mysql:mysql-connector-j'
	annotationProcessor 'org.projectlombok:lombok'
	providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
	testImplementation 'org.springframework.boot:spring-boot-starter-test'
	testImplementation 'org.springframework.security:spring-security-test'
}

tasks.named('test') {
	useJUnitPlatform()
}

application.yml

server:
  servlet:
    encoding:
      charset: UTF-8
      enabled: true
      force: true
spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: #####
    username: #####
    password: #####
  jpa:
    database-platform: org.hibernate.dialect.MySQL8Dialect
    show-sql: true
    generate-ddl: false
    open-in-view: true
    hibernate:
      ddl-auto: create-drop
      naming:
        implicit-strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl
        physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
logging:
  level:
    org:
      hibernate:
        type:
          descriptor:
            sql: trace

2. 레퍼런스

  • AmigosCode
    해당 프로젝트를 진행하는데 있어 많은 참고가 됐던 유튜브 채널입니다.
profile
프로개발자를 지망하는.

0개의 댓글