summaryrefslogtreecommitdiff
path: root/CLAUDE.md
diff options
context:
space:
mode:
Diffstat (limited to 'CLAUDE.md')
-rw-r--r--CLAUDE.md48
1 files changed, 48 insertions, 0 deletions
diff --git a/CLAUDE.md b/CLAUDE.md
new file mode 100644
index 0000000..03d2fb0
--- /dev/null
+++ b/CLAUDE.md
@@ -0,0 +1,48 @@
+# microblog
+
+個人用マイクロブログ。Markdown で投稿でき、XSS 対策済み。
+
+## 技術スタック
+
+- React Router v7 (SSR)
+- better-sqlite3 (SQLite)
+- marked + sanitize-html (Markdown → HTML 変換・サニタイズ)
+- Tailwind CSS v4 + カスタム CSS
+- Docker (node:20-alpine)
+
+## ルーティング
+
+| パス | ファイル | 説明 |
+|------|---------|------|
+| `/` | `app/routes/home.tsx` | 投稿フォーム + フィード |
+| `/api/posts` | `app/routes/api.posts.tsx` | REST API (GET / POST) |
+
+## API
+
+```
+GET /api/posts 全投稿取得 (JSON)
+POST /api/posts 投稿作成
+ Content-Type: application/json
+ Body: { "content": "Markdown text" }
+ → 201 { id, content, html, created_at }
+```
+
+## ローカル開発
+
+Node.js 20+ が必要。
+
+```bash
+npm install
+npm run dev # http://localhost:5173
+```
+
+## デプロイ
+
+```bash
+git push origin master
+# → /var/git/microblog.git post-receive
+# → GIT_WORK_TREE=/app/microblog git checkout -f
+# → docker compose up -d --build
+```
+
+本番 URL: https://blog.yyamashita.com