Production & Security Deployment Guide

Production Security & Live Deployment

Secure your telemetry endpoints with token authentication, rate limiting, and CORS configurations. Deploy on Vercel, AWS, Docker, or Railway.

🔒 Endpoint Security & Authentication

Because the dashboard displays real-time operational telemetry, process memory, and error logs, protect the administrative dashboard route (/admin/observability) or your backend endpoints using standard application session or cookie middleware:

Next.js App Router Protection (middleware.ts)
import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";

export function middleware(req: NextRequest) {
  if (req.nextUrl.pathname.startsWith("/admin/observability")) {
    const adminSession = req.cookies.get("admin_session");
    if (!adminSession) {
      return NextResponse.redirect(new URL("/login", req.url));
    }
  }
  return NextResponse.next();
}
100% SELF-HOSTED & PRIVATE
Stacklenzz runs completely within your own infrastructure. No external SaaS cloud keys or external vendor signups required.

CORS & Origin Whitelisting

When serving the admin dashboard on a separate domain (e.g., https://admin.yourdomain.com), configure CORS headers on the backend server:

NestJS CORS Configuration (src/main.ts)
app.enableCors({
  origin: ["https://admin.yourdomain.com"],
  credentials: true,
  allowedHeaders: ["Content-Type", "Authorization"],
});

☁️ Hosting & Cloud Deployment Options

Stacklenzz is lightweight and runs seamlessly in any cloud container or serverless environment:

Vercel Serverless

Deploy Next.js App Router dashboards directly to Vercel with zero runtime configuration required.

Docker Containers

Expose Prometheus metrics on port 5000 for standard Docker Compose or Kubernetes scraping targets.