diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..d168557 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +node_modules +.next +out +.git +.idea +*.tsbuildinfo +study-notes.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..582888e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +# 1단계: Next.js 정적 빌드 → /app/out +FROM node:22-alpine AS build +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci +COPY . . +RUN npm run build + +# 2단계: nginx로 정적 파일 서비스 (기존 Vue 배포와 같은 방식) +FROM nginx:alpine +COPY --from=build /app/out /usr/share/nginx/html +EXPOSE 80 diff --git a/README.md b/README.md index e215bc4..772b241 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,32 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). +# ss-front-react -## Getting Started - -First, run the development server: +PC통신 스타일 BBS UI — Next.js 16 (App Router) + React 19 + TypeScript ```bash -npm run dev -# or -yarn dev -# or -pnpm dev -# or -bun dev +npm install +npm run dev # http://localhost:3000 ``` -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. +## 디렉토리 구조 -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. +``` +src/ +├─ app/ # 라우팅 전용 (page / layout) +│ ├─ layout.tsx +│ ├─ page.tsx +│ ├─ globals.css # 전역 토큰·리셋 +│ └─ _components/ # 이 라우트에서만 쓰는 컴포넌트 (private folder, 라우팅 제외) +└─ features/ # 도메인(기능) 단위 모듈 + └─ bbs/ + ├─ index.ts # 외부 공개 API (여기서만 import) + ├─ types.ts + ├─ constants/ # 메뉴·팔레트 정의 + ├─ mocks/ # 목업 데이터 → API 연동 시 api/ 로 교체 + ├─ lib/command.ts # 명령 처리 순수 함수 (useReducer reducer) + └─ components/ # BbsTerminal(client) + 화면별 컴포넌트 + CSS Module +``` -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. - -## Learn More - -To learn more about Next.js, take a look at the following resources: - -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! - -## Deploy on Vercel - -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. - -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. +규칙 +- `app/`에는 라우팅 파일만, 로직은 `features/<도메인>/`에. +- 다른 곳에서는 `@/features/bbs` (index.ts)로만 import. +- 여러 feature가 공유하는 코드가 생기면 그때 `src/components`, `src/lib`, `src/hooks` 추가. diff --git a/next-env.d.ts b/next-env.d.ts new file mode 100644 index 0000000..ce4e94a --- /dev/null +++ b/next-env.d.ts @@ -0,0 +1,7 @@ +/// +/// +import "./.next/types/routes.d.ts"; +import "./.next/types/root-params.d.ts"; + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/next.config.ts b/next.config.ts index 6bcbe28..9ee88b8 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,9 +1,9 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { - /* config options here */ - cacheComponents: true, - partialPrefetching: true, + output: "export", // 정적 HTML/JS로 빌드 → nginx로 서비스 + // localhost 외 주소로 개발 서버 접속 허용 (Tailscale 등). 호스트명만, 포트/스킴 없이 + allowedDevOrigins: ["100.102.165.37"], }; export default nextConfig; diff --git a/public/file.svg b/public/file.svg deleted file mode 100644 index 004145c..0000000 --- a/public/file.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/globe.svg b/public/globe.svg deleted file mode 100644 index 567f17b..0000000 --- a/public/globe.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/next.svg b/public/next.svg deleted file mode 100644 index 5174b28..0000000 --- a/public/next.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/vercel.svg b/public/vercel.svg deleted file mode 100644 index 7705396..0000000 --- a/public/vercel.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/window.svg b/public/window.svg deleted file mode 100644 index b2b2a44..0000000 --- a/public/window.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/app/_components/Intro.tsx b/src/app/_components/Intro.tsx new file mode 100644 index 0000000..7a432ca --- /dev/null +++ b/src/app/_components/Intro.tsx @@ -0,0 +1,18 @@ +import styles from "./home.module.css"; + +export default function Intro() { + return ( +
+

Concept preview — 클릭 · 명령어 둘 다 됩니다

+

PC통신 스타일 TUI — 넘버 메뉴

+

+ BOARD 화면을 번호와 메뉴명을 직접 쳐서 이동하던 예전 PC통신 방식으로 바꾼 화면입니다. 마우스 + 클릭도 되지만, 클릭은 아래 명령어창에 같은 숫자를 입력하고 엔터 치는 것과 동일한 경로를 탑니다. +

