v4.0.0: 회원·덱 API, 인증 UI, 프로필 및 레이아웃 통일

Express/SQLite API와 Docker 구성을 추가하고 로그인·덱 저장·공개 덱·관리자·프로필 화면을 구현했다. 결과 화면 저장 UX, 헤더 프로필, 애드센스용 app-shell 레이아웃(1280px) 및 문서를 반영했다.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-22 16:59:36 +09:00
parent f8c954f24b
commit dbf02241e2
56 changed files with 6732 additions and 183 deletions

55
script/deck-prefs.js Normal file
View File

@@ -0,0 +1,55 @@
/**
* 덱 저장 시 공개 여부 기본값·프롬프트 설정
*/
const UaDeckPrefs = (() => {
const LS_DEFAULT_PUBLIC = 'uadeck_default_deck_public';
const LS_SKIP_PROMPT = 'uadeck_skip_deck_public_prompt';
/**
* @param {object|null|undefined} user
* @returns {{ defaultPublic: boolean, skipPrompt: boolean }}
*/
function getPrefs(user) {
if (user && (user.defaultDeckPublic !== undefined || user.skipDeckPublicPrompt !== undefined)) {
return {
defaultPublic: user.defaultDeckPublic !== false,
skipPrompt: Boolean(user.skipDeckPublicPrompt),
};
}
return {
defaultPublic: localStorage.getItem(LS_DEFAULT_PUBLIC) !== '0',
skipPrompt: localStorage.getItem(LS_SKIP_PROMPT) === '1',
};
}
/**
* 로컬 캐시 동기화
* @param {{ defaultPublic: boolean, skipPrompt: boolean }} prefs
*/
function syncLocal(prefs) {
localStorage.setItem(LS_DEFAULT_PUBLIC, prefs.defaultPublic ? '1' : '0');
localStorage.setItem(LS_SKIP_PROMPT, prefs.skipPrompt ? '1' : '0');
}
/**
* @param {{ defaultPublic: boolean, skipPrompt: boolean }} prefs
* @returns {Promise<void>}
*/
async function savePrefs(prefs) {
syncLocal(prefs);
if (!window.UaDeckApi?.getToken()) return;
try {
const { user } = await window.UaDeckApi.updateProfile({
defaultDeckPublic: prefs.defaultPublic,
skipDeckPublicPrompt: prefs.skipPrompt,
});
window.UaDeckApi.saveAuth(window.UaDeckApi.getToken(), user);
} catch (err) {
console.warn('덱 저장 설정 동기화 실패:', err);
}
}
return { getPrefs, syncLocal, savePrefs };
})();
window.UaDeckPrefs = UaDeckPrefs;