Skip to content

feature: 백엔드 api 정의 및 프론트엔드 엔드포인트 전환#22

Merged
DaehyunKim96 merged 2 commits intomainfrom
feature/connect_backend
Mar 31, 2026
Merged

feature: 백엔드 api 정의 및 프론트엔드 엔드포인트 전환#22
DaehyunKim96 merged 2 commits intomainfrom
feature/connect_backend

Conversation

@Jaymyong66
Copy link
Copy Markdown
Contributor

@Jaymyong66 Jaymyong66 commented Mar 29, 2026

목적

  • 백엔드 api 정의 및 프론트엔드 엔드포인트 전환

주요 변경사항

터미널 1 — 백엔드:
  cd backend
  cargo run
  ▎ [web] listening on http://0.0.0.0:3000 로그가 뜨면 준비 완료.

터미널 2 — 프론트엔드:
env.example > .env로 변경 (사실 default 값이 있어서 로컬 테스트는 괜춘)
  cd frontend
  npm run dev
  ▎ http://localhost:5173/riskmesh/ 접속

테스트 확인 포인트:

  1. 백엔드 캐시 동작 확인:
    curl http://localhost:3000/health
    curl "http://localhost:3000/api/master-policies"
    curl "http://localhost:3000/api/flight-policies"
  2. SSE 스트림 확인:
    curl -N "http://localhost:3000/api/events"
    ▎ 30초마다 event: heartbeat 이벤트가 흘러야 정상. 온체인 데이터 변경 시 flight_policy_updated 이벤트
    수신.
  3. 프론트 확인:
    - 브라우저 DevTools → Network 탭에서 events 요청이 Pending(SSE 연결 유지) 상태인지 확인
    - 기존에 있던 api.devnet.solana.com 직접 요청이 사라졌는지 확인 (429 에러 해소)

FAQ
PoolStatus의 getTokenAccountBalance()는 여전히 Solana RPC 직접 호출. 이건 실제 토큰 잔액 조회이고:

  • 구독 루프가 아닌 1회성 fetch라서 429 원인이 아님
  • 백엔드에서 제공하려면 /api/pool-balances 같은 새 엔드포인트 필요

@Jaymyong66 Jaymyong66 requested a review from DaehyunKim96 March 29, 2026 13:10
@Jaymyong66 Jaymyong66 self-assigned this Mar 29, 2026
# Conflicts:
#	backend/Cargo.lock
#	backend/src/main.rs
#	backend/src/web.rs
@DaehyunKim96 DaehyunKim96 merged commit 2e57643 into main Mar 31, 2026
2 checks passed
@DaehyunKim96 DaehyunKim96 deleted the feature/connect_backend branch March 31, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants