Skip to content

Commit

Permalink
Merge pull request #71 from moreal/hands-off
Browse files Browse the repository at this point in the history
chore: hands-off โœ‹๐Ÿป
  • Loading branch information
moreal authored Dec 10, 2024
2 parents cf6d21d + 8a84896 commit d97644c
Show file tree
Hide file tree
Showing 36 changed files with 3,218 additions and 4,202 deletions.
26 changes: 0 additions & 26 deletions .eslintrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: 20
cache: 'yarn'
node-version: 22
- run: corepack enable

- name: Install
shell: bash
Expand Down
874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.4.cjs

This file was deleted.

6 changes: 4 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
nodeLinker: node-modules
compressionLevel: mixed

enableGlobalCache: false

yarnPath: .yarn/releases/yarn-3.6.4.cjs
nodeLinker: node-modules
122 changes: 122 additions & 0 deletions CONTRIBUTING.ko.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# ๊ธฐ์—ฌ ๊ฐ€์ด๋“œ

9c-rudolf ํ”„๋กœ์ ํŠธ ๊ธฐ์—ฌ์— ๊ด€์‹ฌ์„ ๊ฐ€์ ธ์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค! ์ด ๋ฌธ์„œ์—์„œ๋Š” ๊ธฐ์—ฌํ•  ๋•Œ ์•Œ์•„์•ผ ํ•˜๋Š” ๋‚ด์šฉ๊ณผ ๊ธฐ์—ฌํ•˜๋Š” ๋ฒ•์„ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

## ๋ฒ„๊ทธ ๋ฆฌํฌํŠธ

๋งŒ์•ฝ 9c-rudolf ์—์„œ ๋ฒ„๊ทธ๋ฅผ ์ฐพ์œผ์…จ๋‹ค๋ฉด, ์šฐ์„  GitHub ์ด์Šˆ ํŠธ๋ž˜์ปค์—์„œ ์ด๋ฏธ ๋‹ค๋ฅธ ๊ธฐ์—ฌ์ž๊ฐ€ ์˜ฌ๋ ค๋†“์€ ์ด์Šˆ๊ฐ€ ์—†๋Š”์ง€ ๊ฒ€์ƒ‰ํ•˜์—ฌ ํ™•์ธํ•ด์ฃผ์„ธ์š”. ๊ด€๋ จ๋œ ํŒŒ์ผ ๋ช…์ด๋‚˜ API ์—”๋“œํฌ์ธํŠธ ๋“ฑ์œผ๋กœ ๊ฒ€์ƒ‰ํ•ด๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋งŒ์•ฝ ์•„์ง ๋ฐœ๊ฒฌ๋˜์ง€ ์•Š์€ ์ด์Šˆ๋ผ๋ฉด ์•„๋ž˜ ๋‚ด์šฉ๋“ค์„ ํฌํ•จํ•˜์—ฌ ์ƒˆ๋กœ ์ด์Šˆ๋ฅผ ์—ด์–ด์ฃผ์„ธ์š”:

- ์‚ฌ์šฉ ์ค‘์ธ 9c-rudolf ๋ฒ„์ „.
- ์‚ฌ์šฉ ์ค‘์ธ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค (i.e., PostgreSQL) ๋ฒ„์ „.
- ์‹คํ–‰ ์ค‘์ธ ์šด์˜์ฒด์ œ (e.g., Linux) ๋ฒ„์ „.
- ๊ธฐ๋Œ€ํ•œ ๋™์ž‘.
- ํ˜„์žฌ ๋™์ž‘.
- ํ•ด๋‹น ๋ฒ„๊ทธ๋ฅผ ์žฌํ˜„ํ•˜๊ธฐ ์œ„ํ•œ ๋ฐฉ๋ฒ•.

## ๊ธฐ๋Šฅ ์š”์ฒญํ•˜๊ธฐ

๋งŒ์•ฝ 9c-rudolf ์— ์š”์ฒญํ•˜๊ณ  ์‹ถ์€ ๊ธฐ๋Šฅ์ด ์žˆ๋‹ค๋ฉด, ์šฐ์„  GitHub ์ด์Šˆ ํŠธ๋ž˜์ปค์—์„œ ์ด๋ฏธ ์š”์ฒญ๋œ ๊ธฐ๋Šฅ์ธ์ง€ ๊ฒ€์ƒ‰ํ•˜์—ฌ ํ™•์ธํ•ด์ฃผ์„ธ์š”. ๋งŒ์•ฝ ์•„์ง ์š”์ฒญ๋˜์ง€ ์•Š์•˜๋‹ค๋ฉด ์•„๋ž˜ ๋‚ด์šฉ๋“ค์„ ํฌํ•จํ•˜์—ฌ ์ƒˆ๋กœ ์ด์Šˆ๋ฅผ ์—ด์–ด์ฃผ์„ธ์š”:

