Skip to content

Postgres Self-hosting Dashboard Demo - #26

Merged
yoen-velt merged 2 commits into
mainfrom
self-hosting-postgres
Dec 22, 2025
Merged

yoen-velt merged 2 commits into
mainfrom
self-hosting-postgres

Conversation

@yoen-velt

@yoen-velt yoen-velt commented Dec 19, 2025 •

Copy link
Copy Markdown
Contributor

Pull Request

Description

Type of Change

  • New demo application
  • Bug fix
  • Feature enhancement
  • Documentation update
  • Infrastructure/tooling change
  • Other (please describe):

Monorepo Structure Checklist

If adding a new demo, ensure you've followed the 5-level structure:

  • Placed in correct path: apps/<framework>/<document>/<type>/<implementation>/<library-or-solution>/<demo>/
  • Updated package.json with scoped name: @apps/<framework>-<document>-<library-or-solution>-<demo>
  • Created comprehensive README.md in the demo directory
  • Verified build passes: pnpm --filter <package-name> build
  • Verified dev server runs: pnpm --filter <package-name> dev

Deployment Checklist

If this demo should be deployed:

  • Added/updated Vercel project configuration
  • Updated GitHub Actions workflows (if applicable)
  • Verified deployment paths in CI/CD configs

Testing

  • Tested locally with pnpm -w install && pnpm -w build
  • Verified all affected apps still build
  • Tested dev servers for affected apps

Documentation

  • Updated relevant documentation (if needed)
  • Added demo to master-sample-app (if applicable)
  • Updated deployment docs (if applicable)

Related Issues

Screenshots/Videos

Additional Context


For Reviewers

Demo Location

Path: apps/<framework>/<document>/<type>/<implementation>/<library-or-solution>/<demo>/

Package name: @apps/<...>

How to Test

# Install dependencies
pnpm -w install

# Run the specific demo
pnpm --filter @apps/<package-name> dev

# Build the specific demo
pnpm --filter @apps/<package-name> build

Structure Verification

The demo follows the 5-level hierarchy:

  1. Framework:
  2. Document:
  3. Type:
  4. Implementation:
  5. Library/Solution:
  6. Demo:

Documentation: See README_MONOREPO.md and docs/structure.md for more details on the monorepo structure.


Note

Introduces a Next.js Postgres-backed self-hosting dashboard demo with Velt comments and updates the Mongo demo’s document ID handling and error responses.

  • New Demo: apps/react/comments/dashboard/self-hosting/dashboard-postgres-demo
    • Frontend (Next.js 15):
      • Integrates Velt (VeltProvider, VeltComments, VeltCommentsSidebar, presence/tools) with custom UI (jobs table, detail modal, inline comments, sidebar, notifications).
      • Implements demo user auth context and document context (useCurrentDocument).
      • Wires comment data provider to self-hosted endpoints.
      • Adds Tailwind setup, global styles, icons, and app layout.
    • Backend (API Routes):
      • app/api/velt/comments/{get,save,delete}/route.ts: fetch, upsert, and delete comment annotations.
      • app/api/velt/comments/store.ts: PostgreSQL store with pool, table/init + indexes, getComments, saveComments (transactional upsert), deleteComment.
      • app/api/velt/token/route.ts: token proxy endpoint for Velt auth.
  • Existing Mongo Demo Tweaks:
    • Unifies document ID storage key and URL handling in app/document/DocumentContext.tsx.
    • Tightens VeltCommentDataProvider error handling to return failures on non-OK/exception.

Written by Cursor Bugbot for commit 356df05. This will update automatically on new commits. Configure here.

@vercel

vercel Bot commented Dec 19, 2025 •

Copy link
Copy Markdown


// [Velt] API key and auth token from environment variables
const NEXT_PUBLIC_VELT_API_KEY = "6xTcUFtlYAlCdh11zrKB";
const VELT_AUTH_TOKEN = "bd4d5226050470b6c658054fcdf1092a";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Hardcoded authentication token exposed in source code

The VELT_AUTH_TOKEN secret is hardcoded directly in the source code despite the comment claiming these values come from environment variables. This authentication token grants access to the Velt API and should never be committed to version control. The DATABASE_URL in store.ts correctly uses process.env, but these Velt credentials do not. This exposes the token to anyone with repository access and will persist in git history.

Fix in Cursor Fix in Web

@yoen-velt
yoen-velt merged commit 9684aa4 into main Dec 22, 2025
17 of 18 checks passed

This branch was successfully deployed

15 active deployments
Preview – sample-apps-reactflow-demo — 356df055 Deployed Dec 19, 2025 by vercel[bot]
Preview – sample-apps-tanstack-multiple-tools — 356df055 Deployed Dec 19, 2025 by vercel[bot]
Preview – sample-apps-ag-grid-comment-aggregation — 356df055 Deployed Dec 19, 2025 by vercel[bot]
Preview – sample-apps-tiptap-comments-demo — 356df055 Deployed Dec 19, 2025 by vercel[bot]
Preview – sample-apps-ag-grid-single-tool — 356df055 Deployed Dec 19, 2025 by vercel[bot]
Preview – sample-apps-ag-grid-multiple-tools — 356df055 Deployed Dec 19, 2025 by vercel[bot]
Preview – sample-apps-tanstack-single-tool — 356df055 Deployed Dec 19, 2025 by vercel[bot]
Preview – sample-apps-tanstack-comment-aggregation — 356df055 Deployed Dec 19, 2025 by vercel[bot]
Preview – sample-apps-tiptap-crdt-demo — 356df055 Deployed Dec 19, 2025 by vercel[bot]
Preview – sample-apps-lexical-comments-demo — 356df055 Deployed Dec 19, 2025 by vercel[bot]
Preview – sample-apps-codemirror-crdt-demo — 356df055 Deployed Dec 19, 2025 by vercel[bot]
Preview – sample-apps-dashboard-mongo-db-demo — 356df055 Deployed Dec 19, 2025 by vercel[bot]
Preview – sample-apps-slatejs-comments-demo — 356df055 Deployed Dec 19, 2025 by vercel[bot]
Preview – sample-apps-dashboard-demo — 356df055 Deployed Dec 19, 2025 by vercel[bot]
Preview – master-sample-app — 356df055 Deployed Dec 19, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant