# web - IOP Web Portal `apps/web`은 IOP 전체 Web Portal을 위한 Next.js 스캐폴드다. 현재는 root dummy 화면만 제공하며, `/nodes`, `/models`, `/jobs` 같은 도메인 페이지는 아직 만들지 않는다. Control Plane과의 주요 통신은 edge-node에서 사용 중인 protobuf-socket을 IOP Wire Protocol 기준으로 확장한다. 현재 `src/lib/iop-client/`에는 TypeScript 클라이언트 연결 위치와 TODO만 둔다. 브라우저 직접 WebSocket transport가 확정되기 전까지는 Next.js server-side bridge가 필요할 수 있다. ## Local 웹 개발과 테스트는 기본적으로 호스트 환경에서 수행한다. Docker는 컨테이너 패키징과 compose 통합 확인이 필요할 때 사용한다. 필요한 런타임: - Node.js `>=20.9.0` - npm `>=10` - Go toolchain 루트에서 Control Plane을 먼저 실행한다. ```bash go run ./apps/control-plane/cmd/control-plane serve --config configs/control-plane.yaml ``` 다른 터미널에서 Web Portal을 실행한다. ```bash npm ci --prefix apps/web ./bin/web.sh ``` 기본 호스트 endpoint는 코드 기본값과 `configs/control-plane.yaml` 기준을 따른다. ```bash CONTROL_PLANE_INTERNAL_HTTP_URL=http://localhost:9080 NEXT_PUBLIC_CONTROL_PLANE_HTTP_URL=http://localhost:9080 NEXT_PUBLIC_CONTROL_PLANE_WIRE_URL=tcp://localhost:19080 ``` 호스트 검증은 다음 명령을 기준으로 한다. ```bash cd apps/web npm run verify ``` 현재 `npm run verify`는 TypeScript check와 production build를 수행한다. Next.js 16 기준 lint는 `next lint`가 아니라 ESLint CLI(`eslint .`)를 사용한다. 아직 이 앱에는 ESLint 의존성, 설정 파일, `lint` script가 없으므로 lint는 필수 검증에 포함하지 않는다. lint를 도입할 때는 다음 기준을 따른다. - `eslint`, `eslint-config-next`와 flat config(`eslint.config.*`)를 함께 추가한다. - `package.json`에는 `"lint": "eslint ."`를 추가한다. - `verify`는 `npm run check && npm run lint && npm run build` 순서로 갱신한다. production standalone 실행을 확인할 때는 먼저 build를 만든 뒤 실행한다. ```bash cd apps/web npm run build PORT=3000 HOSTNAME=0.0.0.0 npm run start ``` ## Docker Docker는 compose 기반 통합 확인이 필요할 때 루트에서 실행한다. ```bash docker compose up --build ```