> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.vpms.io/llms.txt
> Use this file to discover all available pages before exploring further.

# User Service API

> VPMS User 서비스 API 레퍼런스

## 개요

User Service는 VPMS(Vendit Property Management System) 클러스터의 사용자 관리 서비스로, 인증, 사용자 관리, 게시글, 알림 및 외부 연동을 위한 주요 기능을 제공합니다.

## 주요 기능

### 인증 및 보안

* SMS 인증 및 이메일 인증
* OTP(일회용 비밀번호) 관리
* 익명 로그인 및 서드파티 연동
* 토큰 기반 인증 시스템

### 사용자 관리

* 회원가입 및 로그인
* 사용자 정보 관리
* 직원 계정 관리
* 사용자 연락처 관리
* 사용자 활동 로그

### 게시글 및 알림

* 공지사항 및 게시글 관리
* 사용자 알림 시스템
* 파일 첨부 기능

### 검색

* Elasticsearch 기반 로그 저장

### 외부 연동

* 서드파티 시스템 통합
* PMS, CMS, 도어락, 주차 시스템 등 연동

## API 도메인

<CardGroup cols={2}>
  <Card title="인증 (Auth)" icon="key" href="/api-reference/user-svc/auth">
    SMS, 이메일, OTP 기반 인증 시스템
  </Card>

  <Card title="사용자 (User)" icon="user" href="/api-reference/user-svc/user">
    사용자 관리 및 프로필 설정
  </Card>

  <Card title="게시글 (Article)" icon="newspaper" href="/api-reference/user-svc/article">
    게시글 및 알림 관리
  </Card>

  <Card title="검색 (Search)" icon="magnifying-glass" href="/api-reference/user-svc/search">
    Elasticsearch 로그 저장
  </Card>

  <Card title="외부 연동 (Third Party)" icon="link" href="/api-reference/user-svc/third-party">
    외부 시스템 통합
  </Card>
</CardGroup>

## 기술 스택

* **API 타입**: GraphQL (Apollo Federation)
* **프레임워크**: Fastify + TypeScript
* **데이터베이스**: PostgreSQL + Prisma ORM
* **인증**: JWT 기반
* **검색**: Elasticsearch

## GraphQL Endpoint

```
POST https://development.vpms.io/graphql
```

<Info>
  GraphQL 공통 설정 및 인증 방법은 [GraphQL 설정 가이드](/api-reference/introduction)를 참고하세요.
</Info>

## 시작하기

User Service API를 사용하려면 먼저 인증이 필요합니다.

<Steps>
  <Step title="회원가입">
    [signUp](/api-reference/user-svc/user#signup)을 호출하여 계정 생성
  </Step>

  <Step title="로그인">
    [signIn](/api-reference/user-svc/user#signin)으로 인증 토큰 획득
  </Step>

  <Step title="API 호출">
    발급받은 토큰으로 다른 API 엔드포인트 호출
  </Step>
</Steps>

## 예제 코드

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { ApolloClient, InMemoryCache, gql } from '@apollo/client';

  const client = new ApolloClient({
    uri: 'https://development.vpms.io/graphql',
    cache: new InMemoryCache(),
    headers: {
      authorization: `Bearer ${YOUR_TOKEN}`,
    },
  });

  const SIGN_IN = gql`
    mutation SignIn($input: SignInInput!) {
      signIn(input: $input) {
        token {
          accessToken
          refreshToken
        }
      }
    }
  `;

  const { data } = await client.mutate({
    mutation: SIGN_IN,
    variables: {
      input: {
        identity: 'user@example.com',
        password: 'password123'
      }
    },
  });
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://development.vpms.io/graphql', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      query: `
        mutation SignIn($input: SignInInput!) {
          signIn(input: $input) {
            token {
              accessToken
              refreshToken
            }
          }
        }
      `,
      variables: {
        input: {
          identity: 'user@example.com',
          password: 'password123'
        }
      }
    })
  });

  const { data } = await response.json();
  ```
</CodeGroup>

## 관련 서비스

* [Core Service](/api-reference/core-svc/introduction) - 숙박 관리 핵심 기능
* [Booking Service](/api-reference/booking-svc/introduction) - 공개 구매 및 결제
* [Subscription Service](/api-reference/subscription-svc/introduction) - 구독 및 알림

## 지원

문의사항이 있으시면 [support@vendit.io](mailto:support@vendit.io)로 연락주세요.
