Skip to content

API 패키지

패키지: @hereby/api | Fastify 5 + tRPC 11

HTTP와 WebSocket tRPC 엔드포인트, 업로드 파일 서빙, JWT 인증, 조직 범위 비즈니스 라우터를 제공하는 타입 안전 API 서버입니다.

런타임

  • Fastify 서버
  • /trpc HTTP 엔드포인트
  • /trpc-ws WebSocket 엔드포인트
  • /uploads/ 정적 파일 서빙
  • /health 헬스체크

서버는 부팅 전에 데이터베이스를 초기화하고 필요 시 업로드 디렉토리를 생성합니다.

미들웨어 및 설정

  • @fastify/helmet
  • @fastify/cors
  • @fastify/jwt
  • @fastify/rate-limit
  • @fastify/static

현재 주요 설정:

  • 10MB 바디 제한
  • 분당 100회 요청 제한
  • JWT 인증

라우터

현재 앱 라우터(packages/api/src/router.ts)는 57개의 최상위 라우터를 노출합니다.

  • account
  • platform
  • ai
  • auth
  • invite
  • inquiry
  • signup
  • organization
  • organizationHoliday
  • organizationParameter
  • team
  • teamDrive
  • teamManager
  • employee
  • eSign
  • payroll
  • payrollCellMemo
  • attendance
  • attendanceRate
  • workTimeClosing
  • salaryGrade
  • gradePromotion
  • overtime
  • offsiteWork
  • allowance
  • deduction
  • deductionImport
  • resignation
  • yearEndSettlement
  • fixedIncentive
  • itemCode
  • educationSubsidy
  • role
  • leaveRequest
  • annualLeavePromotion
  • conversation
  • message
  • document
  • notification
  • permissionRequest
  • nurseScheduler
  • generalAffairs
  • managementDashboard
  • moduleRegistry
  • shift
  • shiftGroup
  • deviceToken
  • storage
  • employeeCertification
  • certificationType
  • inventory
  • secomEvent
  • sheetView
  • sheetRow
  • sheetCell
  • sheetTemplate
  • documentTemplate

주요 기능

  • JWT 인증과 리프레시 토큰 흐름
  • 조직 범위 보호 프로시저
  • 팀 리더 범위 프로시저
  • 급여 생성, 검증, 확정, eCount 내보내기
  • AI 기반 급여율 갱신 보조
  • 비동기 간호 스케줄 자동 생성
  • 총무 공지, 교육, 업무, 확인 처리
  • 푸시 디바이스 등록
  • 메시징 WebSocket 구독