Skip to content

chore: 어드민 Vinext 배포 설정 보강#535

Open
manNomi wants to merge 1 commit into
mainfrom
fix/admin-vinext-setup
Open

chore: 어드민 Vinext 배포 설정 보강#535
manNomi wants to merge 1 commit into
mainfrom
fix/admin-vinext-setup

Conversation

@manNomi
Copy link
Copy Markdown
Contributor

@manNomi manNomi commented May 29, 2026

관련 이슈

  • resolves: 없음

작업 내용

  • apps/admin의 Vinext production start/preview가 .vercel/output 산출물을 직접 실행하도록 srvx 기반 스크립트를 추가했습니다.
  • VITE_API_SERVER_URL 누락 시 SSR import 단계에서 500이 나지 않도록 admin API client의 환경변수 검증 시점을 요청 시점으로 늦췄습니다.
  • 로그인 실패 toast가 환경변수 누락 등 일반 Error 메시지도 보여줄 수 있게 보강했습니다.
  • Vinext 설정과 충돌하지 않는 admin 전용 vitest.config.ts를 추가하고, 테스트 파일이 없는 현재 상태에서도 test script가 성공하도록 정리했습니다.
  • .env.exampleVINEXT_MIGRATION_REPORT.md에 Vercel 설정, SSR 범위, full data SSR 전환 조건을 문서화했습니다.

검증

  • pnpm --filter @solid-connect/admin lint:check
  • pnpm --filter @solid-connect/admin typecheck
  • pnpm --filter @solid-connect/admin test
  • pnpm --filter @solid-connect/admin build
  • pnpm --filter @solid-connect/admin start/, /login, /auth/login, /scores, /mentor-applications, /regions-countries, /bruno, /chat-socket, CSS asset 200 확인
  • commit/push hook에서 @solid-connect/web ci:check, @solid-connect/web build, @solid-connect/admin ci:check, @solid-connect/admin build 통과

특이 사항

  • Vercel Project Settings에서 Root Directory는 apps/admin, Build Command는 pnpm build, Output Directory는 비워두는 구성을 전제로 합니다. .vercel/output은 Vercel Build Output API 경로라 별도 Output Directory로 지정하지 않습니다.
  • 현재 admin은 localStorage 기반 인증을 유지하므로 보호 페이지는 route shell SSR 후 브라우저에서 인증 데이터 요청을 수행합니다. 사용자별 보호 데이터까지 서버에서 채우는 full data SSR은 httpOnly cookie 세션 전환과 함께 별도 PR로 분리하는 것이 안전합니다.

리뷰 요구사항 (선택)

  • Vercel 배포 설정 안내와 production preview 스크립트가 실제 운영 흐름에 충분한지 확인 부탁드립니다.
  • VITE_API_SERVER_URL 누락 시 SSR import는 성공하고 실제 API 요청에서 명확한 오류가 발생하는 방향이 의도에 맞는지 확인 부탁드립니다.

@manNomi manNomi requested review from enunsnv and wibaek as code owners May 29, 2026 06:59
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
solid-connect-web-admin Ready Ready Preview, Comment May 29, 2026 6:59am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
solid-connection-web Skipped Skipped May 29, 2026 6:59am

@github-actions github-actions Bot added the admin label May 29, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Review Change Stack

Walkthrough

