feat(auth): 랜딩 시작 분기와 앱 라우트 가드를 추가

This commit is contained in:
2026-03-10 13:30:09 +09:00
parent 1c55f74132
commit 92a509ebb6
7 changed files with 848 additions and 68 deletions

19
src/app/(app)/layout.tsx Normal file
View File

@@ -0,0 +1,19 @@
import type { ReactNode } from "react";
import { cookies } from "next/headers";
import { redirect } from "next/navigation";
import { TOKEN_COOKIE_KEY } from "@/features/auth/model/constants";
interface AppLayoutProps {
children: ReactNode;
}
export default async function AppLayout({ children }: AppLayoutProps) {
const cookieStore = await cookies();
const accessToken = cookieStore.get(TOKEN_COOKIE_KEY)?.value;
if (!accessToken) {
redirect("/login");
}
return children;
}

View File

@@ -1,7 +1,11 @@
import Link from "next/link"; import Link from "next/link";
import { copy } from '@/shared/i18n';
import { AuthRedirectButton } from "@/features/auth/components/AuthRedirectButton";
import { Button } from "@/shared/ui/Button"; import { Button } from "@/shared/ui/Button";
export default function MarketingPage() { export default function MarketingPage() {
const { landing } = copy;
return ( return (
<div className="min-h-screen bg-slate-50 text-brand-dark font-sans selection:bg-brand-soft/50"> <div className="min-h-screen bg-slate-50 text-brand-dark font-sans selection:bg-brand-soft/50">
@@ -9,14 +13,14 @@ export default function MarketingPage() {
<header className="sticky top-0 z-50 w-full border-b border-brand-dark/10 bg-slate-50/80 backdrop-blur-md"> <header className="sticky top-0 z-50 w-full border-b border-brand-dark/10 bg-slate-50/80 backdrop-blur-md">
<div className="container mx-auto px-6 h-16 flex items-center justify-between"> <div className="container mx-auto px-6 h-16 flex items-center justify-between">
<Link href="/" className="text-xl font-bold text-brand-dark tracking-tight flex items-center gap-2"> <Link href="/" className="text-xl font-bold text-brand-dark tracking-tight flex items-center gap-2">
<span className="text-2xl">🪴</span> VibeRoom <span className="text-2xl">🪴</span> {copy.appName}
</Link> </Link>
<nav className="hidden md:flex items-center gap-6 text-sm font-medium text-brand-dark/80"> <nav className="hidden md:flex items-center gap-6 text-sm font-medium text-brand-dark/80">
<Button variant="ghost" size="sm" href="#features"> </Button> <Button variant="ghost" size="sm" href="#features">{landing.nav.features}</Button>
<Button variant="ghost" size="sm" href="#pricing"></Button> <Button variant="ghost" size="sm" href="#pricing">{landing.nav.pricing}</Button>
<Button variant="ghost" size="sm" href="/login"></Button> <Button variant="ghost" size="sm" href="/login">{landing.nav.login}</Button>
<Button variant="primary" size="md" href="/space"> </Button> <AuthRedirectButton variant="primary" size="md">{landing.nav.startFree}</AuthRedirectButton>
</nav> </nav>
</div> </div>
</header> </header>
@@ -27,19 +31,18 @@ export default function MarketingPage() {
<div className="container mx-auto max-w-5xl flex flex-col md:flex-row items-center gap-16"> <div className="container mx-auto max-w-5xl flex flex-col md:flex-row items-center gap-16">
<div className="flex-1 text-center md:text-left"> <div className="flex-1 text-center md:text-left">
<h1 className="text-4xl md:text-5xl lg:text-6xl font-bold mb-6 tracking-tight leading-tight text-brand-dark"> <h1 className="text-4xl md:text-5xl lg:text-6xl font-bold mb-6 tracking-tight leading-tight text-brand-dark">
,<br /> {landing.hero.titleLead}<br />
<span className="text-brand-primary">VibeRoom</span> <span className="text-brand-primary">{landing.hero.titleAccent}</span>
</h1> </h1>
<p className="text-lg md:text-xl text-brand-dark/70 mb-10 max-w-xl mx-auto md:mx-0 leading-relaxed"> <p className="text-lg md:text-xl text-brand-dark/70 mb-10 max-w-xl mx-auto md:mx-0 leading-relaxed">
, . {landing.hero.description}
.
</p> </p>
<div className="flex flex-col sm:flex-row gap-4 justify-center md:justify-start"> <div className="flex flex-col sm:flex-row gap-4 justify-center md:justify-start">
<Button variant="primary" size="lg" href="/space"> <AuthRedirectButton variant="primary" size="lg">
{landing.hero.primaryCta}
</Button> </AuthRedirectButton>
<Button variant="outline" size="lg" href="#features"> <Button variant="outline" size="lg" href="#features">
{landing.hero.secondaryCta}
</Button> </Button>
</div> </div>
</div> </div>
@@ -64,7 +67,7 @@ export default function MarketingPage() {
</div> </div>
</div> </div>
<div className="mt-6 h-12 bg-brand-soft/20 rounded-xl border border-brand-primary/20 flex items-center justify-center text-brand-primary font-medium text-sm"> <div className="mt-6 h-12 bg-brand-soft/20 rounded-xl border border-brand-primary/20 flex items-center justify-center text-brand-primary font-medium text-sm">
45:00 {landing.hero.timerPreview}
</div> </div>
</div> </div>
</div> </div>
@@ -76,23 +79,19 @@ export default function MarketingPage() {
<section id="features" className="py-24 bg-white px-6"> <section id="features" className="py-24 bg-white px-6">
<div className="container mx-auto max-w-6xl"> <div className="container mx-auto max-w-6xl">
<div className="text-center max-w-2xl mx-auto mb-16"> <div className="text-center max-w-2xl mx-auto mb-16">
<h2 className="text-3xl md:text-4xl font-bold mb-4 text-brand-dark tracking-tight"> </h2> <h2 className="text-3xl md:text-4xl font-bold mb-4 text-brand-dark tracking-tight">{landing.features.title}</h2>
<p className="text-brand-dark/70 text-lg"> . .</p> <p className="text-brand-dark/70 text-lg">{landing.features.description}</p>
</div> </div>
<div className="grid grid-cols-1 md:grid-cols-3 gap-8"> <div className="grid grid-cols-1 md:grid-cols-3 gap-8">
{[ {landing.features.items.map((feature, idx) => (
{ icon: "⏳", title: "구조화된 세션 타이머", desc: "부담 없이 시작할 수 있는 짧은 몰입과 확실한 휴식. 당신만의 작업 리듬을 부드럽게 설정하고 관리하세요." },
{ icon: "🌱", title: "다정한 연대와 코워킹", desc: "화면 너머 누군가와 함께하는 바디 더블링 효과. 감시가 아닌, 조용하지만 강력한 동기를 서로 나누어보세요." },
{ icon: "🛋️", title: "나만의 심미적 공간", desc: "비 오는 다락방, 햇살 드는 카페. 백색소음과 함께 내가 가장 편안함을 느끼는 가상 공간을 꾸미고 머무르세요." }
].map((feature, idx) => (
<div key={idx} className="p-8 bg-brand-soft/10 rounded-2xl border border-brand-soft/30 transition-transform hover:-translate-y-1 duration-300 hover:shadow-md"> <div key={idx} className="p-8 bg-brand-soft/10 rounded-2xl border border-brand-soft/30 transition-transform hover:-translate-y-1 duration-300 hover:shadow-md">
<div className="w-14 h-14 bg-white text-brand-primary rounded-2xl flex items-center justify-center mb-6 text-2xl shadow-sm border border-brand-dark/5"> <div className="w-14 h-14 bg-white text-brand-primary rounded-2xl flex items-center justify-center mb-6 text-2xl shadow-sm border border-brand-dark/5">
{feature.icon} {feature.icon}
</div> </div>
<h3 className="text-xl font-bold text-brand-dark mb-3">{feature.title}</h3> <h3 className="text-xl font-bold text-brand-dark mb-3">{feature.title}</h3>
<p className="text-brand-dark/70 leading-relaxed"> <p className="text-brand-dark/70 leading-relaxed">
{feature.desc} {feature.description}
</p> </p>
</div> </div>
))} ))}
@@ -104,65 +103,64 @@ export default function MarketingPage() {
<section id="pricing" className="py-24 px-6 bg-slate-50"> <section id="pricing" className="py-24 px-6 bg-slate-50">
<div className="container mx-auto max-w-5xl"> <div className="container mx-auto max-w-5xl">
<div className="text-center max-w-2xl mx-auto mb-16"> <div className="text-center max-w-2xl mx-auto mb-16">
<h2 className="text-3xl md:text-4xl font-bold mb-4 text-brand-dark tracking-tight"> </h2> <h2 className="text-3xl md:text-4xl font-bold mb-4 text-brand-dark tracking-tight">{landing.pricing.title}</h2>
<p className="text-brand-dark/70 text-lg"> .</p> <p className="text-brand-dark/70 text-lg">{landing.pricing.description}</p>
</div> </div>
<div className="grid grid-cols-1 md:grid-cols-3 gap-8 items-center"> <div className="grid grid-cols-1 md:grid-cols-3 gap-8 items-center">
{/* Starter Plan */} {/* Starter Plan */}
<div className="p-8 bg-white rounded-3xl border border-brand-dark/10 shadow-sm"> <div className="p-8 bg-white rounded-3xl border border-brand-dark/10 shadow-sm">
<h3 className="text-xl font-bold text-brand-dark mb-2">Starter</h3> <h3 className="text-xl font-bold text-brand-dark mb-2">{landing.pricing.plans.starter.name}</h3>
<p className="text-brand-dark/60 text-sm mb-6 h-10"> </p> <p className="text-brand-dark/60 text-sm mb-6 h-10">{landing.pricing.plans.starter.subtitle}</p>
<div className="mb-8"> <div className="mb-8">
<span className="text-4xl font-bold text-brand-dark"></span> <span className="text-4xl font-bold text-brand-dark">{landing.pricing.plans.starter.price}</span>
</div> </div>
<ul className="space-y-4 mb-8 text-brand-dark/80 text-sm"> <ul className="space-y-4 mb-8 text-brand-dark/80 text-sm">
<li className="flex items-center gap-3"><span className="text-brand-primary"></span> </li> {landing.pricing.plans.starter.features.map((feature) => (
<li className="flex items-center gap-3"><span className="text-brand-primary"></span> 1:1 ( 3)</li> <li key={feature} className="flex items-center gap-3"><span className="text-brand-primary"></span>{feature}</li>
<li className="flex items-center gap-3"><span className="text-brand-primary"></span> </li> ))}
</ul> </ul>
<Button variant="secondary" size="full" href="/space"> <AuthRedirectButton variant="secondary" size="full">
{landing.pricing.plans.starter.cta}
</Button> </AuthRedirectButton>
</div> </div>
{/* Pro Plan */} {/* Pro Plan */}
<div className="p-8 bg-brand-dark rounded-3xl border border-brand-dark shadow-xl relative transform md:-translate-y-4"> <div className="p-8 bg-brand-dark rounded-3xl border border-brand-dark shadow-xl relative transform md:-translate-y-4">
<div className="absolute top-0 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-brand-primary text-white px-4 py-1 rounded-full text-xs font-bold tracking-wide"> <div className="absolute top-0 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-brand-primary text-white px-4 py-1 rounded-full text-xs font-bold tracking-wide">
{landing.pricing.plans.pro.badge}
</div> </div>
<h3 className="text-xl font-bold text-white mb-2">Pro</h3> <h3 className="text-xl font-bold text-white mb-2">{landing.pricing.plans.pro.name}</h3>
<p className="text-white/60 text-sm mb-6 h-10"> </p> <p className="text-white/60 text-sm mb-6 h-10">{landing.pricing.plans.pro.subtitle}</p>
<div className="mb-8 flex items-baseline gap-1"> <div className="mb-8 flex items-baseline gap-1">
<span className="text-4xl font-bold text-white">6,900</span> <span className="text-4xl font-bold text-white">{landing.pricing.plans.pro.price}</span>
<span className="text-white/60">/</span> <span className="text-white/60">{landing.pricing.plans.pro.priceSuffix}</span>
</div> </div>
<ul className="space-y-4 mb-8 text-white/90 text-sm"> <ul className="space-y-4 mb-8 text-white/90 text-sm">
<li className="flex items-center gap-3"><span className="text-brand-soft"></span> </li> {landing.pricing.plans.pro.features.map((feature) => (
<li className="flex items-center gap-3"><span className="text-brand-soft"></span> 1:1 </li> <li key={feature} className="flex items-center gap-3"><span className="text-brand-soft"></span>{feature}</li>
<li className="flex items-center gap-3"><span className="text-brand-soft"></span> </li> ))}
<li className="flex items-center gap-3"><span className="text-brand-soft"></span> </li>
</ul> </ul>
<Button variant="primary" size="full" href="/space"> <AuthRedirectButton variant="primary" size="full">
Pro {landing.pricing.plans.pro.cta}
</Button> </AuthRedirectButton>
</div> </div>
{/* Teams Plan */} {/* Teams Plan */}
<div className="p-8 bg-white rounded-3xl border border-brand-dark/10 shadow-sm"> <div className="p-8 bg-white rounded-3xl border border-brand-dark/10 shadow-sm">
<h3 className="text-xl font-bold text-brand-dark mb-2">Teams</h3> <h3 className="text-xl font-bold text-brand-dark mb-2">{landing.pricing.plans.teams.name}</h3>
<p className="text-brand-dark/60 text-sm mb-6 h-10"> </p> <p className="text-brand-dark/60 text-sm mb-6 h-10">{landing.pricing.plans.teams.subtitle}</p>
<div className="mb-8 flex items-baseline gap-1"> <div className="mb-8 flex items-baseline gap-1">
<span className="text-4xl font-bold text-brand-dark">12,000</span> <span className="text-4xl font-bold text-brand-dark">{landing.pricing.plans.teams.price}</span>
<span className="text-brand-dark/60 text-sm">/·</span> <span className="text-brand-dark/60 text-sm">{landing.pricing.plans.teams.priceSuffix}</span>
</div> </div>
<ul className="space-y-4 mb-8 text-brand-dark/80 text-sm"> <ul className="space-y-4 mb-8 text-brand-dark/80 text-sm">
<li className="flex items-center gap-3"><span className="text-brand-primary"></span> Pro </li> {landing.pricing.plans.teams.features.map((feature) => (
<li className="flex items-center gap-3"><span className="text-brand-primary"></span> </li> <li key={feature} className="flex items-center gap-3"><span className="text-brand-primary"></span>{feature}</li>
<li className="flex items-center gap-3"><span className="text-brand-primary"></span> </li> ))}
</ul> </ul>
<Button variant="secondary" size="full" href="#contact"> <Button variant="secondary" size="full" href="#contact">
{landing.pricing.plans.teams.cta}
</Button> </Button>
</div> </div>
</div> </div>
@@ -176,31 +174,31 @@ export default function MarketingPage() {
<div className="grid grid-cols-1 md:grid-cols-4 gap-12 mb-12"> <div className="grid grid-cols-1 md:grid-cols-4 gap-12 mb-12">
<div className="md:col-span-2"> <div className="md:col-span-2">
<Link href="/" className="text-xl font-bold text-white tracking-tight flex items-center gap-2 mb-4"> <Link href="/" className="text-xl font-bold text-white tracking-tight flex items-center gap-2 mb-4">
<span className="text-2xl">🪴</span> VibeRoom <span className="text-2xl">🪴</span> {copy.appName}
</Link> </Link>
<p className="text-white/60 text-sm leading-relaxed max-w-xs"> <p className="text-white/60 text-sm leading-relaxed max-w-xs">
. {landing.footer.description}
</p> </p>
</div> </div>
<div> <div>
<h4 className="font-bold text-white mb-4"></h4> <h4 className="font-bold text-white mb-4">{landing.footer.productTitle}</h4>
<ul className="space-y-3 text-sm text-white/60"> <ul className="space-y-3 text-sm text-white/60">
<li><a href="#features" className="hover:text-brand-soft transition-colors"> </a></li> <li><a href="#features" className="hover:text-brand-soft transition-colors">{landing.footer.links.features}</a></li>
<li><a href="#pricing" className="hover:text-brand-soft transition-colors"></a></li> <li><a href="#pricing" className="hover:text-brand-soft transition-colors">{landing.footer.links.pricing}</a></li>
<li><Link href="/login" className="hover:text-brand-soft transition-colors"> </Link></li> <li><Link href="/login" className="hover:text-brand-soft transition-colors">{landing.footer.links.webLogin}</Link></li>
</ul> </ul>
</div> </div>
<div> <div>
<h4 className="font-bold text-white mb-4"></h4> <h4 className="font-bold text-white mb-4">{landing.footer.companyTitle}</h4>
<ul className="space-y-3 text-sm text-white/60"> <ul className="space-y-3 text-sm text-white/60">
<li><a href="#" className="hover:text-brand-soft transition-colors"></a></li> <li><a href="#" className="hover:text-brand-soft transition-colors">{landing.footer.links.about}</a></li>
<li><a href="#" className="hover:text-brand-soft transition-colors"></a></li> <li><a href="#" className="hover:text-brand-soft transition-colors">{landing.footer.links.privacy}</a></li>
<li><a href="#" className="hover:text-brand-soft transition-colors"></a></li> <li><a href="#" className="hover:text-brand-soft transition-colors">{landing.footer.links.terms}</a></li>
</ul> </ul>
</div> </div>
</div> </div>
<div className="border-t border-white/10 pt-8 text-center text-sm text-white/40"> <div className="border-t border-white/10 pt-8 text-center text-sm text-white/40">
&copy; 2026 VibeRoom. All rights reserved. {landing.footer.copyright}
</div> </div>
</div> </div>
</footer> </footer>

View File

@@ -0,0 +1,47 @@
"use client";
import type { ReactNode } from "react";
import Cookies from "js-cookie";
import { useRouter } from "next/navigation";
import { TOKEN_COOKIE_KEY } from "@/features/auth/model/constants";
import { Button, type ButtonSize, type ButtonVariant } from "@/shared/ui/Button";
import { useAuthStore } from "@/store/useAuthStore";
interface AuthRedirectButtonProps {
children: ReactNode;
className?: string;
size?: ButtonSize;
variant?: ButtonVariant;
authenticatedHref?: string;
unauthenticatedHref?: string;
}
export function AuthRedirectButton({
children,
className,
size = "md",
variant = "primary",
authenticatedHref = "/space",
unauthenticatedHref = "/login",
}: AuthRedirectButtonProps) {
const router = useRouter();
const accessToken = useAuthStore((state) => state.accessToken);
const isAuthenticated = useAuthStore((state) => state.isAuthenticated);
const handleClick = () => {
const hasAccessToken = isAuthenticated || Boolean(accessToken) || Boolean(Cookies.get(TOKEN_COOKIE_KEY));
router.push(hasAccessToken ? authenticatedHref : unauthenticatedHref);
};
return (
<Button
type="button"
variant={variant}
size={size}
className={className}
onClick={handleClick}
>
{children}
</Button>
);
}

View File

@@ -0,0 +1,2 @@
export const TOKEN_COOKIE_KEY = "vr_access_token";
export const REFRESH_TOKEN_COOKIE_KEY = "vr_refresh_token";

1
src/shared/i18n/index.ts Normal file
View File

@@ -0,0 +1 @@
export { ko as copy } from './ko';

716
src/shared/i18n/ko.ts Normal file
View File

@@ -0,0 +1,716 @@
export const ko = {
appName: 'VibeRoom',
metadata: {
title: 'VibeRoom - 당신만의 편안한 몰입 공간',
description:
'프리랜서와 온전한 집중이 필요한 분들을 위한 따뜻하고 구조화된 온라인 코워킹 스페이스. 작업 타이머, 세션 관리, 그리고 느슨한 연대를 통해 당신의 리듬을 찾아보세요.',
},
common: {
close: '닫기',
cancel: '취소',
save: '저장',
delete: '삭제',
complete: '완료',
select: '선택',
hub: '허브로',
loading: '불러오는 중이에요.',
default: '기본',
defaultBackground: '기본 배경',
admin: '관리자',
requestFailed: (status: number) => `요청 실패: ${status}`,
apiRequestFailed: (status: number) => `API 요청 실패: ${status}`,
},
landing: {
nav: {
features: '기능 소개',
pricing: '요금제',
login: '로그인',
startFree: '무료로 시작하기',
},
hero: {
titleLead: '함께하는 조용한 몰입,',
titleAccent: 'VibeRoom',
description:
'집중하기 어려운 순간, 당신을 다그치지 않는 편안한 공간으로 들어오세요. 구조화된 코워킹 세션과 느슨한 연대가 당신의 페이스를 되찾아 줍니다.',
primaryCta: '나만의 공간 만들기',
secondaryCta: '더 알아보기',
timerPreview: '45:00 남음',
},
features: {
title: '당신을 위한 다정한 몰입 장치',
description: '단순한 타이머가 아닙니다. 무리하지 않고 오래 지속할 수 있는 환경을 제공합니다.',
items: [
{
icon: '⏳',
title: '구조화된 세션 타이머',
description:
'부담 없이 시작할 수 있는 짧은 몰입과 확실한 휴식. 당신만의 작업 리듬을 부드럽게 설정하고 관리하세요.',
},
{
icon: '🌱',
title: '다정한 연대와 코워킹',
description:
'화면 너머 누군가와 함께하는 바디 더블링 효과. 감시가 아닌, 조용하지만 강력한 동기를 서로 나누어보세요.',
},
{
icon: '🛋️',
title: '나만의 심미적 공간',
description:
'비 오는 다락방, 햇살 드는 카페. 백색소음과 함께 내가 가장 편안함을 느끼는 가상 공간을 꾸미고 머무르세요.',
},
],
},
pricing: {
title: '나에게 맞는 공간 선택하기',
description: '개인의 가벼운 집중부터 프리랜서의 완벽한 워크스페이스까지.',
plans: {
starter: {
name: 'Starter',
subtitle: '가벼운 집중이 필요한 분',
price: '무료',
cta: '무료로 시작하기',
features: ['기본 가상 공간 테마', '1:1 파트너 매칭 (주 3회)', '오픈 코워킹 룸 입장'],
},
pro: {
badge: '추천',
name: 'Pro',
subtitle: '방해 없는 완벽한 몰입 환경',
price: '₩6,900',
priceSuffix: '/월',
cta: 'Pro 시작하기',
features: [
'프리미엄 테마 무제한',
'1:1 매칭 무제한',
'고급 집중 통계 및 리포트',
'공간 커스텀 아이템 제공',
],
},
teams: {
name: 'Teams',
subtitle: '리모트 워크 기업 및 팀',
price: '₩12,000',
priceSuffix: '/인·월',
cta: '도입 문의하기',
features: ['Pro 플랜의 모든 기능', '프라이빗 팀 스페이스', '팀 전체 생산성 대시보드'],
},
},
},
footer: {
description:
'프리랜서와 온전한 집중이 필요한 분들을 위한 따뜻하고 구조화된 온라인 코워킹 스페이스입니다.',
productTitle: '제품',
companyTitle: '회사',
links: {
features: '기능 소개',
pricing: '요금제',
webLogin: '웹앱 로그인',
about: '소개',
privacy: '개인정보처리방침',
terms: '이용약관',
},
copyright: '© 2026 VibeRoom. All rights reserved.',
},
},
login: {
title: '다시 오셨군요!',
descriptionFirstLine: '비밀번호를 외울 필요 없이,',
descriptionSecondLine: '사용 중인 계정으로 3초 만에 시작하세요.',
agreementPrefix: '로그인함으로써 VibeRoom의',
agreementAnd: '및',
terms: '이용약관',
privacy: '개인정보처리방침',
agreementSuffix: '에 동의하게 됩니다.',
},
auth: {
social: {
connecting: '연결 중...',
continueWithGoogle: 'Google로 계속하기',
continueWithApple: 'Apple로 계속하기',
continueWithFacebook: 'Facebook으로 계속하기',
},
errors: {
loginFailed: '로그인에 실패했습니다. 다시 시도해 주세요.',
googleFailed: '구글 로그인에 실패했습니다. 팝업 차단 여부를 확인해 주세요.',
appleFailed: '애플 로그인 중 오류가 발생했습니다.',
appleInitFailed: '애플 로그인 초기화 실패',
facebookFailed: '페이스북 로그인에 실패했습니다.',
},
},
admin: {
defaultLoginId: 'qwer1234',
defaultPassword: 'qwer1234!',
consoleLabel: 'Admin Console',
mediaAdminLabel: 'Media Admin',
localCredentialsHint: 'Local admin credentials',
signInEyebrow: 'Sign In',
loginTitle: '관리자 로그인',
loginDescription: '관리자 권한이 확인되면 좌측 사이드바 기반 대시보드가 열립니다.',
loginIdLabel: '아이디',
loginPasswordLabel: '비밀번호',
openDashboard: '대시보드 열기',
loggingIn: '로그인 중...',
logout: '로그아웃',
mediaOperations: 'Media Operations',
access: 'Access',
accessTitle: 'Admin Only',
accessDescription: '로그인 후 업로드 토큰으로 scene 이미지와 sound 오디오를 바로 R2에 반영합니다.',
manifestReady: 'Manifest Ready',
sessionSection: 'Session',
sessionAdminLabel: 'Admin',
sessionRoleLabel: 'Role',
roleAccessSuffix: ' Access',
searchValues: {
scene: 'scene assets',
sound: 'sound assets',
},
navItems: [
{
id: 'scene',
title: '이미지 등록',
subtitle: 'Scene background assets',
section: 'MEDIA',
},
{
id: 'sound',
title: '오디오 등록',
subtitle: 'Loop and preview assets',
section: 'MEDIA',
},
],
views: {
scene: {
eyebrow: 'Image Registration',
title: 'Scene 이미지 등록',
description:
'Space에 들어온 사용자가 선택하는 배경 이미지 세트를 등록합니다. cardFile과 stageFile은 최초 생성 시 필수입니다.',
statTitle: 'Image Pipeline',
statValue: 'Scene Assets',
statHint: 'R2 / Manifest Sync',
workspaceTitle: '이미지 등록 워크스페이스',
workspaceDescription: '왼쪽 메뉴는 유지되고, 이 중앙 영역만 `이미지 등록` 작업으로 전환됩니다.',
sceneIdLabel: 'Scene ID',
sceneIdPlaceholder: 'rain-window',
placeholderGradientLabel: 'Placeholder Gradient',
placeholderGradientPlaceholder: 'linear-gradient(160deg, #1e293b 0%, #0f172a 100%)',
cardImageLabel: 'Card Image',
stageImageLabel: 'Stage Image',
mobileStageLabel: 'Mobile Stage',
hdStageLabel: 'HD Stage',
blurDataUrlLabel: 'Blur Data URL',
blurDataUrlPlaceholder: 'data:image/jpeg;base64,...',
notesTitle: '업로드 메모',
notes: [
'최초 생성 시 `cardFile`, `stageFile`은 필수입니다.',
'모바일과 HD 파일은 선택값이며 빠지면 기존 값을 유지합니다.',
'업로드 즉시 R2 경로와 manifest 응답 값이 갱신됩니다.',
],
submit: '이미지 등록',
pending: '이미지 업로드 중...',
},
sound: {
eyebrow: 'Audio Registration',
title: 'Sound 오디오 등록',
description:
'Loop, preview, fallback 오디오를 등록합니다. loopFile은 최초 생성 시 필수이며 기본 볼륨과 duration 메타데이터를 함께 저장합니다.',
statTitle: 'Audio Pipeline',
statValue: 'Sound Assets',
statHint: 'Loop / Preview / Fallback',
workspaceTitle: '오디오 등록 워크스페이스',
workspaceDescription: '좌측 네비게이션은 고정되고, 이 중앙 영역만 `오디오 등록` 작업으로 바뀝니다.',
presetIdLabel: 'Preset ID',
presetIdPlaceholder: 'rain-focus',
durationLabel: 'Duration Sec',
durationPlaceholder: '1800',
defaultVolumeLabel: 'Default Volume',
defaultVolumePlaceholder: '60',
loopFileLabel: 'Loop File',
previewFileLabel: 'Preview File',
fallbackLoopFileLabel: 'Fallback Loop File',
notesTitle: '업로드 메모',
notes: [
'최초 생성 시 `loopFile`은 필수입니다.',
'`preview`, `fallback`은 선택값이며 기존 메타데이터를 유지할 수 있습니다.',
'`defaultVolume`, `durationSec`는 manifest 응답에 함께 반영됩니다.',
],
submit: '오디오 등록',
pending: '오디오 업로드 중...',
},
},
inspector: {
recentResponse: '최근 응답',
noUploadSummary: '아직 업로드 작업이 없습니다.',
noUploadPayload: '업로드 응답이 아직 없습니다.',
sessionToken: '세션 토큰',
currentRoleTitle: 'Current Role',
bearerTokenSession: 'Bearer token enabled session',
},
messages: {
nonAdmin: 'ADMIN 권한이 없는 계정입니다.',
loginFailed: '로그인에 실패했습니다.',
loginRequired: '먼저 관리자 로그인을 해주세요.',
sceneIdRequired: 'sceneId를 입력해주세요.',
presetIdRequired: 'presetId를 입력해주세요.',
sceneUploadFailed: 'scene 업로드에 실패했습니다.',
soundUploadFailed: 'sound 업로드에 실패했습니다.',
sceneUploadDone: (sceneId: string) => `scene "${sceneId}" 업로드가 완료되었습니다.`,
soundUploadDone: (presetId: string) => `sound "${presetId}" 업로드가 완료되었습니다.`,
sceneSummary: (sceneId: string, version: string) =>
`${sceneId} 이미지 세트가 최신 버전 ${version}로 반영되었습니다.`,
soundSummary: (presetId: string, version: string) =>
`${presetId} 오디오 세트가 최신 버전 ${version}로 반영되었습니다.`,
},
},
settings: {
title: 'Settings',
focusPreferencesApi: 'Focus Preferences API',
loading: '저장된 설정을 불러오는 중이에요.',
saving: '변경 사항을 저장하는 중이에요.',
synced: '변경 즉시 서버에 저장합니다.',
reduceMotionTitle: 'Reduce Motion',
reduceMotionDescription: '전환 애니메이션을 최소화합니다. (UI 토글 목업)',
notificationIntensityTitle: '알림 강도',
notificationIntensityDescription: '집중 시작/종료 신호의 존재감을 선택합니다.',
defaultPresetTitle: '기본 프리셋',
defaultPresetDescription: '입장 시 자동 선택될 추천 세트를 고릅니다.',
notificationIntensityOptions: ['조용함', '기본', '강함'],
defaultPresetOptions: [
{ id: 'balanced', label: 'Balanced 25/5 + Rain Focus' },
{ id: 'deep-work', label: 'Deep Work 50/10 + Deep White' },
{ id: 'gentle', label: 'Gentle 25/5 + Silent' },
],
},
stats: {
title: 'Stats',
apiLabel: 'API',
mockLabel: 'Mock',
sourceApi: 'API 통계 사용 중',
sourceMock: 'API 실패로 mock 통계 표시 중',
loading: '통계를 불러오는 중이에요.',
loadFailed: '통계를 불러오지 못했어요.',
synced: '화면 진입 시 최신 요약을 동기화합니다.',
refresh: '새로고침',
today: '오늘',
last7Days: '최근 7일',
chartTitle: '집중 흐름 그래프',
chartWithTrend: 'trend 응답으로 간단한 막대 그래프를 렌더링합니다.',
chartWithoutTrend: 'trend 응답이 비어 있어 플레이스홀더 상태입니다.',
todayFocus: '오늘 집중 시간',
completedCycles: '완료한 사이클',
sessionEntries: '입장 횟수',
last7DaysFocus: '최근 7일 집중 시간',
bestDay: '최고 몰입일',
streak: '연속 달성',
syncedApi: '동기화됨',
temporary: '임시값',
actualAggregate: '실집계',
mockAggregate: '목업',
streakActive: '유지 중',
streakStart: '시작 전',
countUnit: '회',
dayUnit: '일',
minuteUnit: '분',
barTitle: (date: string, minutes: number) => `${date} · ${minutes}`,
},
plan: {
proFeatureCards: [
{
id: 'scene-packs',
name: 'Scene Packs',
description: '프리미엄 공간 묶음과 장면 변주',
},
{
id: 'sound-packs',
name: 'Sound Packs',
description: '확장 사운드 프리셋 묶음',
},
{
id: 'profiles',
name: 'Profiles',
description: '내 기본 세팅 저장/불러오기',
},
],
},
session: {
todayOneLiner: '오늘의 한 줄: 완벽보다 시작, 한 조각이면 충분해요.',
goalChips: [
{ id: 'mail-3', label: '메일 3개' },
{ id: 'doc-1p', label: '문서 1p' },
{ id: 'code-1-function', label: '코딩 1함수' },
{ id: 'tidy-10m', label: '정리 10분' },
{ id: 'reading-15m', label: '독서 15분' },
{ id: 'resume-1paragraph', label: '이력서 1문단' },
],
checkInPhrases: [
{ id: 'arrived', text: '지금 들어왔어요' },
{ id: 'sprint-25', text: '25분만 달릴게요' },
{ id: 'on-break', text: '휴식 중' },
{ id: 'back-focus', text: '다시 집중!' },
{ id: 'slow-day', text: '오늘은 천천히' },
],
reactionOptions: [
{ id: 'thumbs-up', emoji: '👍', label: '응원해요' },
{ id: 'fire', emoji: '🔥', label: '집중 모드' },
{ id: 'clap', emoji: '👏', label: '잘하고 있어요' },
{ id: 'heart-hands', emoji: '🫶', label: '연결되어 있어요' },
],
soundPresets: [
{ id: 'deep-white', label: 'Deep White' },
{ id: 'rain-focus', label: 'Rain Focus' },
{ id: 'cafe-work', label: 'Cafe Work' },
{ id: 'ocean-calm', label: 'Ocean Calm' },
{ id: 'fireplace', label: 'Fireplace' },
{ id: 'silent', label: 'Silent' },
],
timerPresets: [
{ id: '25-5', label: '25/5', focusMinutes: 25, breakMinutes: 5 },
{ id: '50-10', label: '50/10', focusMinutes: 50, breakMinutes: 10 },
{ id: '90-20', label: '90/20', focusMinutes: 90, breakMinutes: 20 },
{ id: 'custom', label: '커스텀' },
],
distractionDumpPlaceholder: ['디자인 QA 요청 확인', '세금계산서 발행 메모', '오후 미팅 질문 1개 정리'],
todayStats: [
{ id: 'today-focus', label: '오늘 집중 시간', value: '2h 40m', delta: '+35m' },
{ id: 'today-cycles', label: '완료한 사이클', value: '5회', delta: '+1' },
{ id: 'today-entry', label: '입장 횟수', value: '3회', delta: '유지' },
],
weeklyStats: [
{ id: 'week-focus', label: '최근 7일 집중 시간', value: '14h 20m', delta: '+2h 10m' },
{ id: 'week-best-day', label: '최고 몰입일', value: '수요일', delta: '3h 30m' },
{ id: 'week-consistency', label: '연속 달성', value: '4일', delta: '+1일' },
],
recentThoughts: [
{
id: 'thought-1',
text: '내일 미팅 전에 제안서 첫 문단만 다시 다듬기',
sceneName: '도서관',
capturedAt: '방금 전',
},
{
id: 'thought-2',
text: '기획 문서의 핵심 흐름을 한 문장으로 정리해두기',
sceneName: '비 오는 창가',
capturedAt: '24분 전',
},
{
id: 'thought-3',
text: '오후에 확인할 이슈 번호만 메모하고 지금 작업 복귀',
sceneName: '숲',
capturedAt: '1시간 전',
},
{
id: 'thought-4',
text: '리뷰 코멘트는 오늘 17시 이후에 한 번에 처리',
sceneName: '벽난로',
capturedAt: '어제',
},
],
justNow: '방금 전',
},
scenes: [
{
id: 'rain-window',
name: '비 오는 창가',
description: '빗소리 위로 스탠드 조명이 부드럽게 번집니다.',
tags: ['저자극', '감성'],
recommendedSound: 'Rain Focus',
recommendedTime: '밤',
vibeLabel: '잔잔함',
},
{
id: 'dawn-cafe',
name: '새벽 카페',
description: '첫 커피 향처럼 잔잔하고 따뜻한 좌석.',
tags: ['감성', '딥워크'],
recommendedSound: 'Cafe Murmur',
recommendedTime: '새벽',
vibeLabel: '포근함',
},
{
id: 'quiet-library',
name: '도서관',
description: '넘기는 종이 소리만 들리는 정돈된 책상.',
tags: ['저자극', '딥워크'],
recommendedSound: 'Deep White',
recommendedTime: '오후',
vibeLabel: '몰입',
},
{
id: 'wave-sound',
name: '파도 소리',
description: '잔잔한 해변 위로 호흡을 고르는 공간.',
tags: ['움직임 적음', '감성'],
recommendedSound: 'Ocean Breath',
recommendedTime: '밤',
vibeLabel: '차분함',
},
{
id: 'green-forest',
name: '숲',
description: '바람이 나뭇잎을 스치는 소리로 마음을 낮춥니다.',
tags: ['저자극', '움직임 적음'],
recommendedSound: 'Forest Hush',
recommendedTime: '오전',
vibeLabel: '맑음',
},
{
id: 'fireplace',
name: '벽난로',
description: '작은 불꽃이 주는 리듬으로 집중을 붙잡습니다.',
tags: ['감성', '저자극'],
recommendedSound: 'Fireplace',
recommendedTime: '밤',
vibeLabel: '온기',
},
{
id: 'city-night',
name: '도시 야경',
description: '유리창 너머 야경이 멀리 흐르는 고요한 밤.',
tags: ['딥워크', '감성'],
recommendedSound: 'Night Lo-fi',
recommendedTime: '심야',
vibeLabel: '고요함',
},
{
id: 'snow-mountain',
name: '설산',
description: '차분한 공기와 선명한 수평선이 머리를 맑게 합니다.',
tags: ['움직임 적음', '딥워크'],
recommendedSound: 'Cold Wind',
recommendedTime: '새벽',
vibeLabel: '선명함',
},
{
id: 'sun-window',
name: '창가',
description: '햇살이 들어오는 간결한 책상, 부담 없는 시작.',
tags: ['저자극', '딥워크'],
recommendedSound: 'Soft Daylight',
recommendedTime: '오후',
vibeLabel: '가벼움',
},
{
id: 'outer-space',
name: '우주',
description: '별빛만 남긴 어둠 속에서 깊게 잠수합니다.',
tags: ['딥워크', '감성'],
recommendedSound: 'Deep Drone',
recommendedTime: '심야',
vibeLabel: '깊음',
},
],
modal: {
closeAriaLabel: '모달 닫기',
closeButton: '닫기',
},
media: {
manifestLoadFailed: '미디어 manifest를 불러오지 못했어요.',
},
preferences: {
defaultNotificationIntensity: '기본',
loadFailed: '설정을 불러오지 못했어요.',
saveFailed: '설정을 저장하지 못했어요.',
saved: '저장됨',
saveFailedLabel: '저장 실패',
},
focusSession: {
syncFailed: '세션 엔진과 동기화하지 못했어요.',
startFailed: '세션을 시작하지 못했어요.',
pauseFailed: '세션을 일시정지하지 못했어요.',
resumeFailed: '세션을 다시 시작하지 못했어요.',
restartPhaseFailed: '현재 페이즈를 다시 시작하지 못했어요.',
completeFailed: '세션을 완료 처리하지 못했어요.',
abandonFailed: '세션을 종료하지 못했어요.',
},
space: {
sessionGoal: {
label: '이번 25분, 딱 한 가지',
required: '(필수)',
placeholder: '예: 계약서 1페이지 정리',
hint: '크게 말고, 바로 다음 한 조각.',
},
setup: {
panelAriaLabel: '집중 시작 패널',
eyebrow: 'Ritual',
title: '이번 한 조각을 정하고 시작해요.',
description: '목표를 정한 뒤 HUD의 시작 버튼으로 실제 세션을 시작해요.',
resumeTitle: '지난 한 조각 이어서',
startFresh: '새로 시작',
resumePrepare: '이어서 준비',
sceneLabel: '배경',
timerLabel: '타이머',
soundLabel: '사운드',
readyHint: '목표를 적으면 시작할 수 있어요.',
openFocusScreen: '집중 화면 열기',
},
timerHud: {
actions: [
{ id: 'start', label: '시작', icon: '▶' },
{ id: 'pause', label: '일시정지', icon: '⏸' },
{ id: 'reset', label: '리셋', icon: '↺' },
],
readyMode: 'Ready',
focusMode: 'Focus',
breakMode: 'Break',
goalFallback: '이번 한 조각을 설정해 주세요.',
goalPrefix: '이번 한 조각 · ',
completeButton: '완료',
},
focusHud: {
goalFallback: '집중을 시작해요.',
goalToast: (goal: string) => `이번 한 조각 · ${goal}`,
restReminder: '5분이 지났어요. 다음 한 조각으로 돌아와요.',
},
goalComplete: {
suggestions: ['리뷰 코멘트 2개 처리', '문서 1문단 다듬기', '이슈 1개 정리', '메일 2개 회신'],
placeholderFallback: '다음 한 조각을 적어보세요',
placeholderExample: (goal: string) => `예: ${goal}`,
title: '좋아요. 다음 한 조각은?',
description: '너무 크게 잡지 말고, 바로 다음 한 조각만.',
closeAriaLabel: '닫기',
restButton: '잠깐 쉬기',
confirmButton: '바로 다음 조각 시작',
},
controlCenter: {
sectionTitles: {
background: 'Background',
time: 'Time',
sound: 'Sound',
packs: 'Packs',
},
packsDescription: '확장/개인화',
recommendation: (soundLabel: string, timerLabel: string) => `추천: ${soundLabel} · ${timerLabel}`,
recommendationHint: '추천 조합은 참고 정보로만 제공돼요.',
autoHideTitle: '컨트롤 자동 숨김',
autoHideDescription: '입력이 없으면 잠시 후 패널을 닫아요.',
autoHideAriaLabel: '컨트롤 자동 숨김',
sideSheetSubtitle: '배경 · 타이머 · 사운드를 그 자리에서 바꿔요.',
quickControlsTitle: 'Quick Controls',
},
toolsDock: {
notesButton: 'Notes',
popoverCloseAria: '팝오버 닫기',
planPro: 'PRO',
planNormal: 'Normal',
inboxSaved: '인박스에 저장됨',
undo: '실행취소',
inboxSaveUndone: '저장 취소됨',
deleted: '삭제됨',
deleteUndone: '삭제를 취소했어요.',
emptyToClear: '비울 항목이 없어요.',
clearedAll: '모두 비워짐',
restored: '복원했어요.',
normalPlanInfo: 'NORMAL 플랜 사용 중 · 잠금 항목에서만 업그레이드할 수 있어요.',
proFeatureLocked: (source: string) => `${source}은(는) PRO 기능이에요.`,
proFeaturePending: (label: string) => `${label} 준비 중(더미)`,
purchaseMock: '결제(더미)',
manageSubscriptionMock: '구독 관리(더미)',
restorePurchaseMock: '구매 복원(더미)',
featureLabels: {
scenePacks: 'Scene Packs',
soundPacks: 'Sound Packs',
profiles: 'Profiles',
},
utilityPanelTitle: {
'control-center': 'Quick Controls',
inbox: '인박스',
paywall: 'PRO',
'manage-plan': '플랜 관리',
},
},
quickNotes: {
title: '떠오른 생각을 잠깐 주차해요',
placeholder: '떠오른 생각을 잠깐 주차…',
submit: '저장',
hint: '나중에 인박스에서 정리해요.',
},
quickSound: {
currentSound: '현재 사운드',
muteAriaLabel: '음소거',
unmuteAriaLabel: '음소거 해제',
volumeAriaLabel: '사운드 볼륨',
quickSwitch: '빠른 전환',
},
soundPresetControls: {
preset: 'Preset',
mixerOpen: 'Mixer 펼치기',
mixerClose: 'Mixer 접기',
mock: '더미',
masterVolume: '마스터 볼륨',
mute: '뮤트',
muteToggleAriaLabel: '마스터 뮤트 토글',
trackLabels: {
white: 'White',
rain: 'Rain',
cafe: 'Cafe',
wave: 'Wave',
fan: 'Fan',
},
},
inbox: {
empty: '지금은 비어 있어요. 집중 중 떠오른 생각을 여기로 주차할 수 있어요.',
complete: '완료',
completed: '완료됨',
delete: '삭제',
readOnly: '나중에 모아보는 읽기 전용 인박스',
clearAll: '모두 비우기',
clearConfirmTitle: '정말 인박스를 비울까요?',
clearConfirmDescription: '실수라면 토스트에서 실행취소할 수 있어요.',
clearButton: '비우기',
openInboxAriaLabel: '인박스 열기',
openInboxTitle: '인박스',
},
rightRail: {
openQuickControlsAriaLabel: 'Quick Controls 열기',
openQuickControlsTitle: 'Quick Controls',
},
paywall: {
points: ['프리미엄 Scene Packs', '확장 Sound Packs', '프로필 저장 / 불러오기'],
title: 'PRO에서 더 많은 공간과 사운드를 열어둘 수 있어요.',
description: '잠금 항목을 누른 순간에만 열리는 더미 결제 시트입니다.',
later: '나중에',
startPro: 'PRO 시작하기',
manageTitle: 'PRO 관리',
manageDescription: '결제/복원은 더미 동작이며 실제 연동은 하지 않아요.',
openSubscription: '구독 관리 열기',
restorePurchase: '구매 복원',
},
statsPanel: {
description: '오늘 흐름과 최근 7일 리듬을 가볍게 확인하세요.',
graphPlaceholder: '그래프 플레이스홀더',
},
settingsPanel: {
reduceMotion: 'Reduce Motion',
reduceMotionDescription: '화면 전환을 조금 더 차분하게 표시합니다.',
background: '배경',
backgroundDescription: '몰입 중에도 배경 scene을 바꿀 수 있어요.',
timerPreset: '타이머 프리셋',
timerPresetDescription: '기본 프리셋만 빠르게 고를 수 있어요.',
defaultPreset: '기본 프리셋',
},
workspace: {
readyToStart: '준비 완료 · 시작 버튼을 눌러 집중을 시작해요.',
startFailed: '세션을 시작하지 못했어요. 잠시 후 다시 시도해 주세요.',
resumeFailed: '세션을 다시 시작하지 못했어요.',
abandonFailed: '세션 종료를 완료하지 못했어요.',
pauseFailed: '세션을 일시정지하지 못했어요.',
restartFailed: '현재 페이즈를 다시 시작하지 못했어요.',
restarted: '현재 페이즈를 처음부터 다시 시작했어요.',
goalCompleteSyncFailed: '현재 세션 완료를 서버에 반영하지 못했어요.',
nextGoalReady: '다음 한 조각 준비 완료 · 시작 버튼을 눌러 이어가요.',
},
exitHold: {
holdToExitAriaLabel: '길게 눌러 나가기',
exit: '나가기',
},
},
soundPlayback: {
loadFailed: '사운드 파일을 불러오지 못했어요.',
browserDeferred: '브라우저가 사운드 재생을 보류했어요.',
},
restart30s: {
button: '숨 고르기 30초',
mode: 'BREATHE',
toast: '잠깐 숨 고르고, 다시 천천히 시작해요.',
complete: '준비됐어요. 집중으로 돌아가요.',
},
} as const;

View File

@@ -1,6 +1,7 @@
import { create } from 'zustand'; import { create } from 'zustand';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { AuthResponse } from '@/features/auth/types'; import { AuthResponse } from '@/features/auth/types';
import { REFRESH_TOKEN_COOKIE_KEY, TOKEN_COOKIE_KEY } from '@/features/auth/model/constants';
interface AuthState { interface AuthState {
accessToken: string | null; accessToken: string | null;
@@ -12,10 +13,6 @@ interface AuthState {
logout: () => void; logout: () => void;
} }
// 쿠키 키 상수 정의
const TOKEN_COOKIE_KEY = 'vr_access_token';
const REFRESH_TOKEN_COOKIE_KEY = 'vr_refresh_token';
/** /**
* VibeRoom 전역 인증(Auth) 상태 저장소 * VibeRoom 전역 인증(Auth) 상태 저장소
*/ */