Deployment

DashTemplate dashboards are static HTML files. They deploy to any host that can serve files — no server runtime, no database, no build step required.

## Cloudflare Pages (recommended)
  1. Push your project to a GitHub or GitLab repository.
  2. In the Cloudflare dashboard, go to Workers & Pages → Create → Pages → Connect to Git.
  3. Select your repository.
  4. Set Build command to blank (leave empty).
  5. Set Build output directory to / (or the folder containing your template).
  6. Click Save and Deploy.

Cloudflare Pages has a generous free tier and serves assets from its global CDN with zero configuration.

## Vercel
# Install Vercel CLI
npm i -g vercel

# Deploy from the template directory
cd marketing-performance-hub
vercel --prod

Vercel auto-detects static files and serves them with no additional configuration. A vercel.json is not required.

## Netlify
# Install Netlify CLI
npm i -g netlify-cli

# Deploy
cd marketing-performance-hub
netlify deploy --prod --dir .

Or drag-and-drop the folder onto app.netlify.com — no CLI needed.

## GitHub Pages
  1. Push the template folder contents to the gh-pages branch (or configure docs/ as the Pages source in repository settings).
  2. Enable GitHub Pages under Settings → Pages.
# Using gh-pages CLI
npm i -g gh-pages
gh-pages -d marketing-performance-hub
## Nginx / Apache (self-hosted)

Copy the template folder to your web root and ensure the shared/ folder is at the same level:

# Example Nginx config snippet
server {
    listen 80;
    server_name dashboard.example.com;

    root /var/www/dashboards;
    index index.html;

    location / {
        try_files $uri $uri/ =404;
    }

    # Cache static assets aggressively
    location ~* \.(css|js|png|svg|woff2)$ {
        expires 1y;
        add_header Cache-Control "public, immutable";
    }
}
## Docker (optional)
# Dockerfile
FROM nginx:alpine
COPY . /usr/share/nginx/html
EXPOSE 80
docker build -t my-dashboard .
docker run -p 8080:80 my-dashboard
## Environment variables

Templates are static HTML — there is no runtime environment for secrets. If your API requires authentication:

  • Use a lightweight proxy (Cloudflare Worker, Vercel Edge Function, Netlify Function) to add auth headers before forwarding requests to your API.
  • Never embed API keys or tokens in client-side HTML files.
// Cloudflare Worker example — proxy with auth header
export default {
  async fetch(request, env) {
    const url = new URL(request.url);
    url.hostname = 'api.your-service.com';

    return fetch(url.toString(), {
      headers: {
        ...request.headers,
        Authorization: `Bearer ${env.API_SECRET}`,
      },
    });
  },
};
## Custom domain

All platforms listed above support custom domains with free TLS certificates. Follow the platform's domain verification guide and add a CNAME or A record in your DNS provider.

💡 Cloudflare Pages + a Cloudflare-managed domain gives you automatic HTTPS, HTTP/3, and global CDN — with zero configuration and on the free plan.