hgzero/claude/sample-external-sequence.puml
djeon 3405d233ee 외부 시퀀스 설계 파일 정리 및 유저스토리 업데이트
- 기존 외부 시퀀스 설계 파일 삭제
- 유저스토리 수정
- 샘플 외부 시퀀스 파일 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 14:25:29 +09:00

126 lines
3.4 KiB
Plaintext

@startuml 로그인플로우
!theme mono
title 로그인 플로우 - 외부 시퀀스 다이어그램
actor "Mobile Client" as Client
participant "API Gateway" as Gateway
participant "User Service" as UserService
database "Redis Cache" as Redis
== 로그인 화면 접근 ==
Client -> Gateway: GET /login-page
activate Gateway
Gateway -> Client: 200 OK (로그인 화면)
deactivate Gateway
== 로그인 처리 ==
Client -> Gateway: POST /api/v1/users/auth/login\n{userId, password}
activate Gateway
Gateway -> UserService: 로그인 요청 전달
activate UserService
UserService -> UserService: 사용자 인증 처리\n(비밀번호 검증)
alt 인증 성공
UserService -> UserService: JWT 토큰 생성
UserService -> Redis: 세션 정보 저장\n(userId, token, TTL)
activate Redis
Redis -> UserService: 저장 완료
deactivate Redis
UserService -> Gateway: 200 OK\n{token, userId, profile}
Gateway -> Client: 로그인 성공\n{token, profile}
Client -> Client: 토큰 저장\n(localStorage)
Client -> Client: 대시보드로 이동
else 인증 실패
UserService -> Gateway: 401 Unauthorized\n{error: "아이디 또는 비밀번호를 확인해주세요"}
Gateway -> Client: 로그인 실패 메시지
alt 5회 연속 실패
UserService -> Redis: 계정 잠금 정보 저장\n(userId, lockTime: 30분)
UserService -> Gateway: 423 Locked\n{error: "30분간 계정 잠금"}
Gateway -> Client: 계정 잠금 안내
end
end
deactivate UserService
deactivate Gateway
== 로그인 상태 확인 ==
Client -> Gateway: GET /api/v1/users/profile\n(Authorization: Bearer {token})
activate Gateway
Gateway -> Gateway: JWT 토큰 검증
alt 토큰 유효
Gateway -> Redis: 세션 조회\n(userId)
activate Redis
Redis -> Gateway: 세션 정보 반환
deactivate Redis
Gateway -> UserService: 프로필 조회
activate UserService
UserService -> Gateway: 사용자 프로필 반환
deactivate UserService
Gateway -> Client: 200 OK\n{userId, name, email, avatar}
Client -> Client: 프로필 표시\n(헤더 아바타)
else 토큰 무효
Gateway -> Client: 401 Unauthorized
Client -> Client: 로그인 화면으로 이동
end
deactivate Gateway
== 로그아웃 처리 ==
Client -> Client: 로그아웃 확인 다이얼로그 표시
Client -> Gateway: POST /api/v1/users/auth/logout\n(Authorization: Bearer {token})
activate Gateway
Gateway -> UserService: 로그아웃 요청
activate UserService
UserService -> Redis: 세션 삭제\n(userId)
activate Redis
Redis -> UserService: 삭제 완료
deactivate Redis
UserService -> Gateway: 200 OK\n{message: "안전하게 로그아웃되었습니다"}
deactivate UserService
Gateway -> Client: 로그아웃 완료
deactivate Gateway
Client -> Client: 토큰 삭제\n(localStorage)
Client -> Client: 로그인 화면으로 이동
note right of Client
대시보드(01) 화면의 헤더에서
프로필 아바타를 클릭하면
드롭다운 메뉴가 표시됨:
- 내 정보 보기
- 프로필 편집
- 로그아웃
end note
note right of UserService
로그인 시 검증 사항:
- 아이디/비밀번호 확인
- 계정 잠금 상태 확인
- 연속 실패 횟수 체크
- JWT 토큰 생성 및 발급
end note
note right of Redis
캐시 저장 정보:
- 세션 정보 (토큰, 사용자ID)
- 로그인 실패 횟수
- 계정 잠금 상태
- TTL 기반 자동 만료
end note
@enduml