구조: 사장님(solution)과 내부 운영(admin)을 두 앱으로 가른다

최상단을 프로젝트 단위로 평평하게 둔다 — o2o-negosium 과 같은 규약이고, 이 레포만
다르게 갈 이유가 없다. negodata/{backend,front} 가 프로젝트 안에서 f/b 를 가르는 선례,
lps-admin/ 이 백엔드 없이 프론트만 가진 최상단 폴더의 선례다.

  backend/ frontend/{admin,site,shared}  →  solution/{backend,front,site,shared} + admin/

## 왜

내부 라우트(/local-content, /places/:id/seo)의 이름과 화면 코드가 사장님 번들에
그대로 실려 나가고 있었다. UserRole.DEVELOPER 주석의 "고객사에 존재를 노출하지 않는다"를
번들이 깨고 있었다 — 라우트 가드는 화면을 가리지 번들은 못 가린다.
번들을 갈라 확인했다: 사장님 dist 에서 local-content · /places · SeoAudit 이 전부 0건이다.

그 과정에서 두 곳이 더 새고 있었다.
- AppShell 의 NAV 배열이 내부 메뉴를 하드코딩하고 있었다. 앱을 가른 뒤에도 dist 에
  local-content 가 남아서 찾았다. 메뉴는 이제 앱이 prop 으로 들고 온다.
- EditorHeader·BuilderPage·LoginPage 가 /places 로 링크하고 있었다. 그 화면이 admin 으로
  나갔으니 사장님 앱에서는 404 다. 링크를 걷어내고 LoginPage 기본 도착지는 '/' 로 바꿨다
  (앱마다 홈이 다르고 각 라우터의 '/' 가 이미 그걸 안다).

## admin 에 백엔드를 두지 않았다

내부 화면이 부르는 훅이 전부 router/v1/{place,fact,local,validator} 에 이미 있다.
자체 백엔드를 두면 place·fact·link 를 같은 DB 에 대고 두 번 구현하게 된다.
대가는 solution/backend 가 죽으면 admin 도 멈추는 것 — 내부 도구라 감수한다.

## admin 의 `@` 는 solution/front/src 를 가리킨다

내부 화면이 쓰는 API 클라이언트·UI·수집 배선이 solution 에 한 벌만 있고 그 파일들끼리도
`@/...` 로 서로를 부른다. admin 에서 `@` 를 자기 src 로 잡으면 그 참조가 전부 깨진다
(실측 TS2307 14건). 복제하는 길도 있지만 RecollectPanel 주석이 금지한다 —
"수집 경로를 두 벌 만들면 확정 게이트"가 갈라진다.
admin 자기 파일만 `@admin` 이고, 의존 방향은 admin → solution 한 쪽뿐이다.

admin 이 여는 빌더는 다른 오리진이라 절대 URL + 새 탭이다(admin/src/lib/solutionUrl.ts).
react-router Link 로 두면 admin 안에서 라우트를 찾다 404 다.

## 그 밖

- npm 워크스페이스 루트를 레포 루트로 올렸다(admin 이 solution 밖이라).
- docker-compose 를 255→174줄로 줄이고 admin(:3002) 서비스를 넣었다. ADMIN_BIND 기본값은
  127.0.0.1 — 0.0.0.0 으로 열면 앱을 가른 의미가 없다.
- 발행 호스트를 프론트 .env 에 따로 적지 않는다. compose 가 루트의 SITE_PUBLIC_HOST 를
  VITE_PUBLISH_HOST 로 흘려보낸다 — 두 곳에 적으면 canonical 과 화면 주소가 조용히 갈라진다.
- nginx/site.conf 를 git 에서 빼고 .example 만 남겼다(.env·*.toml 과 같은 규약).
  compose 가 bind mount 하므로 클론 직후 복사해야 한다 — 없으면 Docker 가 그 자리에
  디렉토리를 만들어 nginx 가 설정 없이 뜬다.
- config.test.toml.example 을 추가했다. 없으면 클론한 사람이 pytest 를 아예 못 돌린다
  (conftest import 단계에서 죽는다). 외부 API 키는 전부 빈값이다 —
  APP_ENV=test 가 .env 를 안 읽는 이유를 여기서 우회하면 안 된다.
- 경로가 한 칸 깊어져 test_schema_ddl(parents[2]→[3]) 과 test_site_theme 을 고쳤다.

검증: front·admin·site 전부 lint 0 / build 0. 백엔드 514 passed.
남은 4건(test_build_publish 3 · test_snapshot 1)은 이 변경 전부터 실패하던 것으로,
손대지 않은 메인 체크아웃에서 같은 4건이 같게 실패하는 것을 확인했다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019uYhHQdssRubirPirrdJJC
This commit is contained in:
minaChoiandClaude Opus 5 committed 2026-08-31 15:12:09 +09:00
1 parent 139d460839
commit 9d25ed613e
714 files changed
+782 -440

No files matched your search

+75
View File
@@ -0,0 +1,75 @@
/*
* 두 앱(admin / site)이 공유하는 최소 기본 스타일.
* 폰트 로딩 · 스크롤바 · 접근성 유틸만 둔다. 색은 각 앱의 토큰이 정한다.
*/
/* Pretendard 가변폰트 self-host (public/fonts). 한국어 본문 기본 서체.
파일이 없으면 @font-face 가 조용히 실패하고 다음 폴백으로 넘어간다 — 빌드는 깨지지 않는다. */
@font-face {
font-family: 'Pretendard Variable';
font-weight: 45 920;
font-style: normal;
font-display: swap;
src: url('/fonts/PretendardVariable.woff2') format('woff2');
}
html {
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
padding: 0;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
/* 한글은 단어 중간에서 끊기면 읽기 나빠진다. 어절 단위로 줄바꿈. */
word-break: keep-all;
overflow-wrap: break-word;
}
/* 가로 스냅 슬라이더용 — 스크롤바를 숨긴다. */
.no-scrollbar::-webkit-scrollbar {
display: none;
}
.no-scrollbar {
-ms-overflow-style: none;
scrollbar-width: none;
}
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: color-mix(in srgb, currentColor 18%, transparent);
border-radius: 9999px;
}
/* 스크린리더 전용 — 화면에서 감추되 접근성 트리에는 남긴다.
AI 크롤러도 이 텍스트를 읽는다(display:none 이면 안 읽는다). */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
}
/* 모션 민감 사용자 — 장식 애니메이션을 끈다. */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
+172
View File
@@ -0,0 +1,172 @@
/*
* Design Tokens (Tailwind v4) — o2o-web4ai 관리자(빌더).
*
* negodata 보일러플레이트의 토큰을 그대로 이식했다.
* 디자인 방향: "인디고 콘솔"(Linear 문법) — 조용한 무채 크롬 + 인디고(#5E6AD2) 액센트 한 곳.
*
* ★ 여기 색은 *관리자 화면*의 색이다. 발행되는 소상공인 사이트의 색이 아니다.
* 발행 사이트는 사장님이 고른 템플릿(SiteTheme.colors)이 CSS 변수로 주입된다 —
* `site/src/seo/head.ts` 의 themeStyle() 참고. 두 색 체계를 섞지 않는다.
*
* 다른 Tailwind v4 프로젝트에서 재사용하려면:
* 1) 이 파일을 복사하고
* 2) 엔트리 CSS에서 `@import "tailwindcss";` 다음에 `@import "./tokens.css";`
*
* 폰트: --font-sans 는 'Pretendard Variable'(self-host)를 참조한다.
* 폰트 파일이 없으면 'Noto Sans KR' → system-ui 로 폴백된다.
*/
@custom-variant dark (&:is(.dark *));
@theme {
--color-background: var(--background);
--color-background-rgb: var(--background-rgb);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-border: var(--border);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-accent: var(--accent);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-success: var(--success);
--color-warning: var(--warning);
--color-info: var(--info);
--color-ring: var(--ring);
--font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
/* 모노 폰트엔 한글 글리프가 없다 — Pretendard 를 넣어야 한글이 OS 기본(Windows 굴림)으로 떨어지지 않는다 */
--font-mono: "JetBrains Mono", Consolas, "Segoe UI Mono", ui-monospace, SFMono-Regular, "Menlo", "Pretendard Variable", "Noto Sans KR", monospace;
}
:root {
/* 뉴트럴은 인디고로 아주 살짝 기운 회색 계열. 캔버스는 거의 백색, 층은 헤어라인 보더로 만든다 */
--background: #fcfcfd;
--background-rgb: 252, 252, 253;
--foreground: #202433;
--card: #ffffff;
--card-foreground: #202433;
--border: #e9e9ef;
--muted: #f1f1f5;
--muted-foreground: #6c7086;
--primary: #18181b; /* 원본 프로토타입의 슬레이트 블랙. 흰 글자 대비 16:1 (AAA) */
--primary-foreground: #ffffff;
--secondary: #f1f1f5;
--secondary-foreground: #33384d;
--accent: #f4f4f5; /* 메뉴 hover·선택 표면 */
--destructive: #d92d20;
--destructive-foreground: #fafafa;
--success: #17b26a;
--warning: #f79009;
--info: #6172f3;
--ring: #18181b;
--popover: #ffffff;
--popover-foreground: #202433;
--accent-foreground: #18181b;
--input: #e4e4ec;
/* 차트 카테고리 팔레트 — 고정 순서(식별용), CVD·대비 검증 통과. features 차트와 같은 계열 */
--chart-1: #3b82f6;
--chart-2: #10b981;
--chart-3: #f59e0b;
--chart-4: #a855f7;
--chart-5: #f43f5e;
--radius: 0.5rem;
/* 사이드바 = 캔버스보다 반 단계 어두운 조용한 회색 면. 액센트는 활성 아이콘에만 */
--sidebar: #f7f7f9;
--sidebar-foreground: #5f6377;
--sidebar-primary: #18181b;
--sidebar-primary-foreground: #ffffff;
--sidebar-accent: #f4f4f5;
--sidebar-accent-foreground: #18181b;
--sidebar-border: #e9e9ef;
--sidebar-ring: #5e6ad2;
}
.dark {
--background: #141419;
--background-rgb: 20, 20, 25;
--foreground: #e6e6ee;
--card: #1b1b22;
--card-foreground: #e6e6ee;
--border: #ffffff14;
--muted: #24242d;
--muted-foreground: #9a9dae;
--primary: #fafafa; /* 다크는 반전 — 밝은 표면에 진한 글자. 원본과 같은 무채색 축 */
--primary-foreground: #16161d;
--secondary: #24242d;
--secondary-foreground: #e6e6ee;
--accent: #26262f;
--destructive: #f97066;
--destructive-foreground: #fafafa;
--success: #17b26a;
--warning: #f79009;
--info: #8b93e8;
--ring: #a1a1aa;
--popover: #1b1b22;
--popover-foreground: #e6e6ee;
--accent-foreground: #ffffff;
--input: #ffffff26;
/* 라이트와 같은 순서, 다크 표면 밝기 밴드에 맞춰 emerald·amber 만 한 단계 진하게 */
--chart-1: #3b82f6;
--chart-2: #059669;
--chart-3: #d97706;
--chart-4: #a855f7;
--chart-5: #f43f5e;
--sidebar: #18181f;
--sidebar-foreground: #9a9dae;
--sidebar-primary: #fafafa;
--sidebar-primary-foreground: #16161d;
--sidebar-accent: #26262f;
--sidebar-accent-foreground: #ffffff;
--sidebar-border: #ffffff12;
--sidebar-ring: #8b93e8;
}
@theme inline {
--font-heading: var(--font-sans);
--font-sans: 'Pretendard Variable', 'Noto Sans KR', system-ui, sans-serif;
--color-sidebar-ring: var(--sidebar-ring);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar: var(--sidebar);
--color-chart-5: var(--chart-5);
--color-chart-4: var(--chart-4);
--color-chart-3: var(--chart-3);
--color-chart-2: var(--chart-2);
--color-chart-1: var(--chart-1);
--color-ring: var(--ring);
--color-input: var(--input);
--color-border: var(--border);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-accent-foreground: var(--accent-foreground);
--color-accent: var(--accent);
--color-muted-foreground: var(--muted-foreground);
--color-muted: var(--muted);
--color-secondary-foreground: var(--secondary-foreground);
--color-secondary: var(--secondary);
--color-primary-foreground: var(--primary-foreground);
--color-primary: var(--primary);
--color-popover-foreground: var(--popover-foreground);
--color-popover: var(--popover);
--color-card-foreground: var(--card-foreground);
--color-card: var(--card);
--color-foreground: var(--foreground);
--color-background: var(--background);
--radius-sm: calc(var(--radius) * 0.6);
--radius-md: calc(var(--radius) * 0.8);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) * 1.4);
--radius-2xl: calc(var(--radius) * 1.8);
--radius-3xl: calc(var(--radius) * 2.2);
--radius-4xl: calc(var(--radius) * 2.6);
}