원클릭으로
fullstack-mirror-arch
풀스택 미러 아키텍처 규칙. BE↔FE 1:1 타입 동기화, 레이어 의존 규칙, barrel re-export, API 클라이언트 패턴, 상태관리 분리 규칙을 적용. 풀스택 프로젝트 설계 시 사용.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
풀스택 미러 아키텍처 규칙. BE↔FE 1:1 타입 동기화, 레이어 의존 규칙, barrel re-export, API 클라이언트 패턴, 상태관리 분리 규칙을 적용. 풀스택 프로젝트 설계 시 사용.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | fullstack-mirror-arch |
| description | 풀스택 미러 아키텍처 규칙. BE↔FE 1:1 타입 동기화, 레이어 의존 규칙, barrel re-export, API 클라이언트 패턴, 상태관리 분리 규칙을 적용. 풀스택 프로젝트 설계 시 사용. |
백엔드와 프론트엔드 간 1:1 미러 구조를 유지하기 위한 규칙과 패턴. 기술 스택과 무관한 개념 규칙을 정의하고, 구현 예시는 참고용으로 표기한다.
BE: models/{domain} ↔ FE: types/{domain} (타입/모델 정의)
BE: api/{domain}/router ↔ FE: lib/api/{domain} (API 엔드포인트)
BE: services/{domain} ↔ (FE에서 직접 대응 없음) (비즈니스 로직)
| BE (FastAPI/Pydantic) | FE (Next.js/TypeScript) |
|---|---|
models/session.py | types/session.ts |
api/session/router.py | lib/api/session.ts |
models/schemas.py (barrel) | types/index.ts (barrel) |
Django:
serializers/{domain}.py, Express:models/{domain}.ts, Spring:dto/{domain}.java등으로 대체 가능
BE barrel:
models/schemas.py → 모든 도메인 모델 re-export + __all__
FE barrel:
types/index.ts → 모든 도메인 타입 re-export
lib/api/endpoints.ts → 모든 API 클라이언트 re-export
// types/index.ts
export * from './common';
export * from './session';
export * from './upload';
export * from './labeling';
# models/schemas.py
from .common import *
from .session import *
from .upload import *
from .labeling import *
| 스택 | 구현 방법 |
|---|---|
| Pydantic (Python) | CamelModel 기반 클래스 + alias_generator=to_camel |
| Django REST | CamelCaseJSONRenderer / djangorestframework-camel-case |
| Spring (Java) | @JsonNaming(PropertyNamingStrategies.LowerCamelCaseStrategy.class) |
| Express (Node) | 미들웨어에서 camelCase ↔ snake_case 변환 |
| Go | json:"fieldName" 태그 |
api/ (라우터/컨트롤러)
↓ 의존
services/ (비즈니스 로직)
↓ 의존
models/ (도메인 모델/스키마)
↓ 의존
core/ (설정, DB 클라이언트, 인증)
main 파일에서 라우터 등록 순서를 명시적으로 관리| 스택 | api/ | services/ | models/ | core/ |
|---|---|---|---|---|
| FastAPI | APIRouter | 서비스 클래스/함수 | Pydantic Model | BaseSettings |
| Express | Router | 서비스 모듈 | Mongoose/Prisma | config.ts |
| Django | views.py | services.py | models.py | settings.py |
| Spring | @Controller | @Service | @Entity/DTO | @Configuration |
types/ (순수 타입, 의존 없음)
↑ 의존
lib/ (API, 스토어, 훅, 유틸)
↑ 의존
components/ (UI 컴포넌트)
↑ 의존
app/ (라우트/페이지 엔트리)
ui/: 도메인 무관 공용 프리미티브 (Button, Modal, Toast 등)domain/: 도메인 특화 재사용 뷰layout/: 앱 셸 (사이드바, 탑바, 네비게이션)providers/: 컨텍스트 래퍼 (Auth, Theme 등)@/lib/api/session (상대경로 지양)lib/api/
├── auth-fetch.ts (또는 http-client.ts) ← 인증 래퍼
├── {domain-1}.ts ← 도메인별 API
├── {domain-2}.ts
└── endpoints.ts ← barrel re-export
// lib/api/auth-fetch.ts (개념)
export async function authFetch(url: string, options?: RequestInit) {
const token = await getAccessToken(); // 프레임워크별 방법
return fetch(url, {
...options,
headers: { ...options?.headers, Authorization: `Bearer ${token}` },
});
}
axios interceptor, ky hooks, ofetch onRequest 등으로도 구현 가능
| 스토어 | 역할 |
|---|---|
ui-store | 사이드바, 모달, 토스트, 로딩 상태 |
auth-store | 현재 사용자, 인증 상태 |
{domain}-store | 도메인별 데이터 및 상태 |
| 스택 | 구현 방법 |
|---|---|
| Zustand | create<State>() 패턴, 도메인별 파일 분리 |
| Redux Toolkit | createSlice(), 도메인별 slice 분리 |
| Pinia (Vue) | defineStore(), 도메인별 store 분리 |
| Svelte Store | writable(), 도메인별 파일 분리 |
코드 변경 시 아래 항목을 확인한다:
Source-grounded research workflow for NotebookLM URLs, notebook-backed documentation queries, and MCP-driven follow-up analysis. Use when a task includes a NotebookLM URL, asks to query notebook contents, register a notebook, or persist grounded notes before implementation.
Subagent-style consistency check for GameLab code facts, docs/status facts, and local CLAUDE.md rule chains before deciding what to update.
Collect GameLab implementation patterns through subagent-style exploration before adding routes, domain modules, or data-contract changes.
새 분석 엔진 등록 — new engine, 엔진 추가, analysis engine, 분석 엔진, 알고리즘 추가
단축키 추가/변경/삭제 시 5개 파일 동기화 — hotkey add, hotkey change, 단축키 추가, 핫키 변경, 키바인딩
새 UI 문자열 ko/en 동시 추가 — i18n, 번역, translation, 다국어, string add, 문자열 추가