diff --git a/client/components/admin/AdminSystemMap.tsx b/client/components/admin/AdminSystemMap.tsx new file mode 100644 index 00000000..2e493230 --- /dev/null +++ b/client/components/admin/AdminSystemMap.tsx @@ -0,0 +1,155 @@ +import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"; +import { Badge } from "@/components/ui/badge"; +import { cn } from "@/lib/utils"; +import { Database, Globe, Layers, Network, Route, ServerCog, ShieldCheck, Spline, Users, Workflow } from "lucide-react"; + +type Node = { + id: string; + label: string; + icon?: React.ComponentType<{ className?: string }>; + subtitle?: string; + group: "entry" | "frontend" | "services" | "backend" | "infra"; +}; + +const NODES: Node[] = [ + // Entry/realms + { id: "realms", label: "Realms", subtitle: "GD / Consulting / Community / Get Started", icon: Workflow, group: "entry" }, + { id: "onboarding", label: "Onboarding", subtitle: "Profile • Interests • Path", icon: Users, group: "entry" }, + + // Frontend app + { id: "dashboard", label: "Dashboard", subtitle: "Realm‑aware UI", icon: Globe, group: "frontend" }, + { id: "routes", label: "Routes", subtitle: "/feed • /status • /teams • /docs", icon: Route, group: "frontend" }, + + // Product services (frontend+api) + { id: "feed", label: "Social Feed", subtitle: "Posts • Likes • Comments • Tags", icon: Layers, group: "services" }, + { id: "mentorship", label: "Mentorship", subtitle: "Requests • Mentors • Moderation", icon: Users, group: "services" }, + { id: "status", label: "Status", subtitle: "Live health from /api/status", icon: ShieldCheck, group: "services" }, + { id: "investors", label: "Investors", subtitle: "Interest • Client realm", icon: Network, group: "services" }, + + // Backend + { id: "api", label: "API", subtitle: "Node/Express server routes", icon: ServerCog, group: "backend" }, + { id: "db", label: "Supabase", subtitle: "Auth • Profiles • Content • Migrations", icon: Database, group: "backend" }, + + // Infra + { id: "hosting", label: "Hosting/CDN", subtitle: "Vercel/Netlify + Edge", icon: Spline, group: "infra" }, +]; + +// Directed edges between nodes +const EDGES: Array<[string, string, string]> = [ + ["realms", "dashboard", "realm -> UI personalization"], + ["onboarding", "dashboard", "profile bootstraps"], + ["dashboard", "routes", "primary navigation"], + + ["routes", "feed", "component mounts"], + ["routes", "mentorship", "community flow"], + ["routes", "status", "observability"], + ["routes", "investors", "IR page"], + + ["feed", "api", "CRUD, reactions"], + ["mentorship", "api", "requests, listings"], + ["status", "api", "/api/status"], + ["investors", "api", "POST /api/investors/interest"], + + ["api", "db", "RLS, SQL, RPC"], + ["api", "hosting", "deploy, logs"], +]; + +const groupStyles: Record = { + entry: "from-emerald-900/40 to-emerald-700/20 border-emerald-500/30", + frontend: "from-indigo-900/40 to-indigo-700/20 border-indigo-500/30", + services: "from-fuchsia-900/40 to-fuchsia-700/20 border-fuchsia-500/30", + backend: "from-sky-900/40 to-sky-700/20 border-sky-500/30", + infra: "from-amber-900/40 to-amber-700/20 border-amber-500/30", +}; + +function NodeCard({ node }: { node: Node }) { + const Icon = node.icon ?? Globe; + return ( +
+
+
+ +
+
+
{node.label}
+ {node.subtitle && ( +
{node.subtitle}
+ )} +
+
+
+ ); +} + +export default function AdminSystemMap() { + return ( + + + System map + High‑level architecture and primary flows + + +
+ {/* Row: entry */} +
+ {NODES.filter(n => n.group === "entry").map(n => ( + + ))} +
+ + {/* Row: frontend */} +
+ {NODES.filter(n => n.group === "frontend").map(n => ( + + ))} +
+ + {/* Row: services */} +
+ {NODES.filter(n => n.group === "services").map(n => ( + + ))} +
+ + {/* Row: backend + infra */} +
+ {NODES.filter(n => n.group === "backend").map(n => ( + + ))} + {NODES.filter(n => n.group === "infra").map(n => ( + + ))} +
+ + {/* Legend */} +
+ Entry + Frontend + Services + Backend + Infra +
+ + {/* Edges list (readable relationships) */} +
+
Flows
+
    + {EDGES.map(([from, to, note]) => ( +
  • + {from} + + {to} + — {note} +
  • + ))} +
+
+
+
+
+ ); +}