This is a template repository that dramatically speeds up dashboard generation by using pre-written HTML, CSS, and JavaScript. The AI only needs to generate a small data.js file with actual data.
- Before: 60-90 seconds (generating 3 large files with LLM)
- After: 10-15 seconds (cloning template + generating small data file)
- Speed: 5-6x faster! β‘
dashboard-template/
βββ index.html # Generic dashboard HTML structure (static)
βββ style.css # All dashboard styles (static)
βββ dashboard.js # Dashboard rendering logic (static)
βββ data-template.js # Example data structure (reference only)
βββ data.js # Actual data (generated by LLM)
The template contains all the static code (HTML structure, CSS styles, JavaScript logic). Only the data is dynamic.
When creating a sandbox, clone this template:
const sandbox = await Sandbox.create({
source: {
url: 'https://github.com/YOUR-ORG/dashboard-template.git',
type: 'git',
},
resources: { vcpus: 4 },
timeout: 2700000,
ports: [8000],
});The LLM generates a single small file (data.js) with:
- Tab configurations
- KPI values
- Chart data
- Table data
The data.js file follows this structure:
const dashboardData = {
title: "Dashboard Title",
subtitle: "Dashboard Description",
tabs: [
{
id: "tab-id",
name: "Tab Name",
icon: "π",
kpis: [...], // Summary cards
charts: [...], // Visualizations
tables: [...] // Data tables
}
]
};See data-template.js for a complete example with all supported features.
- β Multiple tabs
- β KPI/Summary cards with trends
- β Line charts
- β Bar charts
- β Doughnut/Pie charts
- β Area charts
- β Data tables
- β Responsive design
- β Beautiful animations
- β Hover effects
line- Line charts (trends over time)bar- Bar charts (comparisons)doughnut- Doughnut charts (proportions)pie- Pie charts (distributions)radar- Radar charts (multi-dimensional)polarArea- Polar area charts
- Create a new GitHub repository named
dashboard-template - Upload these files to the repository
- Make the repository public (or provide authentication)
- Update the code to use your repository URL
Upload the template to Vercel Blob and reference it.
Keep the template in your project and use writeFiles to copy it to the sandbox.
const sandbox = await Sandbox.create({
source: {
url: 'https://github.com/YOUR-ORG/dashboard-template.git',
type: 'git',
},
resources: { vcpus: 4 },
timeout: 2700000,
ports: [8000],
});// LLM generates only this small file
const dataContent = `
const dashboardData = {
title: "Sales Dashboard",
tabs: [
{
id: "overview",
name: "Overview",
kpis: [
{ label: "Revenue", value: "$124K", trend: 12.5, icon: "π΅" }
],
charts: [...],
tables: [...]
}
]
};
`;
await sandbox.writeFiles([{
path: 'data.js',
content: Buffer.from(dataContent, 'utf8')
}]);await sandbox.runCommand({
cmd: 'python3',
args: ['-m', 'http.server', '8000'],
detached: true
});- β‘ Speed: 5-6x faster dashboard generation
- π° Cost: Less LLM token usage
- π¨ Consistency: All dashboards use the same professional template
- π οΈ Maintainability: Update template once, affects all dashboards
- π Reliability: Pre-tested HTML/CSS/JS, fewer errors
This template is designed to work with the Vibe Coding Platform's:
- Vercel Sandbox integration
- AI-powered dashboard generation
- Real-time data visualization
This template is part of the Vibe Coding Platform and follows the same license.