깐부대출 API 명세서 (최종본)

server.js 소스 코드를 직접 분석하여 작성된 API 명세입니다.

1. 인증 (Authentication)

본 프로젝트의 모든 인증은 authenticateUser 미들웨어를 통해 처리됩니다. API 호출 시 HTTP 헤더에 Supabase에서 발급받은 JWT를 포함해야 합니다.


2. 사용자 및 친구 (User & Friends)

POST /api/friends/add

GET /api/friends

GET /api/friends/received

PATCH /api/friends/request


3. P2P 대출 (Peer-to-Peer Loans)

POST /createLoan

GET /approveLoan

POST /loan/repay

GET /myLoans

GET /queryAllLoans


4. 대출 풀 (Loan Pools)

POST /createPool

POST /joinPool

GET /QueryPoolsByUser


5. 계약서 및 검증 (Contract & Verification)

POST /api/contract/save

GET /api/transaction/:txHash


6. 기타 API

POST /check-email

POST /api/inquiry