Liveblocks Notion-like AI Editor

R
Renaudil y a 2 jours
0

Description

A Notion-like collaborative text editor with AI features built with Liveblocks, Lexical, Vercel AI SDK, and Next.js.

npx boilerapp liveblocks-notion-like-ai-editor

文档

Notion-like AI Editor (Lexical)

<p> <a href="https://liveblocks.io/examples/notion-like-ai-editor/nextjs-notion-like-ai-editor/preview"> <img src="https://img.shields.io/badge/live%20preview-message?style=flat&logo=data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE2Ljg0OSA0Ljc1SDBsNC44NDggNS4wNzV2Ny4wMDhsMTItMTIuMDgzWk03LjE1IDE5LjI1SDI0bC00Ljg0OS01LjA3NVY3LjE2N2wtMTIgMTIuMDgzWiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==&color=333" alt="Live Preview" /> </a> <a href="https://codesandbox.io/s/github/liveblocks/liveblocks/tree/main/examples/nextjs-notion-like-ai-editor"> <img src="https://img.shields.io/badge/open%20in%20codesandbox-message?style=flat&logo=codesandbox&color=333&logoColor=fff" alt="Open in CodeSandbox" /> </a> <img src="https://img.shields.io/badge/react-message?style=flat&logo=react&color=0bd&logoColor=fff" alt="React" /> <img src="https://img.shields.io/badge/next.js-message?style=flat&logo=next.js&color=07f&logoColor=fff" alt="Next.js" /> <img src="https://img.shields.io/badge/lexical-message?style=flat&color=7bf" alt="Lexical" /> </p>

This example shows how to build a collaborative text editor with an AI toolbar using Liveblocks, Lexical, Vercel AI SDK, and Next.js.

As users edit the document, changes will be automatically persisted and synced—allowing for an editor that updates in real-time across clients. Users will also be able to see who see each other’s cursors in the document. Query AI to generate improvements and new content.

<img src="https://raw.githubusercontent.com/liveblocks/liveblocks/main/.github/assets/examples/notion-like-ai-editor.png" width="536" alt="Collaborative Text Editor" />

Getting started

Run the following command to try this example locally:

npx create-liveblocks-app@latest --example nextjs-notion-like-ai-editor --api-key

This will download the example and ask permission to open your browser, enabling you to automatically get your API key from your liveblocks.io account.

Manual setup

<details><summary>Read more</summary> <p></p>

Alternatively, you can set up your project manually:

  • Install all dependencies with npm install
  • Create an account on liveblocks.io
  • Copy your secret key from the dashboard
  • Create an .env.local file and add your secret key as the LIVEBLOCKS_SECRET_KEY environment variable
  • Run npm run dev and go to http://localhost:3000
</details>

Deploy on Vercel

<details><summary>Read more</summary> <p></p>

To both deploy on Vercel, and run the example locally, use the following command:

npx create-liveblocks-app@latest --example nextjs-notion-like-ai-editor --vercel

This will download the example and ask permission to open your browser, enabling you to deploy to Vercel.

</details>

Develop on CodeSandbox

<details><summary>Read more</summary> <p></p>

After forking this example on CodeSandbox, create the LIVEBLOCKS_SECRET_KEY environment variable as a secret.

</details>

Prix

Gratuit

FREE

评论 (0)

常见问题

常见问题解答 (FAQ)

有问题?我们有答案。如果您找不到想要的答案,请随时联络我们。

Boilerapp 是一个专门用于分享 Boilerplates、入门套件(Starter Kits)和项目模版的开发者社区平台。我们的目标很简单:为您节省初始配置(Setup)的时间,让您可以专注于真正重要的代码。无论您是在寻找简单的代码库还是完整的 SaaS 项目,都能在这里找到。

还有其他问题?

我们的团队随时为您提供帮助。联络我们,我们将尽快回复。

Liveblocks Notion-like AI Editor | BoilerApp