시작하기
사전 요구사항
- Node.js 20+
- pnpm 10+
- Docker & Docker Compose
빠른 설정
bash
make setup # 의존성 설치 + DB 시작 + 마이그레이션 실행 + 시드 데이터 입력
make dev # 모든 개발 서버 시작수동 설정
bash
# 1. 의존성 설치
pnpm install
# 2. 환경 설정
cp .env.example .env
# .env 파일에 자격 증명 입력
# 3. 인프라 시작
make db-start # PostgreSQL + Redis + pgAdmin
# 4. 패키지 빌드
pnpm build
# 5. 마이그레이션 및 시드 데이터 실행
make db-migrate
make db-seed
# 6. 개발 시작
pnpm dev개발 서비스
| 서비스 | URL |
|---|---|
| API 서버 | http://localhost:3000/trpc |
| HR 시스템 | http://localhost:4000 |
| 관리자 패널 | http://localhost:4001 |
| 직원 앱 | http://localhost:4002 |
| 간호 스케줄러 | http://localhost:4003 |
| 내부 결재 | http://localhost:4004 |
| 총무 관리 | http://localhost:4005 |
| 모듈 관리자 | http://localhost:4010 |
| PostgreSQL | localhost:5432 |
| pgAdmin | http://localhost:5050 |
| Redis | localhost:6379 |
테스트 계정
make db-seed 실행 후:
| 역할 | 이메일 | 비밀번호 |
|---|---|---|
| 관리자 | admin@hereby.com | admin123 |
| 개발자 | dev.lee@hereby.com | dev123 |
| HR 매니저 | hr.kim@hereby.com | hr123 |
| 영업 | sales.park@hereby.com | sales123 |
주요 명령어
bash
# 개발
pnpm dev # 전체 서버
pnpm --filter @hereby/api dev # API만
pnpm --filter @hereby/hr-system dev # HR 시스템만
# 빌드
pnpm build # 전체 패키지 + 앱
# 코드 품질
pnpm lint:check # 린트 검사
pnpm lint:fix # 자동 수정
# 테스트
pnpm test # 전체 테스트
pnpm test:integration # 통합 테스트
# 데이터베이스
make db-start / db-stop / db-restart
make db-migrate / db-seed / db-shell
make db-generate name=MigrationName환경 변수
주요 변수 (전체 목록은 .env.example 참조):
bash
DB_HOST=localhost DB_PORT=5432
DB_NAME=hereby_platform DB_USERNAME=hereby_admin
REDIS_HOST=localhost REDIS_PORT=6379
JWT_SECRET=your-secret JWT_EXPIRES_IN=24h
API_PORT=3000 TZ=Asia/Seoul