日本の技術者向けリンク共有・議論サイト。Hacker News の日本語クローン。
HN = Hacker Noroshi(Hacker News と同じイニシャル、意図的)。
DESIGN.md / CLAUDE.md の方針)story / ask / show を自動判定)/newpoll、選択肢 2-10 個、トグル投票)[deleted] になり本文が消える)[-] / [+] トグル、子孫数表示)/ フロントページ(HN ランキングアルゴリズム)/newest 新着順/best 高得点/active 議論中/front 日付別フロントページ/ask /show Ask HN / Show HN/asknew /shownew 新着 ask/show/newcomments /bestcomments /noobcomments コメント一覧/noobstories 新規ユーザーの投稿/highlights ハイライト(全期間の高得点コメント)/leaders 高 karma ユーザー/lists 一覧へのリンク集/from?site=domain ドメイン別投稿/search 検索(ストーリー + コメント)/user/[id])、submissions / comments / favorites / hidden 一覧[deleted] 化)/api/v0/{topstories,newstories,beststories,askstories,showstories,activestories}.json/api/v0/item/{id}.json、/api/v0/user/{username}.json*、HackerNews/API 互換/api-docs ページ/rss)| 層 | 技術 |
|---|---|
| Framework | SvelteKit (Svelte 5) |
| Hosting | Cloudflare Pages + Workers |
| DB | Cloudflare D1 (SQLite) |
| Auth | 自前(salt + sha256 + セッション Cookie) |
| Style | 素の CSS(pt 単位、Verdana、フラット) |
| Test | Vitest (unit) + Playwright (E2E) |
npm install
npm run db:init # D1 ローカル DB にスキーマ作成
npm run db:seed # テストデータ投入
npm run dev # 開発サーバー起動 (http://localhost:5173)
wrangler 経由で D1 バインディングが必要な場合:
npx wrangler pages dev -- npm run dev
公開 API は /api/v0/*.json で叩ける(例: curl http://localhost:5173/api/v0/topstories.json)。
npm run build
wrangler pages deploy
wrangler d1 execute hacker-noroshi-db --remote --file=db/schema.sql
wrangler d1 execute hacker-noroshi-db --remote --file=db/seed.sql
npm test # Vitest unit
npm run test:e2e # Playwright E2E (要 dev サーバー)
npm run test:e2e:ui # Playwright UI モード
| ファイル | 内容 |
|---|---|
| docs/spec.md | 機能仕様(投稿・コメント・投票・認証・編集・API) |
| DESIGN.md | デザインシステム(カラーパレット・タイポグラフィ・レイアウト) |
| docs/architecture.md | 技術構成・ルート・DB スキーマ・関数一覧 |
| docs/operations.md | デプロイ・DB 操作・運用手順 |
| docs/testing.md | テスト構成・実行方法 |
バグ・要望は GitHub Issues へ: https://github.com/kako-jun/hacker-noroshi/issues
MIT