Frontend Overview
A thin, fast presentation layer: Next.js 15 App Router with React 19 server components for reads, one client component for the create-agent form, and a route-handler proxy for writes. No client state library, no CSS-in-JS — Tailwind tokens from a Material-inspired design system.
What the frontend does (and doesn't)
| Does | Doesn't |
|---|---|
| Render the operations dashboard for an agent | Call OpenAI (ever) |
| List agents with their config and tools | Hold client-side app state beyond one form |
| Create agents through a proxied POST | Implement auth (none exists platform-wide) |
| Degrade gracefully when the backend is down | Poll or stream — every view is fetch-on-render |
Route map
| Route | File | Type | Data source |
|---|---|---|---|
/ | app/page.tsx | server | none — redirect("/dashboard") |
/dashboard | app/dashboard/page.tsx | server (force-dynamic) | GET {AGENTOPS_DASHBOARD_API_URL} (default: agent 1's dashboard) |
/agents | app/agents/page.tsx | server (force-dynamic) | GET {AGENTOPS_AGENTS_API_URL} |
/create-agent | app/create-agent/page.tsx | server shell + client form | POST /api/agents (proxy) |
/api/agents | app/api/agents/route.ts | route handler | forwards to backend POST /agents/ |
Loading states (loading.tsx) exist for /dashboard and /agents; /dashboard also has an error.tsx boundary.
Section pages
Stack
| Concern | Choice |
|---|---|
| Framework | Next.js ^15.3 (App Router) |
| UI | React ^19 |
| Styling | Tailwind CSS ^3.4 with custom tokens |
| Language | TypeScript ^5.7 (npm run typecheck) |
| Fonts | Inter (text), JetBrains Mono (code/mono), Material Symbols Outlined (icons) — loaded from Google Fonts in app/layout.tsx |
| State | React useState in one client component; everything else server-rendered |
There is no test runner or linter configured — see Testing.
Conventions
New backend endpoints exposed to the browser get a matching route handler under app/api/**/route.ts rather than being called directly from client components — same-origin requests, no CORS, backend URL stays server-side. Walkthrough: Add an Endpoint.
New UI uses the token classes (bg-surface-container-lowest, text-on-surface-variant, font-label-md, spacing like p-stack-md) — not raw hex values or arbitrary sizes. Reference: Design System.
Current limitations (documented, not hidden)
- The dashboard is pinned to agent 1 unless
AGENTOPS_DASHBOARD_API_URLsays otherwise. AgentCard's Open button links to/agents/{id}— a route that does not exist yet; Edit/Run buttons are inert.- Sidebar's "Workflows" and "Operations" sections are
href="#"placeholders. - The dashboard's bar/line charts render static sample shapes, not live series (only the cost figure is real).
All tracked in Known Issues and the Roadmap.
Related pages
- Architecture: System Overview
- Getting Started: Configuration — the three
AGENTOPS_*variables