Skip to content
Open
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
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: バグ報告
description: バグの報告
labels: ["type: bug"]
body:
- type: textarea
attributes:
label: 概要
description: 何が起きているか
validations:
required: true
- type: textarea
attributes:
label: 再現手順
description: バグを再現する手順
value: |
1.
2.
3.
validations:
required: true
- type: textarea
attributes:
label: 期待する動作
description: 本来どうなるべきか
validations:
required: true
- type: textarea
attributes:
label: スクリーンショット
description: あれば貼ってください
validations:
required: false
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 機能追加・改善
description: 新機能の追加や既存機能の改善
labels: ["type: feature"]
body:
- type: textarea
attributes:
label: 概要
description: 何をしたいか
validations:
required: true
- type: textarea
attributes:
label: 背景・理由
description: なぜ必要か
validations:
required: true
- type: textarea
attributes:
label: 実現イメージ
description: スクリーンショットやモックがあれば貼ってください
validations:
required: false
14 changes: 14 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## 概要
<!-- このPRで何をしたか、1〜3行で -->

## 変更内容
<!-- 箇条書きで具体的に -->
-

## 関連 Issue
<!-- 以下のどちらかで Issue と紐付けてください -->
<!-- 方法1: ここに「closes #番号」と書く(マージ時に自動クローズ) -->
<!-- 方法2: 右サイドバーの「Development」から Issue をリンクする -->

## 動作確認
<!-- 確認した手順。スクショや動画があれば貼る -->
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules/
dist/
.env
*.js.map
.DS_Store
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Contributing

## はじめに

環境構築がまだの場合は、まずこちらを参照してください。

→ [docs/setup.md](docs/setup.md)

## 開発ルール

ブランチ・コミット・PR・Issue の運用ルールはこちら。

→ [docs/development-rule.md](docs/development-rule.md)
157 changes: 157 additions & 0 deletions docs/development-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# 開発ルール

このドキュメントは KC3-2026(Real You)の開発ルールをまとめたものです。
チームメンバー全員がこのルールに沿って開発を進めます。

## ブランチ運用

- デフォルトブランチは `develop`
- 作業は必ずブランチを切って行い、PR 経由で `develop` にマージする
- `develop` に直接コミットしない

### ブランチの命名規則

`<type>/<短い説明>` の形式で付ける。説明は英語で短く。

| type | 用途 | 例 |
|------|------|-----|
| `feature/` | 新機能の追加 | `feature/add-share-button` |
| `fix/` | バグ修正 | `fix/result-display-error` |
| `docs/` | ドキュメントの追加・修正 | `docs/add-setup-guide` |
| `refactor/` | リファクタリング | `refactor/cleanup-game-logic` |
| `chore/` | 設定変更・雑務 | `chore/update-dependencies` |

### ブランチの作り方(コマンド例)

```bash
# develop を最新にする
git checkout develop
git pull origin develop

# 新しいブランチを作成
git checkout -b feature/add-share-button
```

## コミットメッセージ

英語の prefix + 日本語の本文で書く。

### 形式

```
<prefix>: <日本語で変更内容>
```

### prefix 一覧

| prefix | 用途 | 例 |
|--------|------|-----|
| `feat:` | 新機能 | `feat: SNSシェアボタンを追加` |
| `fix:` | バグ修正 | `fix: 結果画面が表示されない問題を修正` |
| `docs:` | ドキュメント | `docs: 環境構築手順を追加` |
| `style:` | スタイル調整(機能変更なし) | `style: ボタンの余白を調整` |
| `refactor:` | リファクタリング | `refactor: ゲームロジックを整理` |
| `chore:` | 設定・雑務 | `chore: パッケージを更新` |

### コミットの粒度

- 1 つの論理的な変更につき 1 コミット
- 「あれもこれも」と 1 コミットに詰め込まない
- こまめにコミットする(変更を放置しない)

## 開発コマンド

### Frontend

```bash
cd frontend
```

