Skip to content

feat(site): support PUBLIC_API_BASE_URL for Vercel develop previews - #196

Merged
Seungpyo1007 merged 1 commit into
developfrom
feat/vercel-preview-api-base
Sep 22, 2026
Merged

Seungpyo1007 merged 1 commit into
developfrom
feat/vercel-preview-api-base

Conversation

@Seungpyo1007

@Seungpyo1007 Seungpyo1007 commented Sep 22, 2026

Copy link
Copy Markdown
Member

Refs #1

develop을 Vercel에 연결해 프리뷰 배포를 할 때, develop 자체의 덤프를 새로 만들지 않고 main의 실제 운영 데이터를 그대로 읽어서 "코드는 develop, 데이터는 main"인 프리뷰를 띄울 수 있게 하는 최소 변경.

변경

  • site/astro.config.mjs: Vercel(process.env.VERCEL)에서는 base: '/', 그 외(GitHub Pages)는 기존대로 /TechAPI.
  • site/src/scripts/techapi.js, site/src/pages/docs.astro, site/src/pages/index.astro: 데이터 fetch/링크 URL이 PUBLIC_API_BASE_URL 환경변수를 우선 사용(없으면 기존 BASE_URL 그대로) — 사이트 내비게이션/에셋 경로는 그대로 base 유지.

검증

  • 기본 빌드(npm run build, 환경변수 없음): 기존과 동일하게 /TechAPI/... 경로 생성 확인.
  • VERCEL=1 PUBLIC_API_BASE_URL=https://gettechapi.github.io/TechAPI/ npx astro build: nav/에셋은 /(루트) 경로, 데이터 fetch·OpenAPI 문서 URL·엔드포인트 링크는 모두 https://gettechapi.github.io/TechAPI/...로 정확히 렌더링됨을 빌드 산출물에서 직접 확인.

남은 것 (계정 필요, 별도)

Vercel 프로젝트 생성·GitHub 연결·Root Directory를 site로 지정·Preview 환경변수에 PUBLIC_API_BASE_URL=https://gettechapi.github.io/TechAPI/ 추가는 Vercel 계정 소유자가 직접 해야 함.

Closes #19

Lets a preview build serve develop's UI while reading main's live
public dump instead of regenerating its own — no code needed beyond
setting the env var on the preview deployment.
@Seungpyo1007 Seungpyo1007 added enhancement New feature or request site Homepage and public site changes labels Sep 22, 2026
@Seungpyo1007 Seungpyo1007 moved this from Todo to In Progress in TechAPI-Project Sep 22, 2026
@TechEngineBot

Copy link
Copy Markdown
Member

TechEngine change review: PASS

Check Result
python -m app.validate PASS
python integrity_check.py TechAPI/data --strict PASS
cd TechAPI/site && npm ci && npm run build PASS

Changed data

Category Added Modified Deleted Added verified Added unverified Added Kaggle-sourced
brand 0 0 0 0 0 0
soc 0 0 0 0 0 0
smartphone 0 0 0 0 0 0
tablet 0 0 0 0 0 0
watch 0 0 0 0 0 0
pda 0 0 0 0 0 0
gpu 0 0 0 0 0 0
cpu 0 0 0 0 0 0

Changed record examples

  • No data file changes detected.

Heuristic review

  • Heuristic warnings: none found.

Changed site

Area Added Modified Deleted
homepage/site 0 4 0

Modified site files

  • site/astro.config.mjs
  • site/src/pages/docs.astro
  • site/src/pages/index.astro
  • site/src/scripts/techapi.js

@TechEngineBot

Copy link
Copy Markdown
Member

TechEngine validation stats: PASS

Data summary

Category Total Verified Unverified Missing verified Tracked Verified % of tracked
brand 207 24 183 0 207 11.6%
soc 2104 146 1958 0 2104 6.9%
smartphone 93396 17384 76012 0 93396 18.6%
tablet 3455 218 3237 0 3455 6.3%
watch 433 18 415 0 433 4.2%
pda 140 66 74 0 140 47.1%
gpu 2030 809 1221 0 2030 39.9%
cpu 3993 2724 1269 0 3993 68.2%
all 105758 21389 84369 0 105758 20.2%

Warning

Tracked verified coverage is below 50% for watch 4.2% (18/433), tablet 6.3% (218/3455), soc 6.9% (146/2104), brand 11.6% (24/207), smartphone 18.6% (17384/93396), all 20.2% (21389/105758), gpu 39.9% (809/2030), pda 47.1% (66/140).
Tracked coverage excludes records missing the verified field; see the Missing verified column for those records.
This does not fail validation. Keep imported records verified: false until manual audit, but treat this as follow-up verification work before relying on the affected categories as curated data.

Validation notes

  • Full advisory outlier listings are suppressed on successful runs because they are dataset-wide and mostly stable between PRs.
  • Failure runs still include a detailed log excerpt for debugging.

Key output:

## app.validate
## integrity_check.py --strict
loaded CPU=3993 GPU=2030
✅ integrity gate: no hard anomalies.
Integrity section Flagged lines
structural 0
CPU name/tier consistency (desktop mainstream only) 0
CPU single>multi (cinebench/geekbench — should be multi>=single) 0
CPU era-vs-score outliers 8
CPU cross-source ratio outliers (possible wrong-variant) 155
GPU cross-source ratio outliers + sanity 18

Homepage build:

03:53:21 [build] 2 page(s) built in 74.32s
03:53:21 [build] Complete!

@Seungpyo1007
Seungpyo1007 merged commit b26a10e into develop Sep 22, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in TechAPI-Project Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request site Homepage and public site changes

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Track homepage and site improvements

2 participants