## ํ’€ ๋ฆฌํ€˜์ŠคํŠธ

์ง์ ‘ ๋‚ด์šฉ์„ ์ž‘์„ฑํ•˜๊ณ  ํ’€ ๋ฆฌํ€˜์ŠคํŠธ๋ฅผ ๋งŒ๋“ค์–ด ๊ธฐ์—ฌํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ์•„๋ž˜์—์„œ๋Š” ์‹ค์ œ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๋Š” ๊ณผ์ •์—์„œ ์•Œ์•„์•ผ ํ•  ๋‚ด์šฉ๋“ค์„ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

### ๋ผ์ด์„ผ์Šค

9c-rudolf ํ”„๋กœ์ ํŠธ๋Š” [AGPL-3.0][agpl-3.0] ๋ผ์ด์„ผ์Šค๋ฅผ ๋”ฐ๋ฆ…๋‹ˆ๋‹ค. 9c-rudolf ์ €์žฅ์†Œ์— ํ’€ ๋ฆฌํ€˜์ŠคํŠธ๋ฅผ ์—ฐ๋‹ค๋Š” ๊ฒƒ์€ ์ด ๋ผ์ด์„ผ์Šค์— ๋™์˜ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๋งŒ์•ฝ ์ด ๋ผ์ด์„ผ์Šค์— ๋™์˜ํ•˜์ง€ ์•Š๋Š”๋‹ค๋ฉด ํ’€ ๋ฆฌํ€˜์ŠคํŠธ๋ฅผ ์—ด์ง€๋งˆ์„ธ์š”.

๋˜ํ•œ ๋ฒ•์  ๋ถ„์Ÿ์„ ํ”ผํ•˜๊ธฐ ์œ„ํ•ด [CLA][CLA] ์„œ๋ช…์„ ๋ฐ›๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ƒ์„ธํ•œ ๋‚ด์šฉ์€ CLA์— ์„œ๋ช…ํ•˜๊ธฐ ์ „ ๋‚ด์šฉ์„ ์ฝ์–ด๋ณด์„ธ์š”.

[agpl-3.0]: https://www.gnu.org/licenses/agpl-3.0.en.html
[CLA]: https://en.wikipedia.org/wiki/Contributor_License_Agreement

### ๋ฒ„๊ทธ ์ˆ˜์ •

๋งŒ์•ฝ ๋ฒ„๊ทธ๋ฅผ ์ˆ˜์ •ํ•˜๊ณ ์ž ํ•œ๋‹ค๋ฉด, ์šฐ์„  GitHub ์ด์Šˆ ํŠธ๋ž˜์ปค์—์„œ ํ•ด๋‹น ๋ฒ„๊ทธ๊ฐ€ ์ด๋ฏธ ์ œ๋ณด ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•ด์ฃผ์„ธ์š”. ๋งŒ์•ฝ ์•„์ง ์ œ๋ณด๋˜์ง€ ์•Š์€ ๋ฒ„๊ทธ๋ผ๋ฉด ์ด์Šˆ๋ฅผ ์ƒˆ๋กœ ์—ด์–ด ์ •๋ง ๋ฒ„๊ทธ์ธ์ง€, ์–ด๋–ป๊ฒŒ ๊ณ ์ณ์•ผ ํ• ์ง€ ๋…ผ์˜ํ•ด์ฃผ์„ธ์š”.

๊ทธ๋ฆฌ๊ณ  ํ’€ ๋ฆฌํ€˜์ŠคํŠธ๋ฅผ ์—ด๋•Œ๋Š” ํ•ด๊ฒฐํ•˜๋Š” ๋ฒ„๊ทธ์˜ ์ด์Šˆ ๋„˜๋ฒ„๋ฅผ ํ•จ๊ป˜ ์ฒจ๋ถ€ํ•ด์ฃผ์„ธ์š”.

### ๊ธฐ๋Šฅ ๊ตฌํ˜„

