nodefony-frontend-dev

Guides frontend development on Nodefony covering isomorphic code, realtime sockets, Vite HMR, and BFF data consumption.

Updated Dec 19, 2023
One-click install
npx skills add https://github.com/nodefony/nodefony-core --skill nodefony-frontend-dev-nodefony
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nodefony-frontend-dev
Source: https://github.com/nodefony/nodefony-core/tree/main/.claude/skills/nodefony-frontend-dev
Command: npx skills add https://github.com/nodefony/nodefony-core --skill nodefony-frontend-dev-nodefony

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building a frontend on the Nodefony framework requires coordinating several moving parts: the isomorphic nodefony package shared between browser and server, the shared realtime WebSocket client, the Vite-based builder with HMR, and the BFF data plane. This Skill gives an AI agent the exact APIs, rules, and verification gates to write correct Nodefony frontend code without reading the framework source. ## Core Features & Use Cases - Isomorphic boundary enforcement: Teaches how to consume nodefony client-side via customConditions: ["browser"] and subpaths (nodefony/client, nodefony/react, nodefony/roles) without ever importing server code into the browser bundle. - Realtime client patterns: Covers RealtimeClient singleton usage, ref-counted channel subscriptions, and the React/Vue/Angular/Svelte bindings, including identity renegotiation on account change. - Vite builder and HMR: Documents @nodefony/frontend entry registration, multi-bundle isolation families, apiProxyPaths, production manifests, and how to verify a frontend change without a browser via the Vite transform endpoint. - BFF data plane and RBAC: Explains ApiClient absolute/relative methods, useResource race-safe loading, HttpOnly cookie sessions, and cosmetic frontend role gating with nodefony/roles. - Use Case: An agent asked to add a live-updating admin page to a Nodefony module uses this Skill to register the Vite entry, subscribe to a realtime channel with proper ref-counting, fetch initial data through the data plane, and pass the typecheck and transform gates before reporting done. ## Quick Start Use the nodefony-frontend-dev skill to add a React frontend entry to my Nodefony module and wire it to the realtime channel and data plane API.

Frequently Asked Questions about nodefony-frontend-dev

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a frontend to a Nodefony module?

Load @nodefony/frontend before your module in nodefony.config.ts, then call frontendService.registerEntry in the module's onKernelBoot with the preset type (react19, vue3, angular, vanilla), entry path, and apiProxyPaths. Render the page from a controller using renderDocument or renderTags.

How do I use the Nodefony realtime client in React?

Create one shared RealtimeClient per URL, mount NodefonyProvider above your tree, and consume the useNodefony hooks for state, channels, and identity. Subscriptions are ref-counted, so subscribe on mount and unsubscribe on unmount without ever emitting raw unsubscribe calls.

Why does tsc show cross-package errors when importing nodefony in a frontend?

The frontend tsconfig is missing moduleResolution: bundler and customConditions: ["browser"]. Without them, tsc resolves the node face of the nodefony package and pulls in server source. Vite applies the browser condition natively, so only the typecheck fails.

Can I verify a Nodefony frontend change without opening a browser?

Yes. Run the module's npm run typecheck, then curl the Vite transform endpoint for the changed file to confirm resolution and transpilation, purging node_modules/.vite if an import or subpath changed. For visual and accessibility measurement, delegate to the nodefony-browser skill.

Does frontend role checking secure a Nodefony admin page?

No. Frontend RBAC via nodefony/roles is cosmetic only, reading roles from the server-provided DTO to show or hide UI. The real authority is the server, which re-verifies roles on every data plane endpoint and returns 403 when access is denied.

When should I not use this frontend skill for Nodefony work?

Use nodefony-studio-dev for the Studio admin app with its Mantine and MobX stack, nodefony-create-frontend-module to scaffold a new frontend module, and nodefony-framework-dev for backend controllers, services, and the server-side realtime hub.