nocobase-realtime
できること
NocoBase 3のアプリとプラグインで、リアルタイム更新の設計を案内します。データや進捗が発生した時点で、ページに表示させたい開発者向けです。
使う場面
- ✓レコードが変わったとき、問い合わせをせずにページを更新させたいとき。
- ✓作業の進捗や個人向けの通知をリアルタイムで表示する必要があるとき。
- ✓ログを配信したり、複数のサーバープロセスにまたがって更新を送ったりしたいとき。
スキルのリンク
https://github.com/nocobase/nocobase/blob/v3-develop/packages/libs/realtime/skills/nocobase-realtime/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“新しい注文が保存されたら、数秒ごとに再読み込みせず注文ページが更新されるようにしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
AIはどのデータソースを正とするかを決めたうえで、サーバーのトピックとクライアントのフックを設定します。リアルタイムのイベントは短いヒントであり、必要なときにページが実際のデータを読み直します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
NocoBase Realtime
Use the installed package declarations as the API authority. Applications reuse the host server service through realtimeServiceToken from @nocobase/app-server/realtime and the host browser client through @nocobase/app-client. Do not create a socket or service per component. In a source workspace, this Skill lives under packages/libs/realtime/skills/nocobase-realtime; in generated applications, package Skills are synchronized copies.
Choose the data contract first
Identify the authoritative snapshot endpoint, its access policy, the committed writes that announce changes, and how a disconnected client catches up. Realtime events are transient hints; durable business data remains in its owning service. A successful publication means broker admission, not browser processing. Prefer small invalidations containing a record ID or revision over copying protected record contents into an event.
- Read server integration for topic declaration, resource authorization, transaction boundaries, limits and distributed deployment.
- Read client integration for query correctness, coalesced refresh, readiness, errors, manual retry and cleanup.
- Read business scenarios when choosing between snapshots, cursors, progress and periodic reconciliation.
- Read verification for meaningful acceptance cases and adapter recovery tests.
Boundaries to preserve
Register topics during provider boot and release them during shutdown. Unknown topics are denied. A user topic derives the subscriber's user from the authenticated connection; publishing uses the intended recipient, never a user ID supplied as subscription authority by the browser. Resource families reuse the HTTP endpoint's policy and recheck it on delivery.
Publish only after commit. Treat a notification failure separately from an already successful write; use the domain's durable job/outbox when announcements must be retried. Never skip distributed publication because this process has no subscribers. eventId supports tracing and bounded duplicate suppression; business revisions and persisted cursors own ordering and gap recovery.
Read snapshots after the topic's onReady, including initial subscription and reconnect. Transport onOpen is too early. For TanStack Query use refreshRealtimeQueries, which waits for pre-event reads and follows them with a new read. Return the actual refresh promise to the scheduler so failures and trailing events are observed.
Remove a poll only after identifying all its producers and failure recovery. Time-based expiry, external systems without announcements, bounded initialization waits and failed best-effort publication can still require reconciliation. A healthy WebSocket alone does not prove the snapshot is fresh.
よくある質問
リアルタイムのイベントにすべてのデータが含まれますか?
いいえ。イベントは短いヒントで、永続的なデータは通常のサービスに残ります。
これはOpenAIの音声機能向けですか?
いいえ。NocoBaseアプリの中でのリアルタイム更新のためのものです。
ブラウザの接続が切れたらどうなりますか?
スナップショットによる復旧を扱うため、再接続後にページが不足分を取り戻せると説明しています。
詳細
作者による元の説明
Design and implement live updates in NocoBase 3 applications and plugins using @nocobase/realtime, host client hooks and authorized server topics. Use for replacing business polling, snapshot recovery, task progress, personal notifications, streamed logs or multi-process fan-out. Not for OpenAI audio Realtime APIs.
repo: nocobase/nocobase
人気
- GitHubのスター
- 25k
- ランキング
- #10085
- ライセンス
- —
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
nocobase-app-development
25kエージェントが、NocoBase 3の完全なビジネスアプリケーションのために、ページ、ルーティング、データ、権限、テストを作れるよう支援します。
shadcn
25kエージェントが、公式のドキュメントとレジストリを使い、Webプロジェクトの shadcn/uiコンポーネントを見つけ、追加し、修正し、スタイルを整えられるよう支援します。
nocobase-app-plugin-development
25kエージェントが、既存のNocoBase 3アプリの中で、サーバー、クライアント、データベース、登録の部分を含むプラグインを作成し、保守できるよう支援します。
nocobase-app-upgrade
25kエージェントが、NocoBaseのアプリを新しいテンプレートのリリースにアップグレードし、テンプレートの変更を取り込みつつ、あなた自身の作業を保てるよう支援します。
似ているスキル
api-connector-builder
280kエージェントが既存のパターンに従って、新しいAPI連携を構築します。新しい方式を作らずに、もう一つ連携を追加したいときに使います。
api-design
280kエージェントがベストプラクティスに沿ってREST APIを設計できるようにします。APIの通信方法、エラーの表示方法、データの整理方法を決めるのに役立ちます。
backend-patterns
280kエージェントのサーバーサイドのアーキテクチャパターンとデータベースの最適化を支援します。サーバー上で動くコードを作成またはレビューするときに役立ちます。