---
title: "로컬 개발"
description: "Calends 개발 환경 실행 방법, 주요 명령어, 코드 구조, PR 제출 전 확인 사항을 안내합니다."
lang: "ko"
version: "1.84.0"
url: "https://docs.calends.date/ko/self-host/development/"
markdown_url: "https://docs.calends.date/ko/self-host/development.md"
section: "셀프 호스팅"
llms_index: "https://docs.calends.date/llms.txt"
llms_full: "https://docs.calends.date/llms-full.txt"
agents_guide: "https://calends.date/AGENTS.md"
---

# 로컬 개발

> Calends 개발 환경 실행 방법, 주요 명령어, 코드 구조, PR 제출 전 확인 사항을 안내합니다.

- Canonical page: https://docs.calends.date/ko/self-host/development/
- Markdown source: https://docs.calends.date/ko/self-host/development.md
- Calends version: v1.84.0

Calends 소스 코드를 수정하기 전에 개발 환경을 시작하고 검증 절차를 실행하는 방법을 확인하세요.

1. Node.js 24를 설치하고 저장소를 복제한 뒤 아래 시작 명령을 실행합니다.
2. 로컬 앱을 엽니다. 로그인을 건너뛰어야 하면 `.dev.vars` 안내를 따르세요.
3. 변경 사항에 해당하는 검사를 실행하고 제출 전 전체 체크리스트를 확인합니다.

## 시작하기

Node.js 24가 필요합니다.

```bash
git clone https://github.com/imetn/calends && cd calends
npm ci
npm run db:migrate:local
npm run dev
```

개발 중 로그인을 건너뛰려면 기존 내용을 유지한 채 `.dev.vars`에 `DEV_BYPASS_AUTH=1`을 추가하세요.

`npm run dev`는 두 프로세스를 함께 시작합니다. Vite(핫 리로드를 지원하는 프런트엔드, `0.0.0.0:5173` 바인딩으로 LAN 및 Tailscale `*.ts.net` 접속 지원)와 wrangler(Worker 및 로컬 D1, `:8787`)이며, 워치독이 Worker 포트 응답이 멈추면 Vite를 재시작하지 않고 Worker만 자동 재시작합니다. 로컬에서는 `http://127.0.0.1:5173`을 여세요.

로컬 데이터베이스는 저장소 루트의 `.wrangler/state`에 저장됩니다.

> **DANGER**: `DEV_BYPASS_AUTH=1`은 로그인을 완전히 건너뜁니다. 로컬 `.dev.vars`에만 사용하고 프로덕션에는 절대 설정하지 마세요.

## 자주 쓰는 명령어

| 명령어 | 설명 |
| --- | --- |
| `npm test` | 단위 테스트(결제 계산, 구간, 지표, 공유 플랜, 카테고리 등) |
| `npm run typecheck` | TypeScript 타입 검사 |
| `npm run lint` | oxlint 린트 검사 |
| `npm run format` / `npm run format:check` | Prettier 포맷팅 / 검사 |
| `npm run i18n:check` | 모든 언어에 모든 문자열이 빠짐없이 있는지 검사 |
| `npm run build` | 프로덕션 빌드 |
| `npm run email:preview` | 샘플 데이터로 모든 알림 이메일을 `.preview/email/`에 HTML로 렌더링(실제 발송 없음) |

## 코드 구조

```text
app/src/    앱 및 공개 페이지
shared/     결제, 구간, 지표, 환율, 마스킹, i18n — 브라우저와 Worker 공용
worker/     API, 인증(비밀번호 + 패스키), MCP, 알림 및 채널, 백업, ICS
worker/migrations/ D1 / SQLite 스키마
docker/     셀프 호스팅 이미지 진입점
```

기술 스택: 앱은 React 19, React Compiler, Vite에 대화상자·메뉴·컨트롤용 HeroUI / React Aria를 사용하며, 공개 페이지는 shadcn/ui, 서버는 Cloudflare Workers + D1을 사용합니다.