| コマンド | 用途 | いつ使う? |
|---------|------|----------|
| `npm run dev` | 開発サーバー起動(ホットリロードあり) | 普段の開発 |
| `npm run build` | 本番用ビルド | PR 前チェック、デプロイ前 |
| `npm start` | ビルド済みアプリを本番モードで起動 | build の成果物を確認したいとき |
| `npm run lint` | ESLint でコードチェック | PR 前チェック |
| `npm run format` | Prettier でコード整形 | コード整形したいとき |
| `npm run format:check` | Prettier で整形チェック(変更なし) | CI 用 |

### Backend

```bash
cd backend
```

| コマンド | 用途 | いつ使う? |
|---------|------|----------|
| `npm run dev` | 開発サーバー起動(自動リロードあり) | 普段の開発 |
| `npm run build` | TypeScript → JavaScript にコンパイル | PR 前チェック、デプロイ前 |
| `npm start` | ビルド済みアプリを起動 | build の成果物を確認したいとき |

### PR 前チェック

PR を出す前に以下を実行してエラーがないことを確認する。

```bash
# Frontend
cd frontend
npm run lint
npm run build

# Backend
cd ../backend
npm run build
```

## Pull Request

- 基本的には `develop` ブランチに向けて PR を出す
- PR はテンプレートに沿って書く(`.github/PULL_REQUEST_TEMPLATE.md` が自動で反映される)
- レビューが通ってからマージする

### PR のサイズ目安

- 変更ファイル: 10 個以下
- 変更行数: 300 行以下

大きくなりそうな場合は Issue を分割して、PR も分ける。

## Issue

### Issue の作成ルール

- バグ報告・新機能・改善提案は Issue テンプレートに沿って作成する
- タイトルは何が問題か / 何をしたいかが一目でわかるように書く
- 良い例: 「結果画面のレーダーチャートが表示されない」
- 悪い例: 「バグ」「表示がおかしい」

### ラベル運用

Issue には以下の 3 軸からラベルを付ける。**カテゴリと種別は必ず付ける。** 優先度は相談して決める。

#### カテゴリ(何を変えるか)

| ラベル | 用途 |
|-------|------|
| `cat: frontend` | フロントエンドの変更 |
| `cat: backend` | バックエンドの変更 |
| `cat: design` | デザイン・UI/UX の変更 |
| `cat: infra` | デプロイ・CI/CD・環境系 |
| `cat: docs` | ドキュメントのみの変更 |

#### 種別(何をするか)

| ラベル | 用途 |
|-------|------|
| `type: bug` | バグ修正 |
| `type: feature` | 新機能追加 |
| `type: improve` | 既存機能の改善・UX 向上 |
| `type: refactor` | リファクタリング |

#### 優先度(技育博に向けてどれが重要か)

| ラベル | 基準 |
|-------|------|
| `priority: high` | デモに必須。これがないと見せられない |
| `priority: mid` | あると体験が良くなる |
| `priority: low` | 余裕があればやる |
66 changes: 66 additions & 0 deletions docs/setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# 環境構築

## 前提

- Mac
- Git がインストール済み
- Node.js がインストール済み(未インストールの場合は [公式サイト](https://nodejs.org/) からインストール)

## 1. リポジトリのクローン

```bash
git clone https://github.com/kc3hack/2026_team6.git
cd 2026_team6
```

## 2. Frontend のセットアップ

```bash
cd frontend
npm install
```

### 環境変数の設定

```bash
cp .env.local.example .env.local
```

必要な環境変数は `.env.local.example` を参照してください。

## 3. Backend のセットアップ

```bash
cd ../backend
npm install
```

### 環境変数の設定

```bash
cp .env.example .env
```

必要な環境変数は `.env.example` を参照してください。各キーの値は管理者に確認してください。

## 4. 起動確認

ターミナルを 2 つ開いて、それぞれで起動する。

### Backend(先に起動)

```bash
cd backend
npm run dev
```

`http://localhost:3001/health` にアクセスして、レスポンスが返ってくれば OK。

### Frontend

```bash
cd frontend
npm run dev
```

`http://localhost:3000` にアクセスして、トップページが表示されれば OK。
1 change: 1 addition & 0 deletions frontend/.env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_API_URL=http://localhost:3001
1 change: 1 addition & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ yarn-error.log*

# env files (can opt-in for committing if needed)
.env*
!.env.local.example

# vercel
.vercel
Expand Down
Loading