회원

메서드 엔드포인트 요청 데이터 설명 응답 / 렌더링 데이터
GET /join 없음 회원가입 페이지 렌더링 auth/join 렌더링 (errors)
POST /send-code phone 인증번호 문자 전송 JSON { message }
POST /verify-code phone, code 인증번호 확인 JSON { message }
POST /sign-up user_id, user_pw, user_pw_check, user_name, user_phone, verification_code, user_postcode, user_address, user_detailAddress, user_extraAddress, user_username 회원가입 처리 성공 시 리다이렉트 /login

실패 시 auth/join 렌더링 (errors) | | GET | /login | 없음 | 로그인 페이지 렌더링 | auth/login 렌더링 (errorId, errorPw) | | POST | /login | user_id, user_pw | 로그인 요청 | 성공 시 리다이렉트 / 실패 시 auth/login 렌더링 (errorId, errorPw) | | POST | /logout | 없음 | 로그아웃 처리 | 세션 제거 후 리다이렉트 / | | GET | /find-id | 없음 | 아이디 찾기 페이지 렌더링 | mypage/find-id 렌더링 (errors, successMessage) | | POST | /find-id | user_name, user_username | 아이디 찾기 요청 | 성공 시 successMessage

실패 시 errors 포함 렌더링 | | GET | /find-pw | userId | 비밀번호 찾기 페이지 렌더링 | mypage/find-pw 렌더링 (errors, successMessage, userId, changePwVisible) | | POST | /find-pw | user_id, user_name, user_username | 비밀번호 찾기 요청 | 성공 시 changePwVisible = true 실패 시 오류 메시지 렌더링 | | POST | /change-pw/:id | user_pw, user_check_pw | 비밀번호 변경 요청 | 성공 시 리다이렉트 /login 실패 시 mypage/find-pw 렌더링 (errors, userId) |

마이페이지

메서드 엔드포인트 요청 데이터 설명 응답 / 렌더링 데이터
GET /my-page 없음 마이페이지 메인 화면
렌더링유저의 정보, 구매내역,
게시글 표시 mypage/my-page 렌더링
user : 로그인 유저 전체 정보
posts
: 내가 쓴 게시글 배열
: 각 post에
shortContent, timeAgo, commentCount, authorProfile 포함
payments : 결제 내역 배열
POST /upload-profile-photo profilePhoto : 파일 프로필 사진 업로드 업로드된 파일 경로: /uploads/<파일명>
세션의 user_img 업데이트 후 /my-page 리다이렉트
GET /change-username 없음 닉네임 수정 페이지 렌더링 mypage/change-username 렌더링
user, message
POST /change-username username : 변경할 닉네임 닉네임 수정 처리닉네임 중복 검사
및 게시물, 댓글,
대댓글 작성자도 함께 수정 성공 시 세션 업데이트 후 /my-page
리다이렉트실패 시 mypage/change-username 렌더링message: "이미 사용 중인 닉네임입니다."
GET /change-name 없음 이름 수정 페이지 렌더링 mypage/change-name 렌더링
user
POST /change-name name : 변경할 이름 이름 수정 처리세션 업데이트
및 댓글, 대댓글 작성자 이름 변경 성공 시 /my-page 리다이렉트

커뮤니티

메서드 엔드포인트 요청 데이터 설명 응답 / 렌더링 데이터
GET /community 없음 커뮤니티 게시판 전체 조회 페이지 posts/community 렌더링
posts: 게시글 리스트
(각 글에 shortContent, timeAgo, commentCount, authorProfile )user: 세션 유저 정보
GET /community/:id :id 게시글 상세 조회 posts/community-detail 렌더링
post: 게시글 객체
(authorProfile, timeAgo, likes )
comments: 댓글 목록
(각 댓글에 timeAgo, authorProfile, replies)
commentCount: 댓글 수
user: 세션 유저
POST /community/:id/comment comment : 댓글 내용 특정 게시글에 댓글 작성 JSON 반환
_id, comment, author, authorProfile, time, timeAgo
POST /community/comment/:id/reply replyComment : 답글 내용 특정 댓글에 답글 작성 JSON 반환
_id, comment, author, authorProfile, time, timeAgo
POST /community/:id/like 없음 게시글 좋아요 / 좋아요 취소 JSON 반환업데이트된 게시글 객체
GET /insert-post 없음 게시글 작성 페이지 (관리자 전용) posts/insert-post 렌더링
POST /insert-post img1 ~ img5: 이미지 파일 최대 5개
content: 글 내용 커뮤니티 게시글 등록 (관리자만 가능) 성공 시 /community
리다이렉트실패 시 errors/500 렌더링

상점

메서드 엔드포인트 요청 데이터 설명 응답 / 렌더링
GET /shop 없음 모든 상품 목록 페이지 shop/shop 렌더링
products: 전체 상품 배열
user: 세션 유저
GET /product/:id :id 상품 상세 정보 페이지 shop/product_detail 렌더링
product: 해당 상품 정보
user: 세션 유저
GET /upload-product 없음 상품 업로드 폼 페이지 (관리자만) shop/upload-product 렌더링
POST /upload-product product_main_img,
product_img1~5: 이미지
product_name,
product_color,
product_price,
product_detail 상품 업로드 (이미지 포함, 관리자만) 성공: /shop 리다이렉트
실패: errors/500 렌더링

장바구니

메서드 엔드포인트 요청 데이터 설명 응답 / 렌더링
GET /cart 없음 장바구니 페이지 shop/cart 렌더링
cart_items,
cartTotalAmount,
cartTotalPrice
POST /add-to-cart productId 장바구니에 상품 추가세션
DB 동기화 JSON: { success: true }
POST /update-cart productId,
amount 장바구니 상품 수량 변경 JSON: { success: true, cartTotalAmount, totalPrice, updatedPrice }
POST /delete-cart-item productId 장바구니 상품 제거 JSON:
{ success: true, cartTotalAmount, totalPrice }

구매

메서드 엔드포인트 요청 데이터 설명 응답 / 렌더링
GET /purchase 없음 결제 페이지 (로그인 필수) shop/purchase 렌더링
userCart,
totalPrice,
totalAmount
POST /payment-success orderId,
address,
phone 결제 성공 시 호출 (서버에 결제 내역 저장) 성공 시 /success 리다이렉트
실패 시 /fail 리다이렉트
GET /success 없음 결제 성공 페이지 shop/success 렌더링
GET /fail 없음 결제 실패 페이지 shop/fail 렌더링

인증 요구

엔드포인트 요구 권한
/shop,
/product/:id 비로그인도 접근 가능
/cart,
/add-to-cart,
/update-cart, /delete-cart-item 로그인 없이도 가능
(세션 기반)
/upload-product (GET/POST) 관리자만 가능 checkAuth.requireAdmin
/purchase,
/payment-success,
/success,
/fail 로그인 필요 checkAuth.requireLogin
or
forceLogin