{
  "meta": {
    "owner": "mai",
    "description": "Posimai 開発インフラ構成",
    "updated": "2026-04-01",
    "version": "2"
  },
  "nodes": [
    {
      "id": "ubuntu-pc",
      "label": "Ubuntu PC",
      "type": "device",
      "description": "常時起動の開発サーバー（実体）。posimai-dev・Claude Code 稼働中。Tailscale HTTPS でどこからでもアクセス可能。Syncthing でファイル同期。",
      "url": "https://100.77.11.43:3333",
      "health_url": "https://100.77.11.43:3333/api/health",
      "status": "active"
    },
    {
      "id": "posimai-dev",
      "label": "posimai-dev",
      "type": "service",
      "description": "ブラウザターミナル + Claude Code チャット。Ubuntu PC 上で常時稼働。音声入力・スラッシュコマンド・セッションログ対応。",
      "url": "https://100.77.11.43:3333",
      "health_url": "https://100.77.11.43:3333/api/health",
      "status": "active",
      "parent": "ubuntu-pc"
    },
    {
      "id": "syncthing-ubuntu",
      "label": "Syncthing",
      "type": "service",
      "description": "Ubuntu PC ↔ Windows PC のリアルタイムファイル同期。posimai-project フォルダを双方向同期。",
      "url": "http://100.77.11.43:8384",
      "status": "active",
      "parent": "ubuntu-pc"
    },
    {
      "id": "windows-pc",
      "label": "Windows PC",
      "type": "device",
      "description": "maita のメイン操作端末。Cursor / Claude Code / ブラウザで Ubuntu PC に接続して開発。Syncthing で posimai-project を同期。",
      "status": "active"
    },
    {
      "id": "android-phone",
      "label": "スマートフォン",
      "type": "device",
      "description": "PWA テスト・モバイル動作確認。Tailscale 経由で posimai-dev にアクセス。",
      "status": "active"
    },
    {
      "id": "synology",
      "label": "Synology NAS",
      "type": "device",
      "description": "ローカルバックアップサーバー。Gitea・Uptime Kuma をホスト。Ubuntu PC の rsync バックアップ受け先（毎日 3:00）。",
      "status": "active"
    },
    {
      "id": "gitea",
      "label": "Gitea",
      "type": "service",
      "description": "ローカル Git バックアップ。Synology 上で Docker 動作。全リポジトリのバックアップ用リモート。",
      "url": "http://100.76.7.3:3000",
      "status": "active",
      "parent": "synology"
    },
    {
      "id": "tailscale",
      "label": "Tailscale",
      "type": "network",
      "description": "デバイス間 VPN メッシュ。Ubuntu PC・Windows PC・スマートフォン・Synology・VPS を安全に接続。tailnet: tail72e846.ts.net",
      "status": "active"
    },
    {
      "id": "vps-xserver",
      "label": "VPS",
      "type": "server",
      "description": "Posimai API 本番サーバー。共同開発者 Eiji 提供。Ubuntu 25.04 / AMD EPYC 4コア / 5.8GB。Nginx + Docker 構成。",
      "url": "https://api.soar-enrich.com",
      "health_url": "https://api.soar-enrich.com",
      "status": "active"
    },
    {
      "id": "posimai-api",
      "label": "Posimai API",
      "type": "service",
      "description": "Node.js / Express。認証（Magic Link + WebAuthn）・記事・RSS・TTS・Journal API を提供。PostgreSQL 16 と接続。",
      "url": "https://api.soar-enrich.com",
      "status": "active",
      "parent": "vps-xserver"
    },
    {
      "id": "postgresql",
      "label": "PostgreSQL 16",
      "type": "service",
      "description": "VPS 本番 DB。articles / journal_posts / users / site_config / reading_history テーブル。自前認証も完全ホスト。",
      "status": "active",
      "parent": "vps-xserver"
    },
    {
      "id": "github",
      "label": "GitHub",
      "type": "cloud",
      "description": "ソースコード管理（posimai org）。push で Vercel 自動デプロイをトリガー。",
      "url": "https://github.com/posimai",
      "status": "active"
    },
    {
      "id": "vercel",
      "label": "Vercel",
      "type": "cloud",
      "description": "全 posimai-* PWA のホスティング・CDN・自動デプロイ。27 本稼働中。",
      "url": "https://vercel.com",
      "status": "active"
    },
    {
      "id": "posimai-apps",
      "label": "Posimai Apps (27)",
      "type": "app",
      "description": "brain / habit / pulse / feed / reader / journal / brief / daily / ambient / veil / lens / diff / clean / timer / digest / think / site / events / maps / tech-events / analytics / roadmap / together / atlas / dashboard / hotels など全 27 本。",
      "url": "https://posimai-dashboard.vercel.app",
      "status": "active",
      "parent": "vercel"
    },
    {
      "id": "supabase",
      "label": "Supabase",
      "type": "cloud",
      "description": "posimai-together のリアルタイムデータ・グループ共有機能のみ使用。Auth は自前 VPS に移行済み。",
      "status": "active"
    },
    {
      "id": "resend",
      "label": "Resend",
      "type": "cloud",
      "description": "Magic Link メール送信のみ利用。noreply@soar-enrich.com から配信。",
      "status": "active"
    },
    {
      "id": "stripe",
      "label": "Stripe",
      "type": "cloud",
      "description": "決済処理。共同開発者 Eiji と共有。アカウント済み・Kintone 連携実績あり。将来の課金機能向け。",
      "url": "https://stripe.com",
      "status": "active"
    },
    {
      "id": "posimai-store",
      "label": "Posimai Store",
      "type": "app",
      "description": "Posimaiアプリ販売LP。フリーミアム+買い切り¥500モデル。Ponshu Room を最初の販売対象とし Brain/Habit/Pulse も順次展開予定。Design A/B/C の3バリアント実装済み。",
      "url": "https://posimai-store.vercel.app",
      "status": "active",
      "parent": "vercel"
    }
  ],
  "edges": [
    { "from": "windows-pc",       "to": "tailscale",      "type": "connects", "label": "VPN" },
    { "from": "ubuntu-pc",        "to": "tailscale",      "type": "connects", "label": "VPN" },
    { "from": "android-phone",    "to": "tailscale",      "type": "connects", "label": "VPN" },
    { "from": "synology",         "to": "tailscale",      "type": "connects", "label": "VPN" },
    { "from": "vps-xserver",      "to": "tailscale",      "type": "connects", "label": "VPN" },

    { "from": "windows-pc",       "to": "ubuntu-pc",      "type": "connects", "label": "SSH / posimai-dev" },
    { "from": "android-phone",    "to": "posimai-dev",    "type": "connects", "label": "Tailscale HTTPS" },
    { "from": "windows-pc",       "to": "syncthing-ubuntu","type": "connects","label": "ファイル同期" },

    { "from": "posimai-dev",      "to": "ubuntu-pc",      "type": "runs-on" },
    { "from": "syncthing-ubuntu", "to": "ubuntu-pc",      "type": "runs-on" },

    { "from": "ubuntu-pc",        "to": "gitea",          "type": "push",    "label": "git push" },
    { "from": "ubuntu-pc",        "to": "github",         "type": "push",    "label": "git push" },
    { "from": "windows-pc",       "to": "gitea",          "type": "push",    "label": "git push" },
    { "from": "windows-pc",       "to": "github",         "type": "push",    "label": "git push" },
    { "from": "ubuntu-pc",        "to": "synology",       "type": "connects","label": "rsync backup" },

    { "from": "gitea",            "to": "synology",       "type": "runs-on" },
    { "from": "github",           "to": "vercel",         "type": "trigger", "label": "auto deploy" },
    { "from": "vercel",           "to": "posimai-apps",   "type": "hosts" },

    { "from": "posimai-api",      "to": "vps-xserver",   "type": "runs-on",  "label": "Docker" },
    { "from": "postgresql",       "to": "vps-xserver",   "type": "runs-on" },
    { "from": "posimai-api",      "to": "postgresql",    "type": "calls",    "label": "SQL" },
    { "from": "posimai-api",      "to": "resend",        "type": "calls",    "label": "Magic Link" },

    { "from": "posimai-apps",     "to": "posimai-api",   "type": "calls",    "label": "REST API" },
    { "from": "posimai-apps",     "to": "supabase",      "type": "calls",    "label": "realtime" },
    { "from": "posimai-apps",     "to": "stripe",        "type": "calls",    "label": "payment" },
    { "from": "posimai-store",   "to": "stripe",        "type": "calls",    "label": "Payment Link" },
    { "from": "posimai-store",   "to": "vercel",        "type": "runs-on" },

    { "from": "windows-pc",       "to": "vps-xserver",   "type": "connects", "label": "SSH" }
  ]
}