## Pull Request 제출 전 확인

```bash
npm run typecheck && npm run lint && npm run format:check && npm run i18n:check && npm test && npm run build
```

몇 가지 기본 원칙(자세한 내용은 저장소의 `CONTRIBUTING.md` 참고):

- **도메인 로직은 `shared/`에 둡니다.** 브라우저와 Worker 모두에서 실행되어야 하므로 DOM이나 Node API를 쓰지 마세요. 결제, 구간, 지표 로직을 변경할 때는 `shared/*.test.ts`에 단위 테스트를 추가하세요.
- **사용자에게 보이는 모든 문자열은 `t()`를 거칩니다.** 모듈 최상위 레벨에서 호출하지 말고, 새 문자열은 최소한 `en`과 `zh-CN`에 추가하세요.
- **저장 데이터 호환성을 유지합니다.** 기존 레코드가 계속 동작해야 하며 스키마 변경은 `worker/migrations/` 아래 새 파일로 추가하고, 새 데이터는 [백업](https://docs.calends.date/ko/data/backup.md)으로 왕복 보존되어야 합니다.
- **개인정보 보호**: 개인이나 계정을 식별할 수 있는 정보는 공개 페이지에 포함하지 않으며, `shared/mask.ts`에서 공개 허용 필드를 관리합니다.
- 기존 컴포넌트와 UI 일관성을 유지하고 휴대폰 너비(390px), 데스크톱, 라이트/다크 모드를 모두 확인하세요.

가져오기, 복원, 마이그레이션 테스트에는 격리된 `.wrangler/state`와 가상 데이터를 사용하세요. 공개 데모는 별도의 전용 배포이며 `npm run demo` 시드 명령이 아닙니다. 하위 시스템을 수정하기 전에 저장소의 `AGENTS.md`, `ARCHITECTURE.md`, `CONTRIBUTING.md`를 먼저 읽어 보세요.

---

## Related Pages & Global AI Discovery

To explore broader context beyond this page, fetch any of the Markdown or plain-text resources below directly:

### Same Section (셀프 호스팅)
- [Cloudflare Workers + D1](https://docs.calends.date/ko/self-host/cloudflare.md)
- [Docker](https://docs.calends.date/ko/self-host/docker.md)
- [구성](https://docs.calends.date/ko/self-host/config.md)
- [사용자 지정 도메인 및 HTTPS](https://docs.calends.date/ko/self-host/custom-domain.md)
- [업그레이드](https://docs.calends.date/ko/self-host/upgrade.md)
- [로컬 개발](https://docs.calends.date/ko/self-host/development.md) *(current)*
- [번역 참여](https://docs.calends.date/ko/self-host/translate.md)

### Reading Order
- Previous: [업그레이드](https://docs.calends.date/ko/self-host/upgrade.md)
- Next: [번역 참여](https://docs.calends.date/ko/self-host/translate.md)

### Global Calends Resources
- Read-only Docs MCP Server (zero auth Streamable HTTP): https://docs.calends.date/mcp
- Complete Docs Index (all 37 topics with `.md` links): https://docs.calends.date/llms.txt
- Complete English Docs Bundle (single file): https://docs.calends.date/llms-full.txt
- Complete Simplified Chinese Docs Bundle: https://docs.calends.date/llms-zh.txt
- Docs AI Agent Guide: https://docs.calends.date/AGENTS.md
- Product Website Overview (Markdown): https://calends.date/ko/index.md
- Product LLMs Index & Full Reference: https://calends.date/llms.txt | https://calends.date/llms-full.txt
- Deployment & MCP Agent Guide (AGENTS.md): https://calends.date/AGENTS.md
- FAQ & Calends vs Wallos Comparison (Markdown): https://calends.date/en/faq.md | https://calends.date/en/compare.md
- Complete Changelog (Markdown): https://calends.date/en/releases.md