๋งŒ์•ฝ ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ•˜์—ฌ ๊ธฐ์—ฌํ•˜๊ณ ์ž ํ•œ๋‹ค๋ฉด, ์šฐ์„  GitHub ์ด์Šˆ ํŠธ๋ž˜์ปค์— ์ด์Šˆ๋ฅผ ๋งŒ๋“ค๊ณ  ๋งŒ๋“ค๊ณ  ์‹ถ์€ ๊ธฐ๋Šฅ์— ๋Œ€ํ•ด ๋…ผ์˜ํ•ด์ฃผ์„ธ์š”. ๋งŒ์•ฝ ๊ทธ ์ œ์•ˆ์ด ๋ฐ›์•„๋“ค์—ฌ์ง„๋‹ค๋ฉด ๊ทธ ๋•Œ๋ถ€ํ„ฐ ์ž‘์—…์„ ์‹œ์ž‘ํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

ํ’€ ๋ฆฌํ€˜์ŠคํŠธ๋ฅผ ์—ด ๋•Œ๋Š” ์•„๋ž˜ ๋‚ด์šฉ๋“ค์„ ํฌํ•จํ•ด ์ฃผ์„ธ์š”:

- ๊ด€๋ จ๋œ ์ด์Šˆ ๋„˜๋ฒ„.
- ๋ณ€๊ฒฝ์— ๋Œ€ํ•œ ์„ค๋ช….
- ์ด ๋ณ€๊ฒฝ์ด ์™œ ํ•„์š”ํ•œ์ง€์— ๋Œ€ํ•œ ์„ค๋ช….
- ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ํ…Œ์ŠคํŠธ ํ•˜๊ธฐ ์œ„ํ•œ ๋ฐฉ๋ฒ•.

ํ’€ ๋ฆฌํ€˜์ŠคํŠธ์˜ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์€ ์•„๋ž˜ ํ•ญ๋ชฉ์„ ํฌํ•จํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค:

- ๊ธฐ๋Šฅ์— ๋Œ€ํ•œ ์œ ๋‹› ํ…Œ์ŠคํŠธ.
- ๊ธฐ๋Šฅ์— ๋Œ€ํ•œ ๊ตฌํ˜„.
- ๊ธฐ์กด ๊ธฐ๋Šฅ์„ ๋ณ€๊ฒฝํ•œ ๊ฒฝ์šฐ, ๊ด€๋ จ ๋ฌธ์„œ ์—…๋ฐ์ดํŠธ.
- ๋ฌธ์„œ ๋“ฑ์— ์œ„์น˜ํ•œ ์˜ˆ์ œ ์ฝ”๋“œ์˜ ๋™์ž‘ ์—ฌ๋ถ€.

## ๋นŒ๋“œ

### ๊ฐœ๋ฐœํ™˜๊ฒฝ

9c-rudolf ๊ฐœ๋ฐœ์„ ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ์•„๋ž˜์™€ ๊ฐ™์€ ํ•ญ๋ชฉ๋“ค์ด ์ค€๋น„๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

- Node.js 22 ์ด์ƒ
- [yarn]
- AWS KMS ์ธ์Šคํ„ด์Šค. (Asymmetric, ECC_SECG_P256K1)
- PostgreSQL ์ธ์Šคํ„ด์Šค.
- macOS์˜ ๊ฒฝ์šฐ Homebrew๋กœ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
- [NineChronicles.Headless][9c-headless] GraphQL API ์—”๋“œํฌ์ธํŠธ.
- ์†ก๊ธˆ ํ…Œ์ŠคํŠธ๊นŒ์ง€ ์ง„ํ–‰ํ•˜๊ณ ์ž ํ•œ๋‹ค๋ฉด ์œ„ AWS KMS ์ธ์Šคํ„ด์Šค ์ฃผ์†Œ์— ์žฌํ™”๊ฐ€ ๋“ค์–ด์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
- ๋•Œ๋ฌธ์— ๋กœ์ปฌ ํ—ค๋“œ๋ฆฌ์Šค๋ฅผ ๋„์šธ ์ˆ˜ ์žˆ๋‹ค๋ฉด ๋„์›Œ์„œ ํ…Œ์ŠคํŠธ ํ•˜๋Š” ๊ฒƒ๋„ ๋ฐฉ๋ฒ•์ด๊ณ , ๋ณ„๋„์˜ ํ…Œ์ŠคํŠธ๋„ท์„ ์ƒ์‹œ ๋„์›Œ๋†“๊ณ  ์–ด๋“œ๋ฏผ ๊ถŒํ•œ์œผ๋กœ ์žฌํ™”๋ฅผ ๋ฐœํ–‰ํ•˜๊ฑฐ๋‚˜, ์†ก๊ธˆํ•˜์—ฌ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

