feat: 회원가입 페이지 추가 + 카카오 전화번호 신청 문서

- /signup 회원가입 페이지 (이름 + 전화번호 + 개인정보 동의)
- /api/signup API (get_or_create_user + 세션 저장)
- 카카오 간편 가입 버튼 (카카오 로그인으로 가입)
- 홈 화면에 회원가입 메뉴 추가
- 이미 로그인 시 /signup 접근하면 마이페이지로 리다이렉트
- 카카오 전화번호 수집 신청용 수집 사유 + 시나리오 문서

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
thug0bin 2026-02-25 09:34:41 +09:00
parent c4fa655005
commit 2b3d8649ba
4 changed files with 608 additions and 0 deletions

View File

@ -535,6 +535,45 @@ def index():
)
@app.route('/signup')
def signup():
"""회원가입 페이지"""
if 'logged_in_user_id' in session:
return redirect(f"/my-page?phone={session.get('logged_in_phone', '')}")
return render_template('signup.html')
@app.route('/api/signup', methods=['POST'])
def api_signup():
"""회원가입 API"""
try:
data = request.get_json()
name = data.get('name', '').strip()
phone = data.get('phone', '').strip().replace('-', '').replace(' ', '')
if not name or not phone:
return jsonify({'success': False, 'message': '이름과 전화번호를 모두 입력해주세요.'}), 400
if len(phone) < 10:
return jsonify({'success': False, 'message': '올바른 전화번호를 입력해주세요.'}), 400
user_id, is_new = get_or_create_user(phone, name)
# 세션에 유저 정보 저장
session.permanent = True
session['logged_in_user_id'] = user_id
session['logged_in_phone'] = phone
session['logged_in_name'] = name
return jsonify({
'success': True,
'message': '가입이 완료되었습니다.' if is_new else '이미 가입된 회원입니다. 로그인되었습니다.',
'is_new': is_new
})
except Exception as e:
return jsonify({'success': False, 'message': f'오류가 발생했습니다: {str(e)}'}), 500
@app.route('/claim')
def claim():
"""

View File

@ -340,6 +340,14 @@
</div>
<div class="menu-arrow"></div>
</a>
<a href="/signup" class="menu-card">
<div class="menu-icon green">📝</div>
<div class="menu-text">
<div class="menu-title">회원가입</div>
<div class="menu-desc">전화번호 + 이름으로 간편 가입</div>
</div>
<div class="menu-arrow"></div>
</a>
<a href="/my-page" class="menu-card">
<div class="menu-icon purple">📊</div>
<div class="menu-text">

View File

@ -0,0 +1,482 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="theme-color" content="#6366f1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="청춘약국">
<link rel="manifest" href="/static/manifest.json">
<link rel="apple-touch-icon" href="/static/icons/icon-192.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/icons/icon-192.png">
<title>회원가입 - 청춘약국</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap" rel="stylesheet">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
background: #f5f7fa;
min-height: 100vh;
-webkit-font-smoothing: antialiased;
}
.app-container {
background: #ffffff;
min-height: 100vh;
max-width: 420px;
margin: 0 auto;
}
.header {
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
padding: 0 24px;
height: 56px;
display: flex;
align-items: center;
justify-content: space-between;
position: sticky;
top: 0;
z-index: 100;
}
.header-title {
color: #ffffff;
font-size: 18px;
font-weight: 700;
letter-spacing: -0.3px;
}
.btn-back {
color: rgba(255,255,255,0.9);
font-size: 14px;
font-weight: 500;
text-decoration: none;
}
.form-section {
padding: 32px 24px;
}
.form-title {
font-size: 22px;
font-weight: 700;
color: #212529;
letter-spacing: -0.5px;
margin-bottom: 8px;
}
.form-desc {
font-size: 14px;
color: #868e96;
line-height: 1.6;
letter-spacing: -0.2px;
margin-bottom: 32px;
}
.input-group {
margin-bottom: 20px;
}
.input-group label {
display: block;
font-size: 14px;
font-weight: 600;
color: #495057;
margin-bottom: 8px;
letter-spacing: -0.2px;
}
.input-group input {
width: 100%;
padding: 16px;
border: 1.5px solid #e9ecef;
border-radius: 12px;
font-size: 16px;
font-family: inherit;
color: #212529;
transition: border-color 0.2s;
-webkit-appearance: none;
}
.input-group input:focus {
outline: none;
border-color: #6366f1;
}
.input-group input::placeholder {
color: #adb5bd;
}
.phone-wrapper {
display: flex;
align-items: center;
gap: 8px;
}
.phone-prefix {
font-size: 16px;
font-weight: 600;
color: #495057;
white-space: nowrap;
padding: 16px 0 16px 4px;
}
.phone-wrapper input {
flex: 1;
}
.privacy-consent {
margin: 24px 0;
}
.checkbox-container {
display: flex;
align-items: flex-start;
gap: 10px;
cursor: pointer;
}
.checkbox-container input[type="checkbox"] {
width: 20px;
height: 20px;
margin-top: 2px;
accent-color: #6366f1;
flex-shrink: 0;
}
.consent-text {
font-size: 14px;
color: #495057;
line-height: 1.5;
letter-spacing: -0.2px;
}
.consent-text a {
color: #6366f1;
text-decoration: underline;
}
.btn-submit {
width: 100%;
padding: 18px;
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
color: #ffffff;
border: none;
border-radius: 14px;
font-size: 17px;
font-weight: 700;
font-family: inherit;
cursor: pointer;
letter-spacing: -0.3px;
transition: all 0.2s ease;
box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}
.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.divider {
text-align: center;
margin: 24px 0;
position: relative;
}
.divider span {
background: #fff;
padding: 0 16px;
color: #adb5bd;
font-size: 13px;
font-weight: 500;
position: relative;
z-index: 1;
}
.divider::before {
content: '';
position: absolute;
top: 50%;
left: 0;
right: 0;
height: 1px;
background: #e9ecef;
}
.btn-kakao {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
width: 100%;
padding: 16px;
background: #FEE500;
color: #191919;
border: none;
border-radius: 14px;
font-size: 16px;
font-weight: 600;
font-family: inherit;
cursor: pointer;
text-decoration: none;
letter-spacing: -0.3px;
transition: all 0.2s ease;
}
.btn-kakao:active { transform: scale(0.98); }
.alert {
display: none;
padding: 14px 16px;
border-radius: 12px;
font-size: 14px;
font-weight: 500;
margin-top: 16px;
letter-spacing: -0.2px;
}
.alert.error { background: #fff5f5; color: #e03131; }
.alert.success { background: #f0fdf4; color: #16a34a; }
.footer {
text-align: center;
padding: 16px 24px 24px;
}
.footer a {
color: #adb5bd;
font-size: 12px;
text-decoration: none;
}
/* 성공 화면 */
.success-screen {
display: none;
text-align: center;
padding: 60px 24px;
}
.success-icon {
width: 80px;
height: 80px;
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
border-radius: 50%;
margin: 0 auto 24px;
display: flex;
align-items: center;
justify-content: center;
animation: scaleIn 0.4s ease;
}
@keyframes scaleIn {
0% { transform: scale(0); opacity: 0; }
60% { transform: scale(1.1); }
100% { transform: scale(1); opacity: 1; }
}
@keyframes drawCheck {
to { stroke-dashoffset: 0; }
}
.success-icon svg {
width: 40px;
height: 40px;
fill: none;
stroke: #ffffff;
stroke-width: 3;
stroke-linecap: round;
stroke-linejoin: round;
}
.success-title {
font-size: 24px;
font-weight: 700;
color: #212529;
margin-bottom: 12px;
}
.success-desc {
font-size: 15px;
color: #868e96;
line-height: 1.6;
margin-bottom: 32px;
}
.success-buttons {
display: flex;
gap: 12px;
}
.success-buttons a {
flex: 1;
padding: 16px;
border-radius: 14px;
font-size: 15px;
font-weight: 600;
text-decoration: none;
text-align: center;
}
.btn-home-s { background: #f1f3f5; color: #495057; }
.btn-mypage-s { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
@media (max-width: 480px) {
.header {
padding-top: env(safe-area-inset-top, 0px);
height: calc(56px + env(safe-area-inset-top, 0px));
}
}
</style>
</head>
<body>
<div class="app-container">
<div class="header">
<div class="header-title">회원가입</div>
<a href="/" class="btn-back">홈으로</a>
</div>
<!-- 가입 폼 -->
<div id="signupForm">
<div class="form-section">
<div class="form-title">회원가입</div>
<div class="form-desc">
청춘약국 마일리지 서비스에 가입하세요.<br>
영수증 QR 스캔으로 포인트를 적립할 수 있습니다.
</div>
<form id="formSignup" onsubmit="return false;">
<div class="input-group">
<label for="name">이름</label>
<input type="text" id="name" placeholder="이름을 입력하세요" autocomplete="name" required>
</div>
<div class="input-group">
<label for="phone">전화번호</label>
<div class="phone-wrapper">
<span class="phone-prefix">010 -</span>
<input type="tel" id="phone"
placeholder="0000-0000"
inputmode="numeric"
maxlength="9"
autocomplete="tel"
required>
</div>
</div>
<div class="privacy-consent">
<label class="checkbox-container">
<input type="checkbox" id="privacyConsent" required>
<span class="consent-text">
<a href="/privacy" target="_blank">개인정보 수집·이용</a>에 동의합니다.
<br><span style="font-size:12px; color:#868e96;">전화번호, 이름을 마일리지 적립·조회 목적으로 수집합니다.</span>
</span>
</label>
</div>
<button type="submit" class="btn-submit" id="btnSubmit">가입하기</button>
</form>
<div class="divider"><span>또는</span></div>
<a href="/my-page/kakao/start" class="btn-kakao">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none">
<path d="M10 1C4.477 1 0 4.477 0 8.5c0 2.58 1.693 4.847 4.243 6.134l-1.084 3.97a.3.3 0 00.457.338L7.7 16.392c.75.112 1.52.17 2.3.17 5.523 0 10-3.477 10-7.562C20 4.477 15.523 1 10 1z" fill="#191919"/>
</svg>
카카오로 간편 가입
</a>
<div class="alert error" id="alertMsg"></div>
<div class="footer">
<a href="/privacy" target="_blank">개인정보 처리방침</a>
</div>
</div>
</div>
<!-- 성공 화면 -->
<div id="successScreen" class="success-screen">
<div class="success-icon">
<svg viewBox="0 0 52 52">
<path d="M14.1 27.2l7.1 7.2 16.7-16.8"
style="stroke-dasharray:100; stroke-dashoffset:100; animation: drawCheck 0.6s 0.3s ease forwards;"/>
</svg>
</div>
<div class="success-title">가입 완료!</div>
<div class="success-desc" id="successDesc"></div>
<div class="success-buttons">
<a href="/" class="btn-home-s">홈으로</a>
<a href="#" class="btn-mypage-s" id="btnMyPage">내 마일리지</a>
</div>
</div>
</div>
<script>
if('serviceWorker' in navigator){navigator.serviceWorker.register('/sw.js').catch(()=>{});}
const phoneInput = document.getElementById('phone');
const form = document.getElementById('formSignup');
const alertMsg = document.getElementById('alertMsg');
// 자동 하이픈
phoneInput.addEventListener('input', function(e) {
let v = e.target.value.replace(/[^0-9]/g, '');
if (v.length <= 4) e.target.value = v;
else e.target.value = v.slice(0, 4) + '-' + v.slice(4, 8);
});
form.addEventListener('submit', async function(e) {
e.preventDefault();
const name = document.getElementById('name').value.trim();
const raw = phoneInput.value.replace(/[^0-9]/g, '');
const phone = '010' + raw;
const consent = document.getElementById('privacyConsent').checked;
if (!name) return showAlert('이름을 입력해주세요.');
if (raw.length < 7) return showAlert('올바른 전화번호를 입력해주세요.');
if (!consent) return showAlert('개인정보 수집·이용에 동의해주세요.');
const btn = document.getElementById('btnSubmit');
btn.disabled = true;
btn.textContent = '가입 중...';
try {
const res = await fetch('/api/signup', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name, phone })
});
const data = await res.json();
if (data.success) {
document.getElementById('signupForm').style.display = 'none';
document.getElementById('successScreen').style.display = 'block';
document.getElementById('successDesc').innerHTML =
'<strong>' + name + '</strong>님, 환영합니다!<br>이제 영수증 QR을 스캔하면 포인트가 적립됩니다.';
document.getElementById('btnMyPage').href = '/my-page?phone=' + encodeURIComponent(phone);
} else {
showAlert(data.message || '가입 중 오류가 발생했습니다.');
btn.disabled = false;
btn.textContent = '가입하기';
}
} catch (err) {
showAlert('서버 연결에 실패했습니다.');
btn.disabled = false;
btn.textContent = '가입하기';
}
});
function showAlert(msg) {
alertMsg.textContent = msg;
alertMsg.style.display = 'block';
setTimeout(() => { alertMsg.style.display = 'none'; }, 4000);
}
</script>
</body>
</html>

View File

@ -0,0 +1,79 @@
# 카카오 개인정보 동의항목 - 전화번호 수집 신청
## 수집 사유 (신청 폼에 입력할 내용)
```
청춘약국 마일리지 적립 서비스에서 고객 식별을 위해 전화번호가 필요합니다.
[서비스 개요]
오프라인 약국(청춘약국)에서 의약품 구매 시 영수증 QR 코드를 스캔하면
구매금액의 3%를 마일리지 포인트로 적립해주는 서비스입니다.
[전화번호가 필요한 이유]
1. 고객 식별: 동일 고객의 마일리지를 하나의 계정으로 통합 관리하기 위해
전화번호를 고유 식별자로 사용합니다.
2. 포인트 조회: 고객이 마이페이지에서 자신의 적립 내역과 잔액을
전화번호로 조회합니다.
3. 오프라인 연계: 약국 방문 시 포인트 사용을 위해 전화번호로
본인 확인이 필요합니다.
[현재 상황]
전화번호를 카카오에서 받지 못하는 경우, 카카오 로그인 후
별도의 전화번호 입력 화면을 추가로 거쳐야 합니다.
카카오 계정의 전화번호를 직접 받을 수 있으면 입력 단계를
생략하여 사용자 경험이 크게 개선됩니다.
[수집 범위]
- 수집 항목: 전화번호 (카카오 계정에 등록된 번호)
- 이용 목적: 마일리지 적립 계정 식별 및 포인트 조회
- 보유 기간: 회원 탈퇴 시까지
- 제3자 제공: 없음
```
## 회원가입 시나리오 (회원가입 화면 설명용)
### 시나리오 1: 카카오 로그인으로 QR 적립 (메인 플로우)
```
1. 고객이 약국에서 의약품 구매 후 영수증을 받음
2. 영수증에 인쇄된 QR 코드를 스마트폰 카메라로 스캔
3. https://mile.0bin.in/claim?t=거래번호:인증코드 페이지 이동
4. "카카오로 적립하기" 버튼 클릭
5. 카카오 로그인 동의 화면 표시 (닉네임, 프로필, 이메일, 이름, 전화번호)
6-A. [전화번호 수집 가능 시] → 자동으로 마일리지 적립 완료
6-B. [전화번호 미수집 시] → 전화번호 입력 화면으로 이동 → 수동 입력 후 적립
7. 적립 완료 화면 표시 (적립 포인트, 총 잔액)
```
### 시나리오 2: 카카오 로그인으로 마이페이지 조회
```
1. https://mile.0bin.in 접속
2. "카카오로 시작하기" 클릭
3. 카카오 로그인 → 카카오 ID로 기존 회원 매칭
4. 마이페이지 이동 (적립 내역, 포인트 잔액 확인)
```
### 시나리오 3: PWA 앱에서 자동 적립 (재방문 고객)
```
1. 이전에 카카오 로그인으로 적립한 이력이 있는 고객
2. 홈 화면의 "청춘약국" PWA 앱에서 QR 스캔
3. 세션이 유지되어 있으므로 입력 없이 자동 적립 완료
```
## 제출 체크리스트
- [x] 회원가입 링크: `https://mile.0bin.in`
- [x] 개인정보 처리방침: `https://mile.0bin.in/privacy`
- [ ] 회원가입 화면 스크린샷: 카카오 로그인 버튼이 보이는 적립 화면 캡처
- `/claim?t=거래번호:인증코드` 페이지 또는 메인 페이지 캡처
- 개인정보가 보이면 마스킹 필요
- [ ] 수집 사유: 위 텍스트 복사하여 입력
## 스크린샷 촬영 가이드
회원가입 화면으로 제출할 스크린샷:
1. `https://mile.0bin.in` 메인 페이지 캡처 (카카오로 시작하기 버튼 포함)
2. 또는 적립 페이지 `/claim?t=xxx` 캡처 (카카오로 적립하기 버튼 + 개인정보 동의 체크박스 포함)
3. 캡처 시 개인정보(전화번호 등)가 보이면 마스킹 처리