- Install electron-trpc, @trpc/server, @trpc/client, @trpc/react-query, @tanstack/react-query, zod - Create appRouter in src/main/router/index.ts with stub routers for: health, clients, projects, tasks, checkpoints, notes, ai - health.ping procedure returns 'pong' - All procedure inputs validated with Zod schemas - Configure IPC handler in main process (createIPCHandler) and preload (exposeElectronTRPC) - Create renderer trpc client in src/renderer/lib/trpc.ts with ipcLink - Wrap app with TRPCProvider + QueryClientProvider in src/renderer/index.tsx - Verify health.ping in HomePage component (shows 'tRPC IPC bridge: pong') - Typecheck passes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
41 lines
1.0 KiB
TypeScript
41 lines
1.0 KiB
TypeScript
import { createFileRoute } from '@tanstack/react-router';
|
|
import { trpc } from '@/lib/trpc';
|
|
|
|
export const Route = createFileRoute('/')({
|
|
component: HomePage,
|
|
});
|
|
|
|
function HomePage() {
|
|
const pingQuery = trpc.health.ping.useQuery();
|
|
|
|
return (
|
|
<div className="flex flex-col items-center justify-center h-full gap-4">
|
|
<div className="flex items-center gap-3">
|
|
<svg
|
|
width="24"
|
|
height="24"
|
|
viewBox="0 0 24 24"
|
|
fill="none"
|
|
className="text-foreground"
|
|
>
|
|
<path
|
|
d="M12 2L13.5 8.5L20 10L13.5 11.5L12 18L10.5 11.5L4 10L10.5 8.5L12 2Z"
|
|
fill="currentColor"
|
|
/>
|
|
</svg>
|
|
<h1 className="text-3xl font-semibold tracking-tight">
|
|
Hello, Roberto
|
|
</h1>
|
|
</div>
|
|
<p className="text-muted-foreground text-sm">
|
|
Adiuva is ready. Start building.
|
|
</p>
|
|
{pingQuery.data && (
|
|
<p className="text-xs text-muted-foreground">
|
|
tRPC IPC bridge: {pingQuery.data}
|
|
</p>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|