Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dashboards/open-brain-dashboard-next/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
node_modules/
.next/
.vercel/
.open-next/
.wrangler/
.env
.env.local
.env.local.example
Expand Down
24 changes: 24 additions & 0 deletions dashboards/open-brain-dashboard-next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,30 @@ Or connect the folder to Vercel via the dashboard. Set the environment variables
> [!TIP]
> The free Vercel tier is sufficient. The dashboard makes server-side API calls to your Open Brain REST endpoint — there's no heavy compute.

### Step 5 (alternative): Deploy to Cloudflare Workers (optional)

If you're already on Cloudflare for the [`open-brain-rest`](../../integrations/cloudflare-rest-worker/) gateway, you can host the dashboard on the same platform via the [`@opennextjs/cloudflare`](https://opennext.js.org/cloudflare) adapter. The older `@cloudflare/next-on-pages` adapter caps at Next 15.5.x and doesn't support this dashboard's Next 16.

The repo ships the two config files this needs out of the box (`open-next.config.ts` and `wrangler.jsonc`); rename the Worker in `wrangler.jsonc` if you want something other than `ob-dashboard`.

```bash
# 1. Make sure .env has NEXT_PUBLIC_API_URL set — it's read at *build*
# time and baked into the client bundle.
npx opennextjs-cloudflare build

# 2. First-time deploy creates the Worker.
npx opennextjs-cloudflare deploy

# 3. Set SESSION_SECRET as a *runtime* secret on the deployed Worker.
# (NEXT_PUBLIC_API_URL is build-time only, so no Worker secret for it.)
wrangler secret put SESSION_SECRET --name ob-dashboard
```

The dashboard ends up at `https://ob-dashboard.<your-cf-subdomain>.workers.dev`.

> [!TIP]
> `NEXT_PUBLIC_API_URL` is build-time, `SESSION_SECRET` is runtime. If you change the API URL later you have to rebuild and redeploy; rotating the session secret only needs `wrangler secret put`.

## Expected Outcome

When working correctly:
Expand Down
3 changes: 3 additions & 0 deletions dashboards/open-brain-dashboard-next/open-next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { defineCloudflareConfig } from "@opennextjs/cloudflare";

export default defineCloudflareConfig({});
Loading
Loading