Case study · Prototype · public code

Ops Portal

Internal ops portal UI: unified data-health, dashboards & embedded analyst (foundation phase)

Next.jsReactTypeScriptSupabaseFramer Motion
30-second version
Problem
Internal tooling was split across separate surfaces for ETL health, data explorer, reports and the chat analyst, with no front door.
Built
Next.js dashboard shell against typed mock data as the future query contract, with CSS-variable theming and Framer Motion reveals.
Result
1 route built on mock data; prototype UI foundation with no auth routes, RLS policies or live queries yet.
Role
Sole engineer

The Problem

The company's internal tooling is spread across separate surfaces. ETL health lives in one place, the data explorer in another, reports somewhere else, and DARA (the chat analyst) in its own app. There's no single front door. The goal of portal is one signed-in operations surface that unifies data health, dashboards, reports, and the embedded analyst, built so customer-facing multi-tenancy can be layered on later without a re-platform.

This entry is deliberately honest about where the project is: portal is the UI foundation for that surface, a complete, polished dashboard shell with a designed data model, not yet wired to live data. The backend (auth, RLS, real queries) is specified and is the next phase, not a claim I'll make before it's built.

Architecture

The implemented system is a Next.js App Router front end: typed mock data flows into composed dashboard components with animated reveals and a dark/light theme system. The data layer is designed as a clean swap: components take typed props today, Supabase queries tomorrow.

rendering diagram…

What's real: a Next.js 16 / React 19 dashboard built around a ThemeProvider (dark/light with localStorage persistence and an SSR hydration guard) and a SidebarProvider. Six components (QuickStats, DataHealthPanel, PipelineActivity, RecentExports, plus layout) render from six typed mock arrays in mock-data.ts with staggered Framer Motion reveals. The interfaces (DataSource, PipelineRun, QuickStat, RecentExport) are the contract the real Supabase queries will satisfy, so the swap doesn't touch the UI. What's planned: Google OAuth and Supabase Row-Level Security as the trust boundary at the database, reusing the OAuth wiring from DARA.

Key Decisions

  • UI-first, with the data contract designed up front. Rather than a half-wired backend, the foundation is a complete UI against typed mock data, so the eventual Supabase swap is a data-source change, not a refactor. mock-data.ts carries the exact interfaces the queries must return.
  • Authorization belongs at the database (planned). The design puts the trust boundary in Supabase RLS, not app-layer checks: a schema allowlist (analytics.*, data_staging.*, reference.*) and tenant isolation enforced in Postgres. This is documented and intended, not yet implemented.
  • Dark-first theming via CSS custom properties. A near-black palette with a mint accent and 30+ design tokens, dual light/dark sets, and 0.4s transitions. Global theme edits happen in variables, not components.
  • Borderless, elevation-based cards + tuned motion. Floating cards (shadow + hover translate, no borders) and a human-tuned cubic-bezier easing with staggered entries give it a premium, low-fatigue feel suited to an always-on ops screen.

Code Samples

The theme provider uses localStorage persistence with an SSR hydration guard so the first paint doesn't flash the wrong theme:

export function ThemeProvider({ children }: { children: React.ReactNode }) {
  const [theme, setTheme] = useState<Theme>("dark");
  const [mounted, setMounted] = useState(false);

  useEffect(() => {
    setMounted(true);
    const saved = localStorage.getItem("dara-theme") as Theme | null;
    if (saved) setTheme(saved);
  }, []);

  useEffect(() => {
    if (!mounted) return;
    document.documentElement.setAttribute("data-theme", theme);
    localStorage.setItem("dara-theme", theme);
  }, [theme, mounted]);

  if (!mounted) return <div data-theme="dark">{children}</div>;
  return <ThemeContext.Provider value={{ theme, toggleTheme }}>{children}</ThemeContext.Provider>;
}

Stat cards animate in on a per-index stagger with a tuned easing curve, the small detail that makes the dashboard feel considered rather than templated:

<motion.div
  initial={{ opacity: 0, y: 16 }}
  animate={{ opacity: 1, y: 0 }}
  transition={{ delay: 0.08 + index * 0.06, duration: 0.5, ease: [0.22, 1, 0.36, 1] }}
  className="card p-5 cursor-default relative"
>

Metrics

These are verifiable facts about the current state, not outcomes:

  • ~1,350 lines across 11 TypeScript/TSX files: 6 components, 2 context providers, 1 page, 1 layout, and mock-data.ts
  • 6 dependencies (next 16, react 19, framer-motion, lucide-react, @supabase/supabase-js, plus Tailwind 4 tooling)
  • 70+ CSS custom properties spanning dual dark/light themes
  • 1 route implemented (the home dashboard); 6 further sections are designed in the nav but not yet built
  • Honest gaps: 0 SQL migrations, 0 RLS policies, 0 auth routes, 0 live Supabase queries. @supabase/supabase-js is installed but unused. Data is currently mock.

What I Learned

  • A typed mock layer is a real deliverable, not a placeholder. Designing mock-data.ts as the exact interface contract means the UI and the future data layer were negotiated before either was "done." The backend now has a precise target instead of a moving one.
  • Decide the trust boundary before writing the first query. Committing to RLS-at-the-database (not scattered app-layer checks) up front shapes the schema and the auth design; bolting authorization on later is how multi-tenant leaks happen.
  • Honesty about phase is part of the portfolio. This is a strong UI foundation with a clear next step. Presenting it as a finished ops system would be the easy lie and the wrong one.

GitHub repo. UI foundation phase; the data layer (OAuth + Supabase RLS) is the planned next step.