M1 웹 + 배포: 홈·코드 입장·대기실·오목 화면·결과·계정, E2E, Docker/Caddy

- 웹(React+Vite): 홈(큰 버튼 2개·하던 게임 돌아가기), 6자리 코드 입력(붙여넣기 감지·자동 입장),
  링크 입장(닉네임 한 칸), 대기실(코드/링크 복사·공유·QR·자리·준비·방장 메뉴·설정),
  오목(SVG 판·두 번 눌러 확정·금수/위험 표시·시계·무르기·무승부·기권·키보드 조작·스크린리더 안내),
  결과(한 판 더 투표·방 전적·공정성 확인), 채팅·반응, 계정(닉네임 변경·글자 크기·테마·소리·진동)
- WS 클라이언트: 지수 백오프+지터 재연결, 화면 복귀/온라인 즉시 재연결, seq 순서 처리,
  ping/pong 지연·시계 보정, 서버 재시작 안내, 다른 창 접속 처리
- @bg/shared/lite: 브라우저용 진입점(zod 제외) → 첫 화면 JS 약 90KB gzip
- e2e/omok.e2e.ts: 브라우저 두 개(모바일·PC)로 방 만들기→링크 입장→대국→새로고침 복구→승리→한 판 더
- deploy: Dockerfile(운영 의존성만, 267MB), docker-compose(app+Caddy), Caddyfile(보안 헤더·CSP), .env.example
- 프록시 뒤에서만 X-Forwarded-For 신뢰(TRUST_PROXY=1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-04 04:37:33 +09:00
parent b1f3d7c500
commit 17b1d0fcda
46 changed files with 3590 additions and 90 deletions

View File

@@ -0,0 +1,13 @@
export const GAME_ICON: Record<string, string> = {
omok: '⚫',
baduk: '⚪',
chess: '♟️',
janggi: '🀄',
seotda: '🎴',
poker: '🃏',
mahjong: '🀇',
yut: '🪵',
};
/** Shown on the home screen so users know what's coming (docs/12-roadmap.md). */
export const UPCOMING = ['체스', '바둑', '장기', '오셀로', '섯다', '포커', '윷놀이', '원카드', '숫자 타일', '다빈치 코드', '요트 다이스', '마작', '고스톱', '뱅', '할리갈리'];

View File

@@ -0,0 +1,48 @@
/** Tiny synthesized sounds + vibration (no audio files; docs/07 §6). */
import { useSession } from '../store/session';
let ctx: AudioContext | null = null;
function audio(): AudioContext | null {
if (!useSession.getState().settings.sound) return null;
try {
ctx ??= new AudioContext();
if (ctx.state === 'suspended') void ctx.resume();
return ctx;
} catch {
return null;
}
}
function tone(freq: number, ms: number, type: OscillatorType = 'sine', gain = 0.15, delay = 0): void {
const a = audio();
if (!a) return;
const t = a.currentTime + delay / 1000;
const o = a.createOscillator();
const g = a.createGain();
o.type = type;
o.frequency.value = freq;
g.gain.setValueAtTime(gain, t);
g.gain.exponentialRampToValueAtTime(0.0001, t + ms / 1000);
o.connect(g).connect(a.destination);
o.start(t);
o.stop(t + ms / 1000 + 0.02);
}
export const sounds = {
stone: () => tone(900, 70, 'triangle', 0.25),
myTurn: () => {
tone(660, 120);
tone(880, 160, 'sine', 0.15, 120);
},
warn: () => tone(520, 90, 'square', 0.06),
win: () => [523, 659, 784, 1046].forEach((f, i) => tone(f, 180, 'triangle', 0.18, i * 120)),
lose: () => [392, 330].forEach((f, i) => tone(f, 220, 'sine', 0.15, i * 180)),
};
export function haptic(pattern: number | number[]): void {
if (!useSession.getState().settings.vibrate) return;
try {
navigator.vibrate?.(pattern);
} catch {}
}