Overview
By default, all projects are private and only accessible to the project owner. When you make a project public:- A unique, unguessable URL is generated
- Anyone with the link can view the dashboard
- No authentication is required for viewers
- The dashboard is read-only (viewers cannot edit)
- You can regenerate the link to revoke old access
Requirements: Projects must have at least one valid database connection to be made public. This ensures viewers can see live data.
Project Privacy States
Projects exist in one of two states:Private Projects
- Only accessible to the project owner
- Requires authentication to view
- No public URL generated
Public Projects
- Accessible to anyone with the link
- Public URL:
/public/a8f3j2k9x7q1 - 12-character random identifier (nanoid)
Making a Project Public
You can toggle project visibility from the project dashboard.Enable Public Access
Toggle the “Public Dashboard” switch to ON.The system will:
- Verify at least one valid database connection exists
- Generate a unique 12-character ID using nanoid
- Update the project:
isPublic: true,idPublic: "abc123..." - Display the public URL
Share Dialog Implementation
Fromsrc/components/projects/dialogs/shareProjectDialog.tsx:36-159:
Public Link Generation
When you enable public access, VizBoard generates a unique identifier.ID Generation Algorithm
Fromsrc/app/api/projects/[projectId]/public/route.ts:6-64:
Why nanoid?
- Unguessable: 12 characters = ~2.2 trillion possible combinations
- URL-safe: Uses alphanumeric characters (A-Za-z0-9)
- Collision-resistant: Extremely low probability of duplicates
- Fast: High-performance ID generation
Regenerating Public Links
If you need to revoke access to a public link, you can regenerate it.Confirm Regeneration
A new 12-character ID is generated, replacing the old one.The old link (
/public/old-id) immediately stops working.Regeneration Code
Fromsrc/components/projects/dialogs/shareProjectDialog.tsx:73-93:
Each regeneration creates a completely new ID. There’s no way to recover the old link after regeneration.
Making a Project Private
You can revoke all public access by making the project private again.Viewing Public Dashboards
Anyone with a public link can view the dashboard without logging in.Public URL Format
Public Dashboard Features
Read-Only Access
Viewers can see all widgets but cannot edit, delete, or create new ones
Live Data
Data refreshes automatically to show current information from the database
No Authentication
No login required - anyone with the link can access
Responsive Design
Dashboards work on desktop, tablet, and mobile devices
What Viewers Cannot Do
- Edit widget configurations
- Delete widgets
- Create new widgets
- Change project settings
- View or edit database connections
- Access other projects by the same user
Valid Connection Requirement
Projects must have at least one valid database connection to be made public.Validation Logic
Fromsrc/app/api/projects/[projectId]/public/route.ts:29-39:
What Happens if Connections Become Invalid
If all connections in a public project become invalid:- The project is automatically made private
isPublicis set tofalseidPublicis set tonull- The public link stops working
- Users see a “Project not found” message
Database Schema
Project sharing data is stored in the Project model:Key Fields
Whether the project is accessible via public link
Unique 12-character identifier for the public URL. Must be unique across all projects.
Security Considerations
No User Data Exposed
Public dashboards do not reveal user information, email, or other projects
No Connection Details
Database credentials and connection details are never exposed to viewers
Rate Limiting
Consider implementing rate limiting on public endpoints to prevent abuse
Data Sensitivity
Only share dashboards containing non-sensitive data, or ensure proper data masking
Recommended Security Practices
- Review Data: Before making a project public, review all widgets to ensure no sensitive data is displayed
- Use Read-Only DB Users: Connect with database users that only have SELECT permissions
- Monitor Access: Track public dashboard views if analytics are important
- Regenerate Periodically: Regenerate public links periodically to limit exposure
- Revoke When Done: Make projects private when public access is no longer needed
Use Cases
Client Reporting
Share live dashboards with clients without giving them account access
Team Dashboards
Display dashboards on office TVs or shared screens
Public Metrics
Share public-facing metrics like community stats or open data
Embedded Dashboards
Embed public dashboards in external websites or applications
Embedding Public Dashboards
Public dashboards can be embedded in iframes:Ensure your application allows iframe embedding by setting appropriate
Content-Security-Policy headers.Troubleshooting
”Cannot make project public” Error
Cause: No valid database connections Solution:- Fix invalid connections in the project
- Ensure at least one connection has
isValid: true - Regenerate schemas if needed
Public Link Returns 404
Causes:- Project was made private
- Link was regenerated (old ID no longer valid)
- Project was deleted
- All database connections became invalid
- Verify project is still public
- Get the latest public link from the share dialog
- Check connection status
Public Dashboard Shows No Data
Causes:- Database connection issues
- Tables are empty
- Widget configuration errors
- Verify connections are valid
- Check that tables contain data
- Review widget configurations
Public Link Doesn’t Update After Changes
Cause: Browser caching Solution:- Hard refresh the page (Ctrl+Shift+R or Cmd+Shift+R)
- Clear browser cache
- Try in incognito/private mode
API Reference
Toggle Project Visibility
Update Project
Best Practices
Descriptive Project Names
Use clear project titles so viewers understand what they’re seeing
Add Context with Text Widgets
Include text widgets to explain dashboard purpose and metrics
Test Before Sharing
View your public dashboard in incognito mode before sharing
Keep Dashboards Simple
Limit widgets to the most important metrics for public viewers
Monitor Performance
Ensure database queries are optimized for public access
Regular Reviews
Periodically review public projects and revoke access as needed