+
+ 👉 입력창에 2 또는 board → 글 번호 입력해서 읽기 → L 목록,{" "} + M 메인 +
+
+ ); +} diff --git a/src/app/_components/Notes.tsx b/src/app/_components/Notes.tsx new file mode 100644 index 0000000..5d5bfa9 --- /dev/null +++ b/src/app/_components/Notes.tsx @@ -0,0 +1,22 @@ +import styles from "./home.module.css"; + +const NOTES = [ + ["클릭 = 명령어 대리 입력.", "메뉴/게시글 줄을 클릭하면 입력창에 번호가 채워졌다가 자동으로 엔터가 눌립니다. 마우스든 키보드든 같은 명령 처리 함수(features/bbs/lib/command.ts) 하나로 들어갑니다."], + ["\"읽음\" 기능이 그대로 이어집니다.", "글을 읽으면 \"2. 자유게시판\"에서 빠지고 \"3. 내가 읽은 글\"로 넘어갑니다 — viewed_at 플래그 기능을 재현."], + ["팔레트는 실제 테마 시스템과 바로 연결 가능.", "블루/그린/앰버 버튼은 기존 테마 셀렉터와 같은 구조(data-palette 속성 + CSS 변수)입니다."], +]; + +export default function Notes() { + return ( +
+ {NOTES.map(([title, desc]) => ( +
+ ▲ +

+ {title} {desc} +

+
+ ))} +
+ ); +} diff --git a/src/app/_components/home.module.css b/src/app/_components/home.module.css new file mode 100644 index 0000000..3e898d5 --- /dev/null +++ b/src/app/_components/home.module.css @@ -0,0 +1,19 @@ +.intro { max-width: 740px; width: 100%; } +.eyebrow { font-size: 11px; letter-spacing: 0.16em; color: #5a6b5a; text-transform: uppercase; margin: 0 0 10px; } +.intro h1 { margin: 0 0 14px; font-size: clamp(19px, 3vw, 25px); color: var(--ink); font-weight: 700; text-wrap: balance; } +.intro p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.75; color: var(--ink-3); max-width: 66ch; } +.intro b, .note b { color: var(--ink); font-weight: 600; } + +.hint { + margin-top: 14px; font-size: 12px; color: var(--ink-4); border: 1px dashed var(--line); + padding: 9px 12px; display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; +} +.hint kbd { + background: #151515; border: 1px solid #333; border-radius: 3px; padding: 1px 6px; + font-size: 11px; color: var(--ink); +} + +.notes { max-width: 740px; width: 100%; display: flex; flex-direction: column; gap: 14px; } +.note { display: flex; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); background: var(--panel-soft); } +.mark { color: #4dff4d; font-size: 12px; flex-shrink: 0; padding-top: 1px; } +.note p { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--ink-3); } diff --git a/src/app/globals.css b/src/app/globals.css index 4c18fb3..b937c85 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,49 +1,34 @@ :root { - --background: #ffffff; - --foreground: #171717; + --void: #050505; + --ink: #eafff0; + --ink-2: #c9d6c9; + --ink-3: #a9bdae; + --ink-4: #8fae93; + --line: #2c3a2c; + --panel-soft: rgba(255, 255, 255, 0.03); + --mono: ui-monospace, "D2Coding", "Cascadia Mono", "JetBrains Mono", "SFMono-Regular", Consolas, monospace; + color-scheme: dark; } -@media (prefers-color-scheme: dark) { - :root { - --background: #0a0a0a; - --foreground: #ededed; - } -} - -html { - height: 100%; -} - -html, -body { - max-width: 100vw; - overflow-x: hidden; -} +* { box-sizing: border-box; } body { - min-height: 100%; + margin: 0; + background: var(--void); + color: var(--ink-2); + font-family: var(--mono); +} + +button, input { font-family: inherit; } + +.page { + padding: clamp(20px, 4vw, 56px) clamp(14px, 4vw, 40px) 80px; display: flex; flex-direction: column; - color: var(--foreground); - background: var(--background); - font-family: Arial, Helvetica, sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; + align-items: center; + gap: 32px; } -* { - box-sizing: border-box; - padding: 0; - margin: 0; -} - -a { - color: inherit; - text-decoration: none; -} - -@media (prefers-color-scheme: dark) { - html { - color-scheme: dark; - } +@media (prefers-reduced-motion: reduce) { + * { transition: none !important; } } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index f58d37c..d8b31b2 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,25 +1,23 @@ import type { Metadata } from "next"; -import { Geist, Geist_Mono } from "next/font/google"; +import { PALETTE_KEY } from "@/features/bbs"; import "./globals.css"; -const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], -}); - -const geistMono = Geist_Mono({ - variable: "--font-geist-mono", - subsets: ["latin"], -}); - export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", + title: "SPECIALSOURCE-BBS", + description: "PC통신 스타일 TUI — 넘버 메뉴", }; export default function RootLayout({ children }: LayoutProps<"/">) { return ( - + // 아래 스크립트가 hydration 전에 data-palette를 붙이므로 경고 억제 + + +