Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
111 changes: 76 additions & 35 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,39 +1,80 @@
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### IntelliJ IDEA ###
.idea
# Root ignore rules for both `back` and `front`

### Common editor / OS files ###
.DS_Store
.idea/
.vscode/
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

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

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

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
### Environment files ###
.env
.env.*
key.env
!.env.example

### Security keys ###
*.pem
back/**/keys/private-key.pem

### Back / Gradle / JVM ###
back/.gradle/
back/**/build/
!back/gradle/wrapper/gradle-wrapper.jar
!back/**/src/main/**/build/
!back/**/src/test/**/build/
back/**/out/
!back/**/src/main/**/out/
!back/**/src/test/**/out/
back/**/.apt_generated
back/**/.classpath
back/**/.factorypath
back/**/.project
back/**/.settings
back/**/.springBeans
back/**/.sts4-cache
back/**/bin/
!back/**/src/main/**/bin/
!back/**/src/test/**/bin/
back/nbproject/private/
back/nbbuild/
back/dist/
back/nbdist/
back/.nb-gradle/

### Back personal / secret config ###
back/**/application-personal.yml
back/**/application-local.yml
back/**/application-local-*.yml
back/**/application-ldk.yml
back/**/*-secret.yml
back/**/storage-database-local.yml

### Back local docs ###
back/**/*.md

### Project local docs ###
docs/**/*.md

### Front / Node / Next ###
front/node_modules/
front/.pnp
front/.pnp.*
front/.yarn/*
!front/.yarn/patches
!front/.yarn/plugins
!front/.yarn/releases
!front/.yarn/versions
front/coverage/
front/.next/
front/out/
front/build/
front/npm-debug.log*
front/yarn-debug.log*
front/yarn-error.log*
front/.pnpm-debug.log*
front/.vercel/
front/*.tsbuildinfo
front/next-env.d.ts
front/STACK.md
14 changes: 0 additions & 14 deletions api/auth/src/main/java/http/auth.http

This file was deleted.

42 changes: 42 additions & 0 deletions back/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Git
.git
.gitignore

# Gradle
.gradle
**/build/classes
**/build/generated
**/build/reports
**/build/test-results
**/build/tmp
**/out

# IDE
.idea
*.iml
.vscode

# Logs
*.log
logs/

# OS
.DS_Store
Thumbs.db

# ๋ถˆํ•„์š”ํ•œ JAR ์ œ์™ธ (ํ•„์š”ํ•œ JAR๋งŒ ํฌํ•จ)
# api/*/build/libs/*.jar๋Š” ํ•„์š”ํ•˜๋ฏ€๋กœ ์ œ์™ธํ•˜์ง€ ์•Š์Œ

# Node
node_modules

# ๋ฌธ์„œ
*.md
!README.md

# ํ…Œ์ŠคํŠธ
**/src/test

# buildSrc ์บ์‹œ
buildSrc/.gradle
buildSrc/build
77 changes: 77 additions & 0 deletions back/.github/ISSUE_TEMPLATE/task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Task
description: Feature / Bug / Refactor ๋‹จ์œ„ ์ž‘์—…
title: "[Domain] ๋ฌด์—‡์„ ํ• ์ง€ ๊ฐ„๋‹จํžˆ"
labels: []
assignees: []

body:
- type: dropdown
id: type
attributes:
label: Type
description: ์ด ์ด์Šˆ์˜ ์„ฑ๊ฒฉ (์ •ํ™•ํžˆ 1๊ฐœ)
options:
- type:feature
- type:bug
- type:refactor
- type:infra
- type:research
validations:
required: true

- type: dropdown
id: impact
attributes:
label: Impact
description: ์™œ ์ด ์ด์Šˆ๊ฐ€ ์ค‘์š”ํ•œ๊ฐ€
options:
- impact:revenue
- impact:growth
- impact:stability
- impact:performance
- impact:maintenance
validations:
required: false

- type: dropdown
id: effort
attributes:
label: Effort
description: ๋Œ€๋žต์ ์ธ ์ž‘์—… ํฌ๊ธฐ
options:
- effort:s
- effort:m
- effort:l
validations:
required: false

- type: textarea
id: what
attributes:
label: What
description: ๋ฌด์—‡์„ ํ•˜๋Š” ์ด์Šˆ์ธ๊ฐ€
placeholder: ๋ช…ํ™•ํ•œ ์ž‘์—… ๋‚ด์šฉ
validations:
required: true

