Skip to content

Commit 06aeb30

Browse files
committed
chore : 프로젝트 초기화 (kotlin springboot, vitepress docs)
0 parents  commit 06aeb30

File tree

21 files changed

+4337
-0
lines changed

21 files changed

+4337
-0
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/gradlew text eol=lf
2+
*.bat text eol=crlf
3+
*.jar binary

.github/workflows/docs-deploy.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Docs Build & Deploy
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pages: write
14+
15+
steps:
16+
- uses: actions/checkout@v5
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v5
22+
with:
23+
node-version: 22
24+
25+
- name: Install deps
26+
run: yarn install --frozen-lockfile
27+
working-directory: docs
28+
29+
- name: Build VitePress site
30+
run: yarn run build
31+
working-directory: docs
32+
33+
- name: Install Vercel CLI
34+
run: npm install -g vercel
35+
36+
- name: Deploy to Vercel
37+
run: vercel --prod --token=${{ secrets.VERCEL_TOKEN }} --confirm --cwd docs/.vitepress/dist

.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
docs/node_modules/
2+
docs/.vitepress/cache/
3+
HELP.md
4+
.gradle
5+
build/
6+
!gradle/wrapper/gradle-wrapper.jar
7+
!**/src/main/**/build/
8+
!**/src/test/**/build/
9+
10+
### STS ###
11+
.apt_generated
12+
.classpath
13+
.factorypath
14+
.project
15+
.settings
16+
.springBeans
17+
.sts4-cache
18+
bin/
19+
!**/src/main/**/bin/
20+
!**/src/test/**/bin/
21+
22+
### IntelliJ IDEA ###
23+
.idea
24+
*.iws
25+
*.iml
26+
*.ipr
27+
out/
28+
!**/src/main/**/out/
29+
!**/src/test/**/out/
30+
31+
### NetBeans ###
32+
/nbproject/private/
33+
/nbbuild/
34+
/dist/
35+
/nbdist/
36+
/.nb-gradle/
37+
38+
### VS Code ###
39+
.vscode/
40+
41+
### Kotlin ###
42+
.kotlin

build.gradle.kts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
plugins {
2+
kotlin("jvm") version "1.9.25"
3+
kotlin("plugin.spring") version "1.9.25"
4+
id("org.springframework.boot") version "3.5.6"
5+
id("io.spring.dependency-management") version "1.1.7"
6+
kotlin("plugin.jpa") version "1.9.25"
7+
}
8+
9+
group = "com.example"
10+
version = "0.0.1-SNAPSHOT"
11+
description = "demo"
12+
13+
java {
14+
toolchain {
15+
languageVersion = JavaLanguageVersion.of(21)
16+
}
17+
}
18+
19+
configurations {
20+
compileOnly {
21+
extendsFrom(configurations.annotationProcessor.get())
22+
}
23+
}
24+
25+
repositories {
26+
mavenCentral()
27+
}
28+
29+
dependencies {
30+
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
31+
implementation("org.springframework.boot:spring-boot-starter-web")
32+
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
33+
implementation("org.jetbrains.kotlin:kotlin-reflect")
34+
compileOnly("org.projectlombok:lombok")
35+
runtimeOnly("com.h2database:h2")
36+
annotationProcessor("org.projectlombok:lombok")
37+
testImplementation("org.springframework.boot:spring-boot-starter-test")
38+
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
39+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
40+
}
41+
42+
kotlin {
43+
compilerOptions {
44+
freeCompilerArgs.addAll("-Xjsr305=strict")
45+
}
46+
}
47+
48+
allOpen {
49+
annotation("jakarta.persistence.Entity")
50+
annotation("jakarta.persistence.MappedSuperclass")
51+
annotation("jakarta.persistence.Embeddable")
52+
}
53+
54+
tasks.withType<Test> {
55+
useJUnitPlatform()
56+
}

docs/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

docs/.vitepress/config.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { defineConfig } from 'vitepress'
2+
import {sidebar} from './sidebar-generator.mjs'
3+
4+
// https://vitepress.vuejs.org/config/app-configs
5+
export default defineConfig({
6+
title: "모잇 BE 문서화",
7+
description: "모잇 BE 문서화",
8+
9+
themeConfig: {
10+
sidebar:sidebar,
11+
nav: [
12+
{text: 'Home', link: '/'},
13+
{text: 'API Docs', link: '/api/index.md'}
14+
],
15+
}
16+
})
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import fs from 'fs';
2+
import path from 'path';
3+
4+
const docsRoot = path.resolve(__dirname, '..');
5+
6+
/**
7+
* 파일 이름을 Title Case 형태의 텍스트로 변환합니다.
8+
* e.g., 'error-subscription.md' -> 'Error Subscription'
9+
* @param {string} filename - 변환할 파일 이름
10+
*/
11+
function toTitleCase(filename) {
12+
return filename.replace(/-/g, ' ').replace(/\.md$/, '')
13+
.split(' ')
14+
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
15+
.join(' ');
16+
}
17+
18+
/**
19+
* 지정된 디렉토리 경로에서 사이드바 그룹 객체를 생성합니다.
20+
* @param {string} dirPath - 'docs' 기준의 상대 경로 (e.g., 'api/rest')
21+
* @param {string} groupText - 사이드바에 표시될 그룹 이름
22+
*/
23+
function getSidebarGroup(dirPath, groupText) {
24+
const fullPath = path.join(docsRoot, dirPath);
25+
try {
26+
const files = fs.readdirSync(fullPath);
27+
28+
const items = files
29+
.filter(file => file.endsWith('.md'))
30+
.map(file => {
31+
const link = `/${dirPath}/${file.replace(/\.md$/, '')}`;
32+
return {text: toTitleCase(file), link};
33+
});
34+
35+
return {text: groupText, items};
36+
} catch (error) {
37+
console.warn(`Could not read directory for sidebar group: ${fullPath}`,
38+
error);
39+
return {text: groupText, items: []};
40+
}
41+
}
42+
43+
export const sidebar = [
44+
getSidebarGroup('api', 'REST APIs'),
45+
];

docs/api/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# API 명세입니다.

docs/guide.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
# 가이드
3+
4+
이것은 가이드 페이지입니다.

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Hello World

0 commit comments

Comments
 (0)