Discord 自己紹介認証Bot システム構成

Discord 自己紹介認証Bot システム構成 An architecture diagram generated by Archify. GitHub · mainブランチ · CI/CD GitHub mainブランチ GitHub Actions · CI: Vitest / CD: デプロイ · CI/CD GitHub Actions CI: Vitest / CD: デプロイ Raspberry Pi 4 (Ubuntu) · 自宅サーバー・24時間稼働 · 自宅インフラ Raspberry Pi 4 (Ubuntu) 自宅サーバー・24時間稼働 新規参加者 · Discordクライアント · Architecture component 新規参加者 Discordクライアント Docker コンテナ · Bot プロセス (Node.js) · 自宅インフラ Docker コンテナ Bot プロセス (Node.js) Discord API / Gateway · Interactions · Architecture component Discord API / Gateway Interactions ロール付与 · Member権限 · Architecture component ロール付与 Member権限 管理ログチャンネル · Embed形式・DB不使用 · Architecture component 管理ログチャンネル Embed形式・DB不使用 ① push (main) ② Vitestテスト→デプロイ コンテナ起動 ③ 認証ボタン→モーダル入力→送信 ④ Interaction受信 (Button/Modal) ⑤ 成功時: ロール付与 (Discord API) ⑥ 成功/失敗をEmbedで記録 CI/CD 自宅インフラ Legend Frontend Backend Cloud Security External

認証フロー

  • • ③④⑤⑥: 参加者が認証ボタン→モーダル入力→送信すると、成功時のみMemberロールが自動付与される
  • • 失敗時はエラーをユーザーへ返し、ロールは付与しない

インフラ・運用

  • • ①②: mainへのpushをトリガーにGitHub ActionsがVitestで単体テストを実行し、自宅のRaspberry Pi 4(Ubuntu)上のDockerコンテナへ自動デプロイ
  • • 24時間365日、自宅サーバーで常時稼働

データの持ち方

  • • データベースは使わず、処理結果(成功/失敗)は管理チャンネルにEmbed形式で保存するだけの設計
  • • Discord APIに依存しないコアロジックはVitestで単体テスト済み