en un clic
add-frontend-page
// Step-by-step guide to add a new page or component to the React frontend
// Step-by-step guide to add a new page or component to the React frontend
REST and WebSocket endpoint patterns, error handling, and Pydantic schema conventions for the backend
Architecture, directory layout, communication protocol, and conventions for the full-stack multi-agent application
Step-by-step guide to add a new REST or WebSocket endpoint to the backend
Step-by-step guide to add a new agent to the multi-agent team
How the Code Reviewer agent conducts systematic code reviews with prioritized findings
How the Research Analyst agent conducts research, evaluates sources, and produces structured reports
| name | add-frontend-page |
| description | Step-by-step guide to add a new page or component to the React frontend |
| license | Apache-2.0 |
Create frontend/src/components/MyComponent.tsx:
import { useState } from "react";
interface Props {
title: string;
}
export function MyComponent({ title }: Props) {
const [data, setData] = useState<string>("");
return (
<div>
<h2>{title}</h2>
<p>{data || "No data yet."}</p>
</div>
);
}
Rules:
App.tsx)Props interface for all component propsfrontend/src/components/import { MyComponent } from "./components/MyComponent";
export default function App() {
return (
<div style={{ maxWidth: 800, margin: "0 auto", padding: "2rem" }}>
<h1>Project Name</h1>
<MyComponent title="Dashboard" />
<Chat />
</div>
);
}
import { useEffect, useState } from "react";
export function Dashboard() {
const [health, setHealth] = useState<{ status: string; agents: string[] } | null>(null);
useEffect(() => {
fetch("/api/health")
.then((r) => r.json())
.then(setHealth);
}, []);
if (!health) return <p>Loading...</p>;
return (
<div>
<p>Status: {health.status}</p>
<ul>
{health.agents.map((a) => (
<li key={a}>{a}</li>
))}
</ul>
</div>
);
}
Use the same pattern as Chat.tsx:
const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
const ws = new WebSocket(`${protocol}//${window.location.host}/ws/chat`);
ws.onopen = () => ws.send(JSON.stringify({ message: text }));
ws.onmessage = (event) => {
const msg = JSON.parse(event.data);
// Handle msg.type: "agent_message", "status", "error", "done"
};
This template uses inline styles for simplicity. When adding styles:
style={{}} for one-off stylingmaxWidth: 800, margin: "0 auto" for content sectionsMyComponent.module.cssfrontend/src/components/ with typed PropsApp.tsx/api/ or /ws/ prefix (Vite proxies to backend)