이 변경은 API 서버 URL 검증 시점 개선, 빌드/프리뷰 환경 설정, 문서화 정비를 포함합니다.

  1. API 검증 방식 변경: 환경 변수 누락 시 모듈 로드 단계에서 즉시 에러를 던지던 방식을 개선하여, 실제 API 요청 시점에 검증하도록 옮겼습니다. 이를 통해 SSR 빌드 단계에서 불필요한 에러를 방지합니다.

  2. 환경 변수 및 예제 정리: .env.example에 새로운 이미지 CDN URL 변수(VITE_UPLOADED_IMAGE_URL)를 추가하고, API 서버 URL의 필수 여부와 SSR 동작 조건을 명확히 하는 주석을 추가했습니다.

  3. 프리뷰 스크립트 추가: start 스크립트를 pnpm run preview로 변경하고, Vercel 빌드 산출물(.vercel/output)을 srvx로 프로덕션 모드 실행하는 preview 스크립트를 새로 추가했습니다.

  4. 테스트 설정 추가: Vitest 설정 파일을 추가하여 경로 별칭(@) 매핑과 jsdom 환경을 정의했습니다.

  5. 문서 업데이트: 마이그레이션 보고서를 갱신하여 Vercel 중심 빌드 프로세스, 현재 SSR 상태(route shell + client-side 인증 기반), 그리고 API 서버 URL 누락 시 동작 방식을 명시화했습니다.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • wibaek
  • enunsnv
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 주요 변경 사항을 명확하게 요약하고 있습니다. 'Vinext 배포 설정 보강'은 이 PR의 핵심 목표인 프로덕션 배포 환경 설정 개선을 잘 드러냅니다.
Description check ✅ Passed PR 설명이 템플릿의 모든 필수 섹션을 포함하고 있으며, 작업 내용, 검증 절차, 특이사항, 리뷰 요구사항을 상세히 기술하고 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/admin-vinext-setup

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@manNomi
Copy link
Copy Markdown
Contributor Author

manNomi commented May 29, 2026

@codex review

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/admin/package.json`:
- Line 9: The preview script in package.json uses $PWD which is shell-dependent
and can break across platforms; update the "preview" script (the preview entry
in package.json) to avoid $PWD by passing relative paths (e.g.
.vercel/output/static and .vercel/output/functions/__server.func/index.mjs) or
switch to a Node-based resolution approach (resolve with path.join in a small
Node launcher script) so the command no longer relies on shell-specific $PWD
expansion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d73db4e3-00d3-415c-aabb-89fe5d9a2d5a

📥 Commits

Reviewing files that changed from the base of the PR and between 63e5a9a and 5c91a6b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • apps/admin/.env.example
  • apps/admin/VINEXT_MIGRATION_REPORT.md
  • apps/admin/package.json
  • apps/admin/src/components/features/auth/AdminLoginPage.tsx
  • apps/admin/src/lib/api/auth.ts
  • apps/admin/src/lib/api/client.ts
  • apps/admin/src/lib/env.ts
  • apps/admin/vitest.config.ts

Comment thread apps/admin/package.json
"start": "vinext start -p 4000",
"test": "vitest run",
"start": "pnpm run preview",
"preview": "srvx --prod --host 0.0.0.0 --port 4000 --static \"$PWD/.vercel/output/static\" \"$PWD/.vercel/output/functions/__server.func/index.mjs\"",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

1) preview 스크립트의 경로 지정은 셸 의존성을 줄이는 쪽이 안전합니다.

Line 9의 $PWD는 실행 셸/플랫폼에 따라 깨질 수 있어서, 상대경로(.vercel/output/...)로 바로 넘기거나 Node 기반 경로 해석으로 통일하는 편이 더 안정적입니다.

변경 예시
- "preview": "srvx --prod --host 0.0.0.0 --port 4000 --static \"$PWD/.vercel/output/static\" \"$PWD/.vercel/output/functions/__server.func/index.mjs\"",
+ "preview": "srvx --prod --host 0.0.0.0 --port 4000 --static .vercel/output/static .vercel/output/functions/__server.func/index.mjs",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"preview": "srvx --prod --host 0.0.0.0 --port 4000 --static \"$PWD/.vercel/output/static\" \"$PWD/.vercel/output/functions/__server.func/index.mjs\"",
"preview": "srvx --prod --host 0.0.0.0 --port 4000 --static .vercel/output/static .vercel/output/functions/__server.func/index.mjs",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/admin/package.json` at line 9, The preview script in package.json uses
$PWD which is shell-dependent and can break across platforms; update the
"preview" script (the preview entry in package.json) to avoid $PWD by passing
relative paths (e.g. .vercel/output/static and
.vercel/output/functions/__server.func/index.mjs) or switch to a Node-based
resolution approach (resolve with path.join in a small Node launcher script) so
the command no longer relies on shell-specific $PWD expansion.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant