Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e6f8c98
Feature/초기 설정 및 인증 (#1)
son-daehyeon Oct 26, 2025
55ceac2
Feature/배포 파이프라인 구축 (#2)
son-daehyeon Oct 26, 2025
2930050
chore(ci): 컨테이너의 네트워크 설정
son-daehyeon Oct 29, 2025
9dee8fd
Update deploy.yml
son-daehyeon Oct 29, 2025
bf12bab
refactor(email): 이메일 템플릿 추가
son-daehyeon Nov 1, 2025
dbd0654
feat(session): 세션 기능 구현
son-daehyeon Nov 7, 2025
3ce4b68
refactor(session): 세션 기능 코드 리팩토링
son-daehyeon Nov 7, 2025
7b93d2f
feat(session): 세션 리포트 구현
son-daehyeon Nov 7, 2025
c64e3b9
fix(session): 세션 리포트 로직 수정
son-daehyeon Nov 8, 2025
5ef3d43
feat(score): 점수 로직 추가
son-daehyeon Nov 15, 2025
8375ad4
feat(api): API 명세서 추가
son-daehyeon Nov 17, 2025
5cf36d0
feat(user): 내 정보 조회
son-daehyeon Nov 19, 2025
1e50921
feat(user): 대시보드 API
son-daehyeon Nov 19, 2025
395af9d
fix(jpa): lazy init 해결
son-daehyeon Nov 20, 2025
b2d55d5
fix(email): 회원가입 메일 템플릿 수정
son-daehyeon Nov 20, 2025
46192e9
refactor(session): replace FetchMode.SUBSELECT with BatchSize for imp…
son-daehyeon Nov 20, 2025
838f391
refactor(dashboard): simplify posture graph retrieval by removing per…
son-daehyeon Nov 20, 2025
2028d17
feat(auth): 토큰 만료 시 커스텀 예외 사용
son-daehyeon Nov 21, 2025
67e5635
chore: 랜덤 스트레칭
son-daehyeon Nov 21, 2025
3415acd
chore: 점수 로직 수정
son-daehyeon Nov 21, 2025
2f5b7c1
fix: 안되는 API 수정
son-daehyeon Nov 21, 2025
dbfa8e2
refactor: Native Query를 통한 최적화
son-daehyeon Nov 21, 2025
13c09d9
refactor: Native Query를 통한 최적화
son-daehyeon Nov 21, 2025
4fd32ad
fix: 멘트 수정
son-daehyeon Nov 21, 2025
56ece5e
fix:
son-daehyeon Nov 21, 2025
a957436
fix: 푸시~
son-daehyeon Nov 21, 2025
654b6ec
fix: 스트레칭 문구 수정
son-daehyeon Nov 21, 2025
7006188
fix: 바른 자세 시간 로직 수정
son-daehyeon Nov 25, 2025
08a26c1
fix: 이동 거리 로직 수정
son-daehyeon Nov 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_NAME=bugi
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_SCHEMA=public

# Redis Configuration
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_SSL_ENABLED=false

# Frontend Configuration
ALLOWED_ORIGINS=http://localhost:3000

# Mail Configuration
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=your-app-password

# JWT Configuration
JWT_SECRET=your-secret-key-min-256-bits-change-this-in-production
JWT_ACCESS_TOKEN_VALIDITY=1h
JWT_REFRESH_TOKEN_VALIDITY=30d
59 changes: 59 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy

on:
push:
branches: main

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
image-build:
name: Image Build and Push to NCP Registry
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to NCP Container Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.CONTAINER_REGISTRY }}
username: ${{ secrets.NCP_ACCESS_KEY }}
password: ${{ secrets.NCP_SECRET_KEY }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ secrets.CONTAINER_REGISTRY }}/server:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max

deploy:
name: Deploy to Server
runs-on: ubuntu-latest
needs: image-build
steps:
- name: Execute
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
echo ${{ secrets.NCP_SECRET_KEY }} | docker login --username ${{ secrets.NCP_ACCESS_KEY }} --password-stdin ${{ secrets.CONTAINER_REGISTRY }}

if [ $(docker ps -q -f name=server) ]; then
docker stop server
docker rm server
fi

docker pull ${{ secrets.CONTAINER_REGISTRY }}/server:${{ github.sha }}
docker run --name server --restart unless-stopped --env-file ${{ secrets.ENV_FILE }} --network bugi -p 8080:8080 -d ${{ secrets.CONTAINER_REGISTRY }}/server:${{ github.sha }}
docker image prune -f
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Kotlin ###
.kotlin

### Environment ###
.env*
!.env.template
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
########################
# 1) Build stage
########################
FROM gradle:8.14.3-jdk21-alpine AS builder

WORKDIR /application

COPY build.gradle.kts ./
RUN gradle dependencies --no-daemon --quiet

COPY src src
RUN gradle bootJar -x test --no-daemon --quiet \
&& java -Djarmode=layertools -jar build/libs/*.jar extract

########################
# 2) Runtime stage
########################
FROM gcr.io/distroless/java21-debian12:nonroot AS runtime

USER nonroot
WORKDIR /application

COPY --from=builder --chown=nonroot:nonroot /application/dependencies/ ./
COPY --from=builder --chown=nonroot:nonroot /application/snapshot-dependencies/ ./
COPY --from=builder --chown=nonroot:nonroot /application/spring-boot-loader/ ./
COPY --from=builder --chown=nonroot:nonroot /application/application/ ./

EXPOSE 8080

ENTRYPOINT ["java", "-XX:+UseG1GC", "-XX:+UseContainerSupport", "-XX:MaxRAMPercentage=75.0", "-Duser.timezone=Asia/Seoul", "-Dspring.profiles.active=production", "org.springframework.boot.loader.launch.JarLauncher"]
81 changes: 81 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
plugins {
kotlin("jvm") version "1.9.25"
kotlin("plugin.jpa") version "1.9.25"
kotlin("plugin.spring") version "1.9.25"
id("org.springframework.boot") version "3.4.11"
id("io.spring.dependency-management") version "1.1.7"
}

group = "com.github.kusitms_bugi"
version = "0.0.1-SNAPSHOT"

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xjsr305=strict")
}
}

springBoot {
buildInfo()
}

repositories {
mavenCentral()
}

dependencies {
kotlin()
web()
database()
security()
documentation()
other()
testing()
}

fun DependencyHandlerScope.kotlin() {
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
}

fun DependencyHandlerScope.web() {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
implementation("org.springframework.boot:spring-boot-starter-validation")
}

fun DependencyHandlerScope.database() {
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-data-redis")
implementation("org.flywaydb:flyway-core")
implementation("org.flywaydb:flyway-database-postgresql")
runtimeOnly("org.postgresql:postgresql")
}

fun DependencyHandlerScope.security() {
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("io.jsonwebtoken:jjwt-api:0.12.6")
runtimeOnly("io.jsonwebtoken:jjwt-impl:0.12.6")
runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.12.6")
}

fun DependencyHandlerScope.documentation() {
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.13")
}

fun DependencyHandlerScope.other() {
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-mail")
}

fun DependencyHandlerScope.testing() {
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading