diff options
| author | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-06-19 15:18:55 +0900 |
|---|---|---|
| committer | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-06-19 15:18:55 +0900 |
| commit | 30f24e137ee2d1acec11a0da61e134f512ee02dd (patch) | |
| tree | 28bd91bde3ad883f9f8fa543fca4b25ed50d05e9 /CLAUDE.md | |
| parent | da4934ae84f8a81fe3f4f8b392a4a3dc3d566f30 (diff) | |
Initial implementation of microblog
Markdown-based personal microblog with REST API.
XSS protection via sanitize-html on server-side markdown rendering.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'CLAUDE.md')
| -rw-r--r-- | CLAUDE.md | 48 |
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 |