์ค€๋น„๊ฐ€ ๋˜์—ˆ๋‹ค๋ฉด ๋จผ์ € `yarn install --immutable` ๋ช…๋ น์–ด๋กœ ์˜์กด์„ฑ์„ ์„ค์น˜ํ•ด์ฃผ์„ธ์š”.

์ด์ œ `.env` ํŒŒ์ผ์„ ๊ตฌ์„ฑํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

- `AWS_KMS_KEY_ID` ์—๋Š” ์œ„์—์„œ ์ค€๋น„ํ•œ AWS KMS ์ธ์Šคํ„ด์Šค์˜ key-id๋ฅผ ๋„ฃ์–ด์ฃผ์„ธ์š”.
- `AWS_KMS_PUBLIC_KEY` ์—๋Š” `AWS_KMS_KEY_ID` ์— ํ•ด๋‹นํ•˜๋Š” AWS KMS ์ธ์Šคํ„ด์Šค์˜ ๊ณต๊ฐœํ‚ค๋ฅผ ๋„ฃ์–ด์ฃผ์„ธ์š”. `uncompressed` ํฌ๋งท์œผ๋กœ ๋„ฃ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
- `NC_GRAPHQL_ENDPOINT` ์—๋Š” ์œ„์—์„œ ์ค€๋น„ํ•œ [NineChronicles.Headelss][9c-headless] GraphQL ์—”๋“œํฌ์ธํŠธ๋ฅผ ์ค€๋น„ํ•ด์ฃผ์„ธ์š”. (e.g., `https://9c-main-full-state.nine-chronicles.com/graphql`)
- `DATABASE_URL` ์—๋Š” ์œ„์—์„œ ์ค€๋น„ํ•œ PostgreSQL ์ธ์Šคํ„ด์Šค์— ์ ‘์†ํ•  ์ˆ˜ ์žˆ๋Š” connection-string์„ ๋„ฃ์–ด์ฃผ์„ธ์š”. ์ฝ๊ธฐ/์“ฐ๊ธฐ ๊ถŒํ•œ ๋ชจ๋‘ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
- `NCG_MINTER` ๊ฐ’์€ 9c-rudolf๊ฐ€ ๋ฐ”๋ผ๋ณด๋Š” ๋„คํŠธ์›Œํฌ์—์„œ ์‚ฌ์šฉํ•˜๋Š” NCG ํ˜•ํƒœ์— ๋”ฐ๋ผ ๋‹ฌ๋ผ์ง‘๋‹ˆ๋‹ค. 2024-12-10 09:00 KST ๊ธฐ์ค€, heimdall ๊ฐ™์€ ํ™•์žฅ์šฉ ๋„คํŠธ์›Œํฌ์˜ ๊ฒฝ์šฐ `minters` ์†์„ฑ ๊ฐ’์„ `null`๋กœ ๊ฐ€์ง„ NCG๋ฅผ ์‚ฌ์šฉ์ค‘์ž…๋‹ˆ๋‹ค. ์ด ๊ฒฝ์šฐ `NCG_MINTER` ๋ฅผ ์ •์˜ํ•˜์ง€ ๋งˆ์„ธ์š”. ๊ทธ ์™ธ์˜ ๊ฒฝ์šฐ์—๋Š” NCG์˜ `minters` ์†์„ฑ ๊ฐ’์„ ํ™•์ธ ํ›„ ๋„ฃ์–ด์ฃผ์„ธ์š”.
- `GENESIS_BLOCK_HASH` ๊ฐ’์€ 9c-rudolf๊ฐ€ ๋ฐ”๋ผ๋ณด๋Š” ๋„คํŠธ์›Œํฌ์˜ ์ œ๋„ค์‹œ์Šค ๋ธ”๋ก์˜ ํ•ด์‹œ์ž…๋‹ˆ๋‹ค. ์ด ๊ฐ’์ด ๋‹ค๋ฅด๋‹ค๋ฉด ๋„คํŠธ์›Œํฌ์— ๋งž์ง€ ์•Š์€ ํŠธ๋žœ์žญ์…˜์„ ๋งŒ๋“ค๊ฒŒ ๋˜๊ณ , ๋ณ€๊ฒฝ ๋œ๋‹ค๋ฉด ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ์˜ค์—ผ์‹œํ‚ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
- `DEFAULT_START_NONCE` ๊ฐ’์€ ์„ ํƒ์ ์ž…๋‹ˆ๋‹ค. ์ด๋ฏธ ์‚ฌ์šฉํ•˜๋˜์ด ๊ณ„์ •์ด๊ฑฐ๋‚˜, ์‚ฌ์ „ ์ž‘์—…์„ ์ง„ํ–‰ํ•˜๋ฉฐ ํŠธ๋žœ์žญ์…˜์„ ์„œ๋ช…ํ•˜์˜€๋‹ค๋ฉด 9c-rudolf๊ฐ€ ์‚ฌ์šฉํ•  ๋…ผ์Šค๋ฅผ ์ง€์ •ํ•ด์ค˜์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด nonce 0, 1, 2์— ํ•ด๋‹นํ•˜๋Š” ํŠธ๋žœ์žญ์…˜์„ ์„œ๋ช…ํ•˜์—ฌ ๋„คํŠธ์›Œํฌ์— ํฌํ•จ์‹œํ‚จ ๊ณ„์ •์ด๋ผ๋ฉด, `3` ์„ ๊ฐ’์œผ๋กœ ์ง€์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

