"use client"; import { ReactFlow, Background, type Node, type Edge, type NodeProps, Handle, Position, } from "@xyflow/react"; import "@xyflow/react/dist/style.css"; import { Globe, Server, Database, Wifi } from "lucide-react"; type ServiceNodeData = { label: string; subtitle: string; icon: React.ElementType; color: string; items?: string[]; }; function ServiceNode({ data }: NodeProps>) { const Icon = data.icon; return (
{data.label}
{data.subtitle}
{data.items && (
    {data.items.map((item) => (
  • {item}
  • ))}
)}
); } const nodeTypes = { service: ServiceNode }; const nodes: Node[] = [ { id: "nextjs", type: "service", position: { x: 0, y: 0 }, data: { label: "Next.js", subtitle: "Vercel (Frontend)", icon: Globe, color: "#3b82f6", items: ["UI / SSR", "Auth (Supabase)", "WHOIS lookups", "Static pages"], }, }, { id: "go", type: "service", position: { x: 350, y: 0 }, data: { label: "Go DNS API", subtitle: "VPS (Microservice)", icon: Server, color: "#10b981", items: [ "DNS resolution (miekg/dns)", "DNSSEC validation", "Propagation checks", "Monitoring cron", ], }, }, { id: "supabase", type: "service", position: { x: 0, y: 230 }, data: { label: "Supabase", subtitle: "Database & Auth", icon: Database, color: "#8b5cf6", items: ["Postgres DB", "Auth (OAuth + email)", "Row Level Security"], }, }, { id: "dns", type: "service", position: { x: 350, y: 230 }, data: { label: "DNS Resolvers", subtitle: "Authoritative NS", icon: Wifi, color: "#f59e0b", items: ["Google (8.8.8.8)", "Cloudflare (1.1.1.1)", "Authoritative NS"], }, }, ]; const edges: Edge[] = [ { id: "nextjs-go", source: "nextjs", target: "go", sourceHandle: "right", targetHandle: "left", label: "HTTPS", animated: true, style: { stroke: "#3b82f6" }, labelStyle: { fontSize: 15, fill: "#94a3b8", fontWeight: "bold" }, labelBgStyle: { fill: "transparent" }, }, { id: "nextjs-supabase", source: "nextjs", target: "supabase", label: "SDK", style: { stroke: "#8b5cf6" }, labelStyle: { fontSize: 15, fill: "#94a3b8", fontWeight: "bold" }, labelBgStyle: { fill: "transparent" }, }, { id: "go-dns", source: "go", target: "dns", label: "UDP/TCP", animated: true, style: { stroke: "#10b981" }, labelStyle: { fontSize: 15, fill: "#94a3b8", fontWeight: "bold" }, labelBgStyle: { fill: "transparent" }, }, ]; export function ArchitectureDiagram() { return (
); }