fix(ci): package-lock.json 제거 후 npm install (플랫폼 호환) #8
@ -25,7 +25,8 @@ jobs:
|
||||
env:
|
||||
VITE_GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
|
||||
run: |
|
||||
npm install --no-optional
|
||||
rm -f package-lock.json
|
||||
npm install
|
||||
npx vite build
|
||||
|
||||
- name: Deploy frontend
|
||||
|
||||
156
CLAUDE.md
156
CLAUDE.md
@ -1,12 +1,19 @@
|
||||
# 프로젝트 개요
|
||||
|
||||
- **타입**: 모노레포 (Frontend + Backend + Prediction)
|
||||
- **Frontend**: React + TypeScript + Vite
|
||||
- **Backend**: Spring Boot 3.2.5 + Java 17 + PostgreSQL
|
||||
- **Prediction**: FastAPI (Python)
|
||||
- **Node.js**: `.node-version` 참조
|
||||
- **Java**: `backend/.sdkmanrc` 참조
|
||||
- **패키지 매니저**: npm (frontend), Maven (backend), pip (prediction)
|
||||
- **이름**: KCG 모니터링 대시보드 (kcg-monitoring)
|
||||
- **구조**: 모노레포 (Frontend + Backend + Prediction)
|
||||
- **도메인**: https://kcg.gc-si.dev
|
||||
- **Gitea**: https://gitea.gc-si.dev/gc/kcg-monitoring
|
||||
|
||||
## 기술 스택
|
||||
|
||||
| 패키지 | 스택 | 비고 |
|
||||
|--------|------|------|
|
||||
| **Frontend** | React 19 + TypeScript + Vite 7 + Tailwind CSS 4 | i18n(ko/en), 테마(dark/light) |
|
||||
| **Backend** | Spring Boot 3.2.5 + Java 17 + PostgreSQL | Google OAuth + JWT 인증 |
|
||||
| **Prediction** | FastAPI (Python) | 향후 해양 분석 |
|
||||
| **DB** | PostgreSQL 16 (211.208.115.83:5432/kcgdb, 스키마: kcg) | |
|
||||
| **CI/CD** | Gitea Actions → nginx + systemd | main merge 시 자동 배포 |
|
||||
|
||||
## 빌드 및 실행
|
||||
|
||||
@ -14,89 +21,106 @@
|
||||
```bash
|
||||
cd frontend
|
||||
npm install
|
||||
npm run dev
|
||||
npm run dev # 개발서버 (포트 5173)
|
||||
npm run build # 프로덕션 빌드
|
||||
npm run lint # ESLint 검증
|
||||
```
|
||||
|
||||
### Backend
|
||||
```bash
|
||||
cd backend
|
||||
# application-local.yml 설정 필요 (application-local.yml.example 참조)
|
||||
# 최초: application-local.yml 설정 필요
|
||||
cp src/main/resources/application-local.yml.example src/main/resources/application-local.yml
|
||||
mvn spring-boot:run -Dspring-boot.run.profiles=local
|
||||
mvn spring-boot:run -Dspring-boot.run.profiles=local # 개발서버 (포트 8080)
|
||||
mvn compile # 컴파일 검증
|
||||
mvn package # JAR 빌드 (target/kcg.jar)
|
||||
```
|
||||
|
||||
### Database
|
||||
```bash
|
||||
psql -U postgres -f database/init.sql
|
||||
psql -U postgres -d kcgdb -f database/migration/001_initial_schema.sql
|
||||
```
|
||||
|
||||
### Prediction
|
||||
```bash
|
||||
cd prediction
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
uvicorn main:app --reload --port 8000
|
||||
```
|
||||
|
||||
### 린트/검증
|
||||
```bash
|
||||
# Frontend
|
||||
cd frontend && npm run lint
|
||||
|
||||
# Backend
|
||||
cd backend && mvn compile
|
||||
psql -h 211.208.115.83 -U kcg_app -d kcgdb -f database/init.sql
|
||||
psql -h 211.208.115.83 -U kcg_app -d kcgdb -f database/migration/001_initial_schema.sql
|
||||
```
|
||||
|
||||
## 프로젝트 구조
|
||||
|
||||
```
|
||||
frontend/
|
||||
frontend/ # React 19 + Vite 7 + Tailwind CSS 4
|
||||
├── src/
|
||||
│ ├── assets/
|
||||
│ ├── components/
|
||||
│ ├── hooks/
|
||||
│ ├── pages/
|
||||
│ ├── services/
|
||||
│ ├── store/
|
||||
│ ├── types/
|
||||
│ ├── utils/
|
||||
│ ├── App.tsx
|
||||
│ └── main.tsx
|
||||
│ ├── components/ # 28개 컴포넌트 (맵 레이어, UI 패널, 인증)
|
||||
│ ├── hooks/ # useReplay, useMonitor, useTheme, useAuth
|
||||
│ ├── services/ # API 서비스 (ships, opensky, osint, authApi 등)
|
||||
│ ├── styles/ # tokens.css (테마 토큰), tailwind.css
|
||||
│ ├── i18n/ # i18next (ko/en)
|
||||
│ ├── data/ # 정적 데이터 (공항, 유전시설, 샘플)
|
||||
│ └── App.tsx # 인증 가드 → LoginPage / AuthenticatedApp
|
||||
├── package.json
|
||||
└── vite.config.ts
|
||||
└── vite.config.ts # Vite + 프록시 (/api/kcg → backend, /signal-batch → wing)
|
||||
|
||||
backend/
|
||||
backend/ # Spring Boot 3.2 + Java 17
|
||||
├── src/main/java/gc/mda/kcg/
|
||||
│ ├── config/ # 설정 (CORS, Security, Properties)
|
||||
│ ├── auth/ # 인증 (Google OAuth + JWT)
|
||||
│ ├── domain/ # 도메인 (event, news, osint, aircraft)
|
||||
│ └── collector/ # 데이터 수집기 (GDELT, GoogleNews, CENTCOM)
|
||||
│ ├── auth/ # Google OAuth + JWT (gcsc.co.kr 제한)
|
||||
│ ├── config/ # CORS, Security, AppProperties
|
||||
│ ├── collector/ # 수집기 placeholder (GDELT, GoogleNews, CENTCOM)
|
||||
│ └── domain/ # event, news, osint, aircraft (placeholder)
|
||||
├── src/main/resources/
|
||||
│ ├── application.yml
|
||||
│ └── application-*.yml.example
|
||||
│ ├── application.yml # 공통 설정
|
||||
│ ├── application-local.yml.example
|
||||
│ └── application-prod.yml.example
|
||||
└── pom.xml
|
||||
|
||||
database/
|
||||
├── init.sql
|
||||
└── migration/
|
||||
database/ # PostgreSQL
|
||||
├── init.sql # CREATE SCHEMA kcg
|
||||
└── migration/001_initial_schema.sql # events, news, osint, users, login_history
|
||||
|
||||
prediction/
|
||||
├── main.py
|
||||
└── requirements.txt
|
||||
prediction/ # FastAPI placeholder
|
||||
deploy/ # systemd + nginx 배포 설정
|
||||
.gitea/workflows/deploy.yml # CI/CD (main merge → 자동 빌드/배포)
|
||||
```
|
||||
|
||||
## 팀 스킬 사용 지침
|
||||
|
||||
### 중요: 스킬 실행 시 반드시 따라야 할 규칙
|
||||
|
||||
**`/push`, `/mr`, `/release` 스킬은 SKILL.md에 정의된 절차를 순서대로 엄격히 따라야 한다.**
|
||||
|
||||
특히 다음 단계를 절대 건너뛰지 말 것:
|
||||
|
||||
1. **Step 0.5 해시 비교**: 서버 해시와 로컬 해시를 실제로 bash 실행하여 비교.
|
||||
불일치 시 `/sync-team-workflow` 자동 실행 후 원래 작업 계속.
|
||||
2. **AskUserQuestion 사용자 확인**: 커밋 메시지, MR 타겟, 릴리즈 노트 초안을
|
||||
반드시 사용자에게 보여주고 승인/수정/취소를 물어야 한다.
|
||||
자의적으로 진행하지 말 것.
|
||||
3. **API 응답 검증**: MR 생성, 봇 승인, 머지 API 호출 후 반드시 상태를 확인.
|
||||
실패 시 사용자에게 알리고 중단.
|
||||
|
||||
### 스킬 목록
|
||||
- `/push` — 커밋 + 푸시 (해시 비교 → 커밋 메시지 확인 → 푸시)
|
||||
- `/mr` — 커밋 + 푸시 + MR 생성 (릴리즈 노트 갱신 포함)
|
||||
- `/release` — develop → main 릴리즈 MR (릴리즈 노트 날짜 전환)
|
||||
- `/version` — VERSION-HISTORY.md 생성
|
||||
- `/create-mr` — MR 생성만 (세부 옵션)
|
||||
- `/fix-issue` — 이슈 기반 작업 브랜치 생성
|
||||
|
||||
### 환경변수
|
||||
- `GITEA_TOKEN`: `.claude/settings.local.json`의 `env`에 설정 (gitignored)
|
||||
- `CLAUDE_BOT_TOKEN`: `.claude/settings.json`의 `env`에 설정 (gitignored by .claude/ rule)
|
||||
|
||||
## 배포
|
||||
|
||||
- **도메인**: https://kcg.gc-si.dev
|
||||
- **서버**: rocky-211 (SSH 접속, Gitea Actions 러너 = 배포 서버)
|
||||
- **Frontend**: `/deploy/kcg/` (nginx 정적 파일 서빙)
|
||||
- **Backend**: `/deploy/kcg-backend/kcg.jar` (systemd `kcg-backend` 서비스, JDK 17, 2~4GB 힙)
|
||||
- **nginx**: `/etc/nginx/conf.d/kcg.conf` (SSL + SPA + API 프록시)
|
||||
- **DB**: 211.208.115.83:5432/kcgdb (유저: kcg_app)
|
||||
|
||||
## 팀 규칙
|
||||
|
||||
- 코드 스타일: `.claude/rules/code-style.md` 참조
|
||||
- 네이밍 규칙: `.claude/rules/naming.md` 참조
|
||||
- 테스트 규칙: `.claude/rules/testing.md` 참조
|
||||
- Git 워크플로우: `.claude/rules/git-workflow.md` 참조
|
||||
- 팀 정책: `.claude/rules/team-policy.md` 참조
|
||||
|
||||
## 의존성 관리
|
||||
|
||||
- Frontend: Nexus 프록시 레포지토리를 통해 npm 패키지 관리 (`.npmrc`)
|
||||
- Backend: Maven Central (pom.xml)
|
||||
- Prediction: pip (requirements.txt)
|
||||
- 코드 스타일: `.claude/rules/code-style.md`
|
||||
- 네이밍: `.claude/rules/naming.md`
|
||||
- 테스트: `.claude/rules/testing.md`
|
||||
- Git 워크플로우: `.claude/rules/git-workflow.md`
|
||||
- 팀 정책: `.claude/rules/team-policy.md`
|
||||
- 릴리즈 노트 가이드: `.claude/rules/release-notes-guide.md`
|
||||
- 서브에이전트 정책: `.claude/rules/subagent-policy.md`
|
||||
|
||||
불러오는 중...
Reference in New Issue
Block a user