1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
# whois.band
バンドとアーティストの情報を管理するシンプルなサイト。ログイン不要、誰でも編集可能。
## 機能
- バンド情報の登録・編集(バンド名、活動拠点、リンク、メンバー)
- アーティスト情報の独立管理(名前、リンク)
- UUID と slug の2種類の URL でアクセス可能
- 編集履歴管理(更新メッセージ + IP アドレス + JSON スナップショット)
## URL 構造
| URL | 内容 |
|---|---|
| `/` | バンド一覧 |
| `/bands/of/:uuid` | バンド詳細 (UUID) |
| `/bands/named/:slug` | バンド詳細 (slug) → UUID URL へリダイレクト |
| `/bands/of/:uuid/edit` | バンド編集 |
| `/bands/of/:uuid/history` | バンド編集履歴 |
| `/bands/new` | バンド新規作成 |
| `/artists/of/:uuid` | アーティスト詳細 (UUID) |
| `/artists/named/:slug` | アーティスト詳細 (slug) → UUID URL へリダイレクト |
| `/artists/of/:uuid/edit` | アーティスト編集 |
| `/artists/of/:uuid/history` | アーティスト編集履歴 |
| `/artists/new` | アーティスト新規作成 |
## API
サーバー起動中に JSON API で操作できます。
### バンド
```bash
# 一覧取得
curl http://localhost:5173/api/bands
# 新規作成
curl -X POST http://localhost:5173/api/bands \
-H "Content-Type: application/json" \
-d '{
"name": "バンド名",
"area": "Tokyo",
"status": "active",
"description": "説明文",
"links": [{"label": "Twitter", "url": "https://..."}],
"artists": [{"id": "<artist-uuid>", "role": "Vocal"}],
"message": "初回登録"
}'
```
### アーティスト
```bash
# 一覧取得
curl http://localhost:5173/api/artists
# 新規作成
curl -X POST http://localhost:5173/api/artists \
-H "Content-Type: application/json" \
-d '{"name": "アーティスト名", "links": [{"label": "Twitter", "url": "https://..."}]}'
```
`slug` は省略すると名前から自動生成。成功時は `201` + 作成したレコードの JSON を返します。slug 重複時は `409`。
## CLI
サーバー不要でローカルの DB に直接書き込みます。プロジェクトルートから実行してください。
```bash
# アーティスト登録
npm run add -- artist --name "アーティスト名"
# バンド登録
npm run add -- band --name "バンド名" --area Tokyo --status active
# JSON ファイルから一括インポート
npm run add -- import --file data.json
```
### 一括インポートの JSON 形式
```json
{
"artists": [
{"name": "アーティスト A", "links": [{"label": "Twitter", "url": "https://..."}]}
],
"bands": [
{
"name": "バンド X",
"area": "Tokyo",
"status": "active",
"artists": [{"name": "アーティスト A", "role": "Vocal"}],
"links": [{"label": "Twitter", "url": "https://..."}]
}
]
}
```
`artists` を先に処理するので、`bands` 側でアーティスト名を参照できます。既存のアーティスト(名前一致)はスキップ。
## 技術スタック
- [React Router v7](https://reactrouter.com/) (SSR フレームワーク)
- [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) (SQLite)
- [Tailwind CSS v4](https://tailwindcss.com/)
- TypeScript
## 開発
```bash
npm install
npm run dev # 開発サーバー起動 (http://localhost:5173)
npm run build # プロダクションビルド
npm run typecheck # 型チェック
```
DB ファイル (`whois.db`) はプロジェクトルートに自動生成されます。
## デプロイ
```bash
git push hetzner master
```
Hetzner サーバー上で `git push` フックにより自動ビルド・再起動。
|