Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/dev-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Dev Task
description: 개발 작업 정의
title: "[DEV] "
labels: ["dev"]

body:
- type: textarea
id: context
attributes:
label: Context
description: 이 작업이 필요한 이유
placeholder: ex) 로그인 API에서 토큰 만료 처리 필요
validations:
required: true

- type: textarea
id: scope
attributes:
label: Scope
description: 이번 작업에서 포함되는 범위
placeholder: |
- 로그인 API 수정
- 토큰 만료 처리
- 에러 메시지 개선
validations:
required: true

- type: textarea
id: implementation
attributes:
label: Implementation
description: 예상 구현 방식
placeholder: |
- middleware에서 토큰 검증
- refresh token 로직 추가

- type: textarea
id: todo
attributes:
label: Todo
placeholder: |
- [ ] API 수정
- [ ] 테스트 작성
- [ ] 문서 업데이트

- type: textarea
id: reference
attributes:
label: Reference
description: 참고 링크
placeholder: 관련 PR / 문서 / 디자인
25 changes: 25 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Context

이 작업이 필요한 이유를 작성해주세요.

## Scope

이번 PR에 포함된 범위를 작성해주세요.

-

## Implementation

구현 방식 또는 핵심 변경점을 작성해주세요.

-

## Todo

- [ ] 구현 완료
- [ ] 테스트 완료
- [ ] 문서/주석 반영 완료

## Reference

관련 이슈/문서/디자인 링크가 있다면 작성해주세요.
38 changes: 38 additions & 0 deletions .github/workflows/quality-gate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Quality Gate

on:
pull_request:
push:
branches:
- main

jobs:
verify:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Lint
run: pnpm lint

- name: Typecheck
run: pnpm typecheck

- name: Format check
run: pnpm format:check

- name: Build
run: pnpm build
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.next
node_modules
out
build
coverage
pnpm-lock.yaml
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"singleQuote": false,
"printWidth": 100,
"trailingComma": "all",
"arrowParens": "always"
}
94 changes: 94 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Collaboration Guide

이 문서는 이 저장소에서 협업할 때 지켜야 할 기본 규칙을 정리합니다.

## Quick Start

```bash
pnpm install
pnpm dev
```

작업 전/PR 전 필수:

```bash
pnpm check
pnpm build
```

## Project Structure

```text
src/
app/ # 라우팅, 페이지, 레이아웃, route handler
components/
ui/ # 재사용 가능한 작은 UI 컴포넌트
features/
auth/ # 인증 도메인
profile/ # 프로필/온보딩 도메인
chat/ # 채팅 도메인 (api/model/ui)
history/ # 히스토리 도메인
chapel/ # 채플 도메인
shell/ # 앱 셸/레이아웃 UI
lib/ # 범용 유틸리티
```

## Layer Rules

- `src/app`: 라우팅/조합만 담당합니다. 비즈니스 로직 금지.
- `src/components`: 프리미티브/작은 프레젠테이셔널 컴포넌트만 둡니다.
- `src/features`: 도메인 로직, 상태, API, 복합 UI를 둡니다.
- `src/lib`: 공통 유틸만 둡니다.

## Import Rules

허용:

- `src/app` -> `src/features`, `src/components`, `src/lib`
- `src/features` -> `src/components`, `src/lib`, same feature internals
- `src/components` -> `src/components/ui`, `src/lib`

금지:

- `src/components` -> `src/features` / `src/app`
- `src/lib` -> `src/app` / `src/features` / `src/components`

## Code Quality Rules

- ESLint + TypeScript strict + Prettier를 사용합니다.
- `any` 사용 금지(불가피하면 이유를 주석으로 남기고 최소 범위로 제한).
- 사용하지 않는 import/변수는 허용하지 않습니다.
- 타입 전용 import는 `import type`을 사용합니다.

주요 명령어:

```bash
pnpm lint
pnpm typecheck
pnpm format:check
pnpm check
```

## CI Gate

GitHub Actions(`.github/workflows/quality-gate.yml`)에서 아래를 강제합니다.

- `pnpm lint`
- `pnpm typecheck`
- `pnpm format:check`
- `pnpm build`

하나라도 실패하면 머지하지 않습니다.

## Issue / PR Workflow

- 신규 개발 작업은 `Dev Task` 이슈 템플릿 사용:
- `.github/ISSUE_TEMPLATE/dev-task.yml`
- PR 작성 시 PR 템플릿 사용:
- `.github/pull_request_template.md`
- PR에는 최소한 `Context`, `Scope`, `Implementation`, `Todo`, `Reference`를 채웁니다.

## Notes

- 기존 `TMI` 관련 기능/경로는 제거된 상태입니다.
- 새 기능 추가 시에도 위 레이어 규칙을 우선 적용합니다.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# AI순장 (AI Shepherd)
> "지식은 AI처럼, 마음은 순장처럼" — CCC의 비전과 새생활의 시작 흐름을 돕는 순모임 파트너.
# AI 씨앗 순장

## Collaboration

협업 규칙/폴더 구조/PR-이슈 작성 방식은 [CONTRIBUTING.md](./CONTRIBUTING.md) 참고

## Tech Stack

- Framework: Next.js 16 (App Router)
- State: Zustand
- UI: Tailwind CSS + shadcn/ui
- Streaming Markdown: Streamdown
- API: Dify Chat API (SSE) via Next Route Handler

## Environment Variables

`.env.local` 파일을 생성하고 아래 값을 설정하세요.

```
DIFY_BASE_URL=https://api.dify.ai/v1
DIFY_API_KEY=your_api_key_here
```

## Run

```
pnpm install
pnpm dev
```

## 구현 완료 후 확인 방법
1. 브라우저에서 `http://localhost:3000` 접속
2. 입력창에 메시지 전송 → 스트리밍 응답이 타이핑처럼 표시되는지 확인
3. “새 대화” 버튼 클릭 → 대화 초기화 및 새로운 conversation_id 생성 확인
4. 네트워크 오류 상황에서 인라인 에러 메시지 표시 확인
5. 다크모드 확인: `<html class="dark">` 적용 시 어두운 톤으로 변경되는지 확인
Loading
Loading