- type: textarea
id: why
attributes:
label: Why
description: ์™œ ์ง€๊ธˆ ํ•ด์•ผ ํ•˜๋Š”๊ฐ€
placeholder: ๋ฐฐ๊ฒฝ / ๋ฌธ์ œ / ๋งฅ๋ฝ
validations:
required: true

- type: textarea
id: done
attributes:
label: Done Criteria
description: ์™„๋ฃŒ ์กฐ๊ฑด (์ฒดํฌ๋ฆฌ์ŠคํŠธ)
value: |
- [ ] ๊ธฐ๋Šฅ ๋™์ž‘ ํ™•์ธ
- [ ] ํ…Œ์ŠคํŠธ ํ†ต๊ณผ
- [ ] ๋ฆฌ๋ทฐ ๋ฐ˜์˜
validations:
required: true

116 changes: 116 additions & 0 deletions back/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
pipeline {
agent any

environment {
DOCKER_COMPOSE_FILE = 'docker-compose.yml'
REGISTRY = 'zqksk'
}

stages {
stage('Checkout') {
steps {
checkout scm
echo 'Source code checkout completed'
}
}

stage('Gradle Build') {
steps {
sh 'chmod +x gradlew'
sh './gradlew clean build -x test'
}
}

stage('Docker Build') {
parallel {
stage('Build Discovery') {
steps {
sh 'docker build -t ${REGISTRY}/discovery:${BUILD_NUMBER} -f docker/discovery/Dockerfile .'
sh 'docker tag ${REGISTRY}/discovery:${BUILD_NUMBER} ${REGISTRY}/discovery:latest'
}
}
stage('Build Auth') {
steps {
sh 'docker build -t ${REGISTRY}/auth:${BUILD_NUMBER} -f docker/auth/Dockerfile .'
sh 'docker tag ${REGISTRY}/auth:${BUILD_NUMBER} ${REGISTRY}/auth:latest'
}
}
stage('Build Gateway') {
steps {
sh 'docker build -t ${REGISTRY}/gateway:${BUILD_NUMBER} -f docker/gateway/Dockerfile .'
sh 'docker tag ${REGISTRY}/gateway:${BUILD_NUMBER} ${REGISTRY}/gateway:latest'
}
}
stage('Build Stock') {
steps {
sh 'docker build -t ${REGISTRY}/stock:${BUILD_NUMBER} -f docker/stock/Dockerfile .'
sh 'docker tag ${REGISTRY}/stock:${BUILD_NUMBER} ${REGISTRY}/stock:latest'
}
}
}
}

stage('Deploy') {
steps {
sh '''
docker compose stop gateway stock auth discovery mariadb || true; \
docker compose rm -f gateway stock auth discovery mariadb || true; \
docker compose up -d mariadb; \
sleep 15; \
docker compose up -d discovery; \
sleep 15; \
docker compose up -d auth stock gateway; \
sleep 30
'''
}
}

stage('Health Check') {
steps {
script {
sh '''
echo "Waiting for services to start..."

check_health() {
local name=$1
local container=$2
local port=$3
local max_retry=20

for i in $(seq 1 $max_retry); do
if docker exec $container curl -s -o /dev/null -w '%{http_code}' http://localhost:$port/ | grep -qE '^[1-5]'; then
echo "$name is healthy!"
return 0
fi
echo "$name not ready, retry $i/$max_retry..."
sleep 5
done
echo "$name failed to start!"
return 1
}

check_health "Discovery" "zqksk-discovery" "7001" || exit 1
check_health "Auth" "zqksk-auth" "7002" || exit 1
check_health "Stock" "zqksk-stock" "7005" || exit 1
check_health "Gateway" "zqksk-gateway" "7003" || exit 1

echo "All services are healthy!"
'''
}
}
}
}

post {
success {
echo 'Deployment successful!'
}
failure {
echo 'Deployment failed!'
sh 'docker compose logs'
}
always {
sh 'docker system prune -f || true'
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
plugins {
id("org.springframework.boot")
id("io.spring.dependency-management")
id("zqksk-api-gateway.java-conventions")
}

dependencies {
implementation(platform("org.springframework.cloud:spring-cloud-dependencies:${property("springCloudVersion")}"))

implementation(project(":domain:user"))
implementation(project(":storage:database"))
implementation(project(":support:core-exception"))
Expand All @@ -24,12 +25,6 @@ dependencies {
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
}

dependencyManagement {
imports {
mavenBom("org.springframework.cloud:spring-cloud-dependencies:${property("springCloudVersion")}")
}
}

tasks.getByName("bootJar") {
enabled = true
}
Expand Down
Loading