Build an advanced to-do application with OSDK(使用 OSDK 构建高级待办事项应用)¶
The advanced to-do application, available in VS Code workspaces, demonstrates how to use advanced features of the Ontology SDK (OSDK) by building a to-do application as a practical example. You will learn about many OSDK features, including those discussed in the following documentation sections:

The application reference documentation is divided into the following sections:
Architecture and configuration: The architecture and configuration overview provides a summary of the configurations, required installations, and application architecture of the advanced to-do application.
useProjects: The useProjects hook provides a comprehensive interface for managing to-do projects within a React application. This hook leverages the Ontology SDK (OSDK) to interact with a backend service, offering functionality to fetch, create, and delete projects along with real-time statistics about the tasks within each project.
useTasks: The useTasks hook is a custom React hook that manages tasks associated with a specific project in the to-do application. It leverages the OSDK to fetch task data, associate it with user information, and provide real-time updates through subscriptions. The hook is designed to work with the SWR (stale-while-revalidate) strategy for efficient data fetching, caching, and state management.
useCodingTask: The useCodingTask hook is a custom React hook that provides functionality for fetching and managing coding task data in the to-do application. The hook enriches the basic task data with user information and metadata.
useLearningTask: The useLearningTask hook is a custom React hook that provides functionality for fetching and managing learning task data in the to-do application. The hook enriches basic task data with user information, media content, and metadata.
useAdmin: The useAdmin hook is a custom React hook that provides functionality for fetching and managing user data from the Foundry Admin API. It leverages the SWR (stale-while-revalidate) library for efficient data fetching and caching.
中文翻译¶
使用 OSDK 构建高级待办事项应用¶
高级待办事项应用(可在 VS Code 工作区 中获取)通过构建一个待办事项应用作为实践示例,展示了如何使用本体论 SDK (OSDK) 的高级功能。您将了解 OSDK 的众多特性,包括以下文档章节中讨论的内容:
- 本体论接口 (Ontology interfaces)
- 使用媒体集 (Media Sets) 处理媒体内容
- 运行时派生属性 (Runtime-derived properties)
- 平台 SDK (Platform SDKs)

该应用的参考文档分为以下几个部分:
架构与配置: 架构与配置概述提供了高级待办事项应用的配置、所需安装项以及应用架构的总结。
useProjects: useProjects 钩子 (Hook) 为在 React 应用中管理待办项目提供了全面的接口。该钩子利用本体论 SDK (OSDK) 与后端服务交互,提供获取、创建和删除项目的功能,以及每个项目中任务的实时统计信息。
useTasks: useTasks 钩子是一个自定义 React 钩子,用于管理待办应用中与特定项目关联的任务。它利用 OSDK 获取任务数据,将其与用户信息关联,并通过订阅提供实时更新。该钩子设计采用 SWR (stale-while-revalidate) 策略,以实现高效的数据获取、缓存和状态管理。
useCodingTask: useCodingTask 钩子是一个自定义 React 钩子,提供在待办应用中获取和管理编码任务数据的功能。该钩子通过用户信息和元数据丰富了基础任务数据。
useLearningTask: useLearningTask 钩子是一个自定义 React 钩子,提供在待办应用中获取和管理学习任务数据的功能。该钩子通过用户信息、媒体内容和元数据丰富了基础任务数据。
useAdmin: useAdmin 钩子是一个自定义 React 钩子,提供从 Foundry 管理 API (Admin API) 获取和管理用户数据的功能。它利用 SWR (stale-while-revalidate) 库实现高效的数据获取和缓存。