`yarn start:dev` ๋ช…๋ น์–ด๋กœ ์‹คํ–‰ํ•ด๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ž์„ธํ•œ ์Šคํฌ๋ฆฝํŠธ ๋ชฉ๋ก๊ณผ ๋‚ด์šฉ์€ [package.json](./package.json)์„ ์ฐธ๊ณ ํ•˜์„ธ์š”.

### ๋นŒ๋“œ

`yarn build` ๋ช…๋ น์–ด๋กœ ๋นŒ๋“œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

### ๋„์ปค ๋นŒ๋“œ

Dockerfile์ด ์ •์˜๋˜์–ด ์žˆ์œผ๋ฏ€๋กœ `docker build` ๊ฐ™์€ ๋ช…๋ น์–ด๋กœ ์ปจํ…Œ์ด๋„ˆ ์ด๋ฏธ์ง€๋ฅผ ๋งŒ๋“ค์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์—ฌ๋Ÿฌ ํ”Œ๋žซํผ์„ ํƒ€๊ฒŸํ•ด์•ผ ํ•œ๋‹ค๋ฉด `docker buildx build` ๋ช…๋ น์–ด๋ฅผ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

## ํŒ

### AWS KMS์—์„œ ๊ณต๊ฐœํ‚ค์™€ ์ฃผ์†Œ ์–ป๋Š” ๋ฐฉ๋ฒ•

AWS KMS ์ธ์Šคํ„ด์Šค๋ฅผ ๋งŒ๋“ค๊ณ  ๋‚˜์„œ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ๊ณต๊ฐœํ‚ค๊ฐ€ ํ•„์š”ํ•˜๊ณ , ์žฌํ™”๋ฅผ ์ฑ„์›Œ๋„ฃ๊ธฐ ์œ„ํ•ด์„œ๋Š” ์ฃผ์†Œ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์•„๋ž˜ ์Šคํฌ๋ฆฝํŠธ๋กœ ๊ฐ„๋‹จํžˆ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

```typescript
import { AwsKmsKeyStore, KMSClient } from "npm:@planetarium/account-aws-kms";

const keyStore = new AwsKmsKeyStore(new KMSClient());
const response = await keyStore.get("<KEY-ID>");
if (response.result === "success") {
const account = response.account;
const publicKey = await account.getPublicKey();
const address = await account.getAddress();

console.log("publicKey", publicKey.toHex("uncompressed"));
console.log("address", address.toString());
} else {
console.error("Failed to read key information.", response);
}
```

์œ„ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์œ„ํ•ด ํ•„์š”ํ•œ ๊ถŒํ•œ์€ [@planetarium/account-aws-kms์˜ README](https://github.com/planetarium/libplanet/tree/7513c9b730177484b01decf553b978af8175f0a3/%40planetarium/account-aws-kms#required-permissions)๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

[yarn]: https://yarnpkg.com/
[9c-headless]: https://github.com/planetarium/NineChronicles.Headless
17 changes: 14 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
FROM node:20 AS builder
FROM node:22.12.0 AS builder

WORKDIR /app

ADD . /app

RUN yarn install
RUN corepack enable
RUN yarn install --immutable

RUN yarn prisma generate

RUN yarn build

CMD yarn prisma:deploy && yarn start:prod
FROM node:22.12.0-slim AS runtime

WORKDIR /app

COPY --from=builder /app/dist /app
ADD .yarnrc.yml package.json yarn.lock /app/

RUN corepack enable
RUN yarn workspaces focus -A --production

CMD yarn prisma:deploy && node dist/main.js
69 changes: 69 additions & 0 deletions README.ko.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<div align="center">

<img src="./docs/assets/logo.svg" width="144" alt="9c-rudolf logo generated by Firefly" />

<h1 align="center">9c-rudolf</h1>

<p align="center">
<strong>์žฌํ™” ์ „์†ก์šฉ <a href="https://nine-chronicles.dev/">๋‚˜์ธํฌ๋กœ๋‹ˆํด</a> ํŠนํ™” ๋Œ€๊ธฐ์—ด(ํ) ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜</strong>
</p>

[![Discord](https://img.shields.io/discord/539405872346955788?color=6278DA&label=Planetarium&logo=discord&logoColor=white)](https://discord.gg/JyujU8E4SD)
[![Planetarium-Dev Discord Invite](https://img.shields.io/discord/928926944937013338?color=6278DA&label=Planetarium-dev&logo=discord&logoColor=white)](https://discord.gg/RYJDyFRYY7)

</div>

## ๊ฐœ์š”

์žฌํ™”๋ฅผ ๋ณด๋‚ด๊ฑฐ๋‚˜ ์•„์ดํ…œ์„ ๋ณด๋‚ด๋Š” ์ž‘์—…์„ ํ•˜๋‚˜ํ•˜๋‚˜ ํŠธ๋žœ์žญ์…˜์œผ๋กœ ์ƒ์„ฑํ•˜๋Š” ๋Œ€์‹ , ์—ฌ๋Ÿฌ ์ž‘์—…๋“ค์„ ์ˆœ์ฐจ์ ์œผ๋กœ ๋ฌถ์–ด ํ•˜๋‚˜์˜ ํŠธ๋žœ์žญ์…˜์œผ๋กœ ๋งŒ๋“ค๊ณ  ๋„คํŠธ์›Œํฌ์— ์ „ํŒŒํ•˜๋Š” [๋‚˜์ธํฌ๋กœ๋‹ˆํด][nine-chronicles] ์ „์šฉ ๋Œ€๊ธฐ์—ด(ํ) ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์ž…๋‹ˆ๋‹ค.

## ์˜์กด์„ฑ ์„ค์น˜

```bash
$ yarn install --immutable
```

## ์‹คํ–‰ํ•˜๊ธฐ

```bash
# development
$ yarn run start

# watch mode
$ yarn run start:dev

# production mode
$ yarn run start:prod
```

## ํ…Œ์ŠคํŠธ

```bash
# unit tests
$ yarn run test

# e2e tests
$ yarn run test:e2e

# test coverage
$ yarn run test:cov
```

## ์ŠคํŠธ๋ ˆ์Šค ํ…Œ์ŠคํŠธ

์ŠคํŠธ๋ ˆ์Šค ํ…Œ์ŠคํŠธ๋ฅผ ๋Œ๋ฆฌ๊ธฐ ์œ„ํ•ด์„œ๋Š” [`k6`][k6]๋ฅผ ์„ค์น˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ ๋งํฌ์˜ ์ง€์นจ์„ ๋”ฐ๋ผ ์„ค์น˜ํ•˜์‹ค ์ˆ˜ ์žˆ์–ด์š”. https://k6.io/docs/get-started/installation/

```
$ k6 run k6/stress-test.spec.ts
```

## Docker ์ €์žฅ์†Œ

9c-rudolf ์ด๋ฏธ์ง€์ง€ Docker Hub์— ๋ฐฐํฌ ๋˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. Docker Hub ์ €์žฅ์†Œ๋Š” https://hub.docker.com/r/planetariumhq/9c-rudolf ์—์„œ ํ™•์ธํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

## ๋ผ์ด์„ผ์Šค

9c-rudolf๋Š” [AGPL-3.0 ๋ผ์ด์„ผ์Šค](LICENSE)๋ฅผ ๋”ฐ๋ฆ…๋‹ˆ๋‹ค.

[nine-chronicles]: https://nine-chronicles.dev/
[k6]: https://k6.io/
21 changes: 21 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"javascript": {
"parser": {
"unsafeParameterDecoratorsEnabled": true
},
"formatter": {
"quoteStyle": "single",
"indentStyle": "space"
}
},
"json": {
"formatter": {
"indentStyle": "space"
}
},
"files": {
"include": ["src", "test", "*"],
"ignore": ["node_modules", "dist"]
}
}
Loading

0 comments on commit d97644c

Please sign in to comment.