Skip to content

Commit c16b0c9

Browse files
CTNicholasnvie
andauthored
Examples: AI dashboard (#2454)
Co-authored-by: Vincent Driessen <[email protected]>
1 parent 0f7d9a1 commit c16b0c9

File tree

113 files changed

+66967
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+66967
-0
lines changed
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
.yarn/install-state.gz
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"printWidth": 80,
3+
"singleQuote": false,
4+
"trailingComma": "all",
5+
"endOfLine": "lf",
6+
"semi": false,
7+
"tabWidth": 2,
8+
"plugins": ["prettier-plugin-tailwindcss"],
9+
"tailwindFunctions": ["tv", "cx"]
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2025 Tremor Labs, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/** @type {import('next').NextConfig} */
2+
3+
const nextConfig = {
4+
redirects: async () => {
5+
return [
6+
{
7+
source: "/",
8+
destination: "/reports",
9+
permanent: true,
10+
},
11+
];
12+
},
13+
images: {
14+
remotePatterns: [
15+
{
16+
protocol: "https",
17+
hostname: "images.unsplash.com",
18+
port: "",
19+
pathname: "/**",
20+
},
21+
{
22+
protocol: "https",
23+
hostname: "liveblocks.io",
24+
port: "",
25+
pathname: "/avatars/**",
26+
},
27+
],
28+
},
29+
};
30+
31+
export default nextConfig;

0 commit comments

Comments
 (0)