네이버 OAuth 인증 URL 생성 및 state 파라미터 발급. naver_callback.php로 리다이렉트.
06
✏️ 에디터 JavaScript 모듈
create.php에서 editor_bundle.php를 통해 로드됩니다. 의존성 순서가 중요합니다 — editor.js가 코어이며 나머지 모듈들은 editor.js를 확장합니다.
📦 editor_bundle.php 로드 순서
① 독립모듈
→
② editor.js (코어)
→
③ 외부 플러그인 (poster, map, layer)
→
④ 기능 확장 모듈
파일명
역할
크기
의존성
editor.js
⭐ 에디터 코어 — 전체 에디터 UI, 모듈 드래그&드롭, 저장/불러오기, 페이지 관리
185KB
없음 (최상위)
editor-modules-text.js
텍스트 블록 모듈 — 폰트, 색상, 정렬, 줄간격, 샘플 텍스트 삽입
91KB
editor.js 이전 로드 (독립)
editor-poster.js
포스터 모듈 — 이미지 위 레이어 배치, 필터, 배경 스타일
60KB
editor-layer.js
editor-modules-survey.js
참석 설문 모듈 — 설문 항목 구성, 미리보기
58KB
editor.js
editor-contact.js
연락처/계좌 모듈 — 연락처, 계좌번호, 카카오페이 링크
60KB
editor.js
editor-calendar.js
달력 모듈 — D-Day 달력, 카운트다운 설정
48KB
editor.js
editor-image-edit.js
이미지 편집 — 크롭, 필터, 밝기/대비, 회전
65KB
editor.js
editor-modules-place.js
장소 안내 모듈 — 교통 안내, 주차 정보, 내비 연동 버튼
42KB
editor.js, editor-map.js
editor-modules-lottery.js
복권 추첨 모듈 — 스크래치 UI 설정, 당첨 확률 구성
41KB
editor.js
editor-modules-profile.js
프로필 카드 모듈 — 사진, 이름, SNS 링크
36KB
editor.js
editor-modules-guestbook.js
방명록 모듈 설정
30KB
editor.js
editor-modules-account.js
계좌번호 입력/표시 모듈
31KB
editor.js
editor-modules-video.js
동영상 모듈 — 유튜브/업로드
31KB
editor.js
editor-map.js
지도 모듈 — 네이버 지도 API 연동, 마커
23KB
editor.js 이전 (독립)
editor-modules-table.js
표 모듈 — 행/열 편집
23KB
editor.js
editor-effects.js
페이지 이펙트 — 꽃잎, 하트, 눈 등 파티클
31KB
독립
editor-bgm.js
BGM 설정 — bgm-list.php에서 목록 로드
15KB
editor.js
editor-layer.js
텍스트 레이어 에디터 — 포스터 위 텍스트 배치
8KB
editor.js 이전
editor-layer-image.js
이미지 레이어 에디터 — 포스터 위 이미지 배치
17KB
editor-layer.js
editor-modules-button.js
버튼 모듈 — 링크 버튼 스타일/URL 설정
18KB
editor.js
editor-modules-divider.js
구분선 모듈
18KB
editor.js
editor-modules-tabs.js
탭 레이아웃 모듈
13KB
editor.js
editor-modules-flower.js
화환 보내기 모듈 — 외부 화환 쇼핑몰 연동
17KB
editor.js
editor-modules-image.js
이미지 블록 모듈 — 이미지 업로드, 비율 설정
14KB
editor.js
editor-modules-reactions.js
이모지 공감 모듈 설정
11KB
editor.js
poster-frames.js
포스터 프레임 디자인 데이터
7.5KB
독립
emoji-picker.js
이모지 선택기 공통 컴포넌트
11KB
독립 (가장 먼저 로드)
fonts.js
폰트 목록 데이터 — 텍스트 모듈에서 사용
17KB
editor-modules-text.js
07
👁 뷰어 JavaScript
view.php에서 view_bundle.php를 통해 로드됩니다. 에디터와 달리 편집 기능 없이 렌더링만 담당합니다.
view-render.js 51KB
⭐ 뷰어 코어 렌더러
초대장 JSON 데이터를 읽어 화면에 렌더링하는 핵심 엔진. 각 모듈 타입별 렌더 함수 호출, 페이지 전환(scroll/flip), 인트로 애니메이션, BGM 자동 재생 처리.
view.php의 최종 렌더러
main.js 3.5KB
사이트 공통 JS
스크롤 애니메이션(data-reveal), 헤더 스크롤 처리, 로그인 모달 트리거 등 사이트 전반 공통 기능.
member.js 32KB
회원 관련 클라이언트 JS
로그인 모달, 소셜 로그인 버튼, 별명 설정, 세션 확인, 마이페이지 데이터 로드 등. member.php API와 통신.
member.php 호출mypage.php에서 로드
push.js 7.5KB
Web Push 구독 JS
서비스 워커 등록, Push 구독 요청, push_subscribe.php에 엔드포인트 등록.
sw.js 연동push_subscribe.php
push_send.js 1KB
Push 발송 트리거 (Node.js)
서버사이드에서 web-push 패키지를 사용해 Push 발송. package.json의 web-push 의존성 사용.
Node.js 실행VAPID
sw.js 2KB
서비스 워커
Web Push 수신 처리, 알림 클릭 이벤트 핸들링, 캐시 전략.
Service Workerpush.js에서 등록
08
📦 JS 번들러 시스템
별도의 빌드 도구(webpack 등) 없이 PHP가 JS 파일들을 동적으로 합쳐서 전달하는 자체 번들링 시스템입니다.
editor_bundle.php 3.5KB
에디터용 JS 번들러
20개 이상의 에디터 JS 파일을 순서대로 합쳐 하나의 응답으로 반환. 캐싱: 모든 파일의 mtime으로 ETag 생성 → 파일 수정 시 자동 무효화. Cache-Control: max-age=3600 (1시간)
create.php에서 <script src="editor_bundle.php">
view_bundle.php 2.5KB
뷰어용 JS 번들러
view-render.js + 각 모듈 렌더러를 합쳐 전달.
에디터와 동일한 ETag 캐싱 방식.
view.php에서 <script src="view_bundle.php">
admin_template.php 14KB
관리자 템플릿 관련 JS/HTML 부분
admin.php에서 include되는 템플릿 관리 UI 파편. 모달, 썸네일 생성, 순서 변경 기능.
admin.php include
// 번들러 캐싱 메커니즘$mtimes = array_map('filemtime', $files);
$etag = md5(implode(',', $mtimes)); // 파일 변경 시 ETag 자동 변경// → 브라우저가 304 Not Modified 받으면 네트워크 전송 없음// → 파일 수정하면 새 ETag → 자동으로 최신 번들 수신
09
🗂 데이터 디렉터리 구조
MySQL 등 외부 DB 없이 모든 데이터를 JSON 파일로 저장합니다. DATA_PATH = APP_ROOT/data
data/
├── members/← 회원 데이터
│ └── {uid}.json← uid: 12자리 랜덤 문자열 (예: tzyq274bug60)
│ { uid, nickname, google/kakao/naver 연결, points[], sub_expires, created_at }
│
├── invites/← 초대장 데이터
│ ├── _lookup/← invite_id → uid 빠른 조회용 stub 파일
│ │ └── {invite_id}← 파일 내용: uid 문자열만 저장
│ ├── _index.json← 구버전 폴백용 인덱스 (신규는 _lookup 사용)
│ └── {uid}/← 회원 UID별 서브디렉터리
│ └── {invite_id}.json← { id, uid, pages[], settings, created_at }
│
├── templates/← 기본 템플릿
│ ├── meta.json← 템플릿 목록 메타 (id, name, category, thumbnail)
│ └── tpl_{id}.json← 템플릿 데이터 { pages[], settings }
│
├── shared_templates/← 회원이 공개 등록한 공유 템플릿
│ └── shared_{id}.json
│
├── guestbook/← 방명록
│ └── {invite_id}_{page}.json← 페이지별 분할 저장
│
├── surveys/← 설문 응답
│ └── {invite_id}.json
│
├── lottery/← 복권 추첨 결과
│ └── {invite_id}.json
│
├── reactions/← 이모지 공감 카운트
│ └── {invite_id}.json
│
├── stats/← 조회수·공유수
│ ├── {invite_id}.json← { views, shares, last_view, last_share }
│ └── {invite_id}.json.lock← 동시 쓰기 방지 락 파일
│
├── notifications/← 회원별 알림
│ └── {uid}.json
│
├── deposits/← 무통장 입금 신청
│ └── pending.json
│
├── push/← Web Push 구독 엔드포인트
│ └── {uid}.json
│
├── uploads/← 업로드 이미지
│ └── {uid}/
│ └── image_{timestamp}.ext
│
└── maintenance_last.txt← 유지보수 배치 마지막 실행일 (중복 방지)