Phase 1: 모노레포 디렉토리 구조 구축 - 기존 React 프로젝트를 frontend/ 디렉토리로 이동 (git mv) - backend/ 디렉토리 생성 (Phase 2에서 Spring Boot 초기화) - database/migration/ 디렉토리 생성 (Phase 2에서 Flyway 마이그레이션) - 루트 .gitignore에 frontend/, backend/ 경로 반영 - 루트 CLAUDE.md를 모노레포 가이드로 갱신 - Makefile 추가 (dev/build/lint 통합 명령) - frontend/vite.config.ts에 /api → :8080 백엔드 proxy 설정 - .githooks/pre-commit을 모노레포 구조에 맞게 갱신 (frontend/ 변경 시 frontend/ 내부에서 검증) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
77 lines
2.5 KiB
Markdown
77 lines
2.5 KiB
Markdown
# KCG AI Monitoring (모노레포)
|
|
|
|
해양경찰청 AI 기반 불법어선 탐지 및 단속 지원 플랫폼
|
|
|
|
## 모노레포 구조
|
|
|
|
```
|
|
kcg-ai-monitoring/
|
|
├── frontend/ # React 19 + TypeScript + Vite (UI)
|
|
├── backend/ # Spring Boot 3.x + Java 21 (자체 인증/권한/감사 + 분석 프록시)
|
|
├── database/ # PostgreSQL 마이그레이션 (Flyway)
|
|
│ └── migration/
|
|
├── docs/ # 프로젝트 문서 (SFR, 아키텍처)
|
|
├── .claude/ # Claude Code 워크플로우
|
|
├── .githooks/ # Git hooks (commit-msg, pre-commit, post-checkout)
|
|
└── Makefile # 통합 dev/build 명령
|
|
```
|
|
|
|
## 시스템 구성
|
|
|
|
```
|
|
[Frontend Vite :5173] ──→ [Backend Spring :8080] ──┬→ [Iran Backend :8080] (분석 데이터 read)
|
|
│ └→ [Prediction FastAPI :8001]
|
|
└→ [PostgreSQL kcgaidb] (자체 인증/권한/감사/의사결정)
|
|
```
|
|
|
|
- **자체 백엔드**: 인증/권한/감사로그/관리자 + 운영자 의사결정 (확정/제외/학습)
|
|
- **iran 백엔드 프록시**: 분석 결과 read-only 참조 (vessel_analysis, group_polygons, correlations)
|
|
- **신규 DB (kcgaidb)**: 자체 생산 데이터만 저장, prediction 분석 테이블은 미복사
|
|
|
|
## 명령어
|
|
|
|
```bash
|
|
make install # 의존성 설치
|
|
make dev # 프론트 + 백엔드 동시 실행
|
|
make dev-frontend # 프론트만
|
|
make dev-backend # 백엔드만
|
|
make build # 전체 빌드
|
|
make lint # 프론트 lint
|
|
make format # 프론트 prettier
|
|
```
|
|
|
|
## 기술 스택
|
|
|
|
### Frontend (`frontend/`)
|
|
- React 19, TypeScript 5.9, Vite 8
|
|
- Tailwind CSS 4 + CVA
|
|
- MapLibre GL 5 + deck.gl 9 (지도)
|
|
- ECharts 6 (차트)
|
|
- Zustand 5 (상태관리)
|
|
- i18next (ko/en)
|
|
- React Router 7
|
|
- ESLint 10 + Prettier
|
|
|
|
### Backend (`backend/`) — Phase 2에서 초기화
|
|
- Spring Boot 3.x + Java 21
|
|
- Spring Security + JWT
|
|
- PostgreSQL + Flyway
|
|
- Caffeine (권한 캐싱)
|
|
- 트리 기반 RBAC (wing 패턴)
|
|
|
|
### Database (`kcgaidb`)
|
|
- PostgreSQL
|
|
- 사용자: `kcg-app`
|
|
- 스키마: `kcg`
|
|
|
|
## 권한 체계
|
|
|
|
좌측 탭(메뉴) = 권한 그룹, 내부 패널/액션 = 자식 자원, CRUD 단위 개별 제어.
|
|
상세는 `.claude/plans/vast-tinkering-knuth.md` 참조.
|
|
|
|
## 팀 컨벤션
|
|
|
|
- 팀 규칙: `.claude/rules/`
|
|
- 커밋: Conventional Commits (한국어), `.githooks/commit-msg` 검증
|
|
- pre-commit: `frontend/` 디렉토리 기준 TypeScript + ESLint 검증
|