|
| 1 | +<p align="center"> |
| 2 | + <a href="https://liveblocks.io#gh-light-mode-only"> |
| 3 | + <img src="https://raw.githubusercontent.com/liveblocks/liveblocks/main/.github/assets/header-light.svg" alt="Liveblocks" /> |
| 4 | + </a> |
| 5 | + <a href="https://liveblocks.io#gh-dark-mode-only"> |
| 6 | + <img src="https://raw.githubusercontent.com/liveblocks/liveblocks/main/.github/assets/header-dark.svg" alt="Liveblocks" /> |
| 7 | + </a> |
| 8 | +</p> |
| 9 | + |
| 10 | +# AI chat in reports dashboard |
| 11 | + |
| 12 | +<p> |
| 13 | + <a href="https://liveblocks.io/examples/collaborative-text-editor/nextjs-ai-dashboard-reports"> |
| 14 | + <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" /> |
| 15 | + </a> |
| 16 | + <a href="https://codesandbox.io/s/github/liveblocks/liveblocks/tree/main/examples/nextjs-ai-dashboard-reports"> |
| 17 | + <img src="https://img.shields.io/badge/open%20in%20codesandbox-message?style=flat&logo=codesandbox&color=333&logoColor=fff" alt="Open in CodeSandbox" /> |
| 18 | + </a> |
| 19 | + <img src="https://img.shields.io/badge/react-message?style=flat&logo=react&color=0bd&logoColor=fff" alt="React" /> |
| 20 | + <img src="https://img.shields.io/badge/next.js-message?style=flat&logo=next.js&color=07f&logoColor=fff" alt="Next.js" /> |
| 21 | +</p> |
| 22 | + |
| 23 | +This example shows how to build a pop-up AI chat inside a reports dashboard with |
| 24 | +[Liveblocks](https://liveblocks.io), [Tremor](https://tremor.so/), and |
| 25 | +[Next.js](https://nextjs.org/). |
| 26 | + |
| 27 | +<img src="https://raw.githubusercontent.com/liveblocks/liveblocks/main/.github/assets/examples/ai-reports-dashboard.png" width="536" alt="AI reports dashboard" /> |
| 28 | + |
| 29 | +## Getting started |
| 30 | + |
| 31 | +Run the following command to try this example locally: |
| 32 | + |
| 33 | +```bash |
| 34 | +npx create-liveblocks-app@latest --example nextjs-ai-dashboard-reports --api-key |
| 35 | +``` |
| 36 | + |
| 37 | +This will download the example and ask permission to open your browser, enabling |
| 38 | +you to automatically get your API key from your |
| 39 | +[liveblocks.io](https://liveblocks.io) account. |
| 40 | + |
| 41 | +### Manual setup |
| 42 | + |
| 43 | +<details><summary>Read more</summary> |
| 44 | + |
| 45 | +<p></p> |
| 46 | + |
| 47 | +Alternatively, you can set up your project manually: |
| 48 | + |
| 49 | +- Install all dependencies with `npm install` |
| 50 | +- Create an account on [liveblocks.io](https://liveblocks.io/dashboard) |
| 51 | +- Copy your **secret** key from the |
| 52 | + [dashboard](https://liveblocks.io/dashboard/apikeys) |
| 53 | +- Create an `.env.local` file and add your **secret** key as the |
| 54 | + `LIVEBLOCKS_SECRET_KEY` environment variable |
| 55 | +- Run `npm run dev` and go to [http://localhost:3000](http://localhost:3000) |
| 56 | + |
| 57 | +</details> |
| 58 | + |
| 59 | +### Deploy on Vercel |
| 60 | + |
| 61 | +<details><summary>Read more</summary> |
| 62 | + |
| 63 | +<p></p> |
| 64 | + |
| 65 | +To both deploy on [Vercel](https://vercel.com), and run the example locally, use |
| 66 | +the following command: |
| 67 | + |
| 68 | +```bash |
| 69 | +npx create-liveblocks-app@latest --example nextjs-ai-dashboard-reports --vercel |
| 70 | +``` |
| 71 | + |
| 72 | +This will download the example and ask permission to open your browser, enabling |
| 73 | +you to deploy to Vercel. |
| 74 | + |
| 75 | +</details> |
| 76 | + |
| 77 | +### Develop on CodeSandbox |
| 78 | + |
| 79 | +<details><summary>Read more</summary> |
| 80 | + |
| 81 | +<p></p> |
| 82 | + |
| 83 | +After forking |
| 84 | +[this example](https://codesandbox.io/s/github/liveblocks/liveblocks/tree/main/examples/nextjs-ai-dashboard-reports) |
| 85 | +on CodeSandbox, create the `LIVEBLOCKS_SECRET_KEY` environment variable as a |
| 86 | +[secret](https://codesandbox.io/docs/secrets). |
| 87 | + |
| 88 | +</details> |
| 89 | + |
| 90 | +## Tremor |
| 91 | + |
| 92 | +This project uses |
| 93 | +[`Tremor Raw`](https://raw.tremor.so/docs/getting-started/installation) |
| 94 | +components for the UI. |
| 95 | + |
| 96 | +### License |
| 97 | + |
| 98 | +This site template is a commercial product and is licensed under the |
| 99 | +[Tremor License](https://blocks.tremor.so/license). |
| 100 | + |
| 101 | +### Learn more |
| 102 | + |
| 103 | +For a deeper understanding of the technologies used in this template, check out |
| 104 | +the resources listed below: |
| 105 | + |
| 106 | +- [Tremor Raw](https://raw.tremor.so) - Tremor Raw documentation |
| 107 | +- [Tailwind CSS](https://tailwindcss.com) - A utility-first CSS framework |
| 108 | +- [Next.js](https://nextjs.org/docs) - Next.js documentation |
| 109 | +- [Radix UI](https://www.radix-ui.com) - Radix UI Website |
| 110 | +- [Recharts](https://recharts.org) - Recharts documentation and website |
| 111 | +- [Tanstack](https://tanstack.com/table/latest) - TanStack table documentation |
0 commit comments