server-router-implementation

Implement oRPC routers with public and protected procedures for Hono-based Node.js backends.

1|Updated Nov 19, 2025
One-click install
npx skills add https://github.com/CatOfJupit3r/ultimate-starter --skill server-router-implementation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: server-router-implementation
Source: https://github.com/CatOfJupit3r/ultimate-starter/tree/main/.github/skills/server-router-implementation
Command: npx skills add https://github.com/CatOfJupit3r/ultimate-starter --skill server-router-implementation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Creates and wires server-side oRPC routers that map to contract definitions, enabling consistent, authenticated API endpoints and clear separation between contracts and business logic.

Core Features & Use Cases

  • Create router files under apps/server/src/routers and expose procedures using publicProcedure and protectedProcedure.
  • Enforce access control, context usage, and dependency injection to keep handlers thin and testable.
  • Register routers in the central appRouter and reuse reference patterns from advanced examples.

Quick Start

Create a new file at apps/server/src/routers/<namespace>.router.ts and implement procedures using publicProcedure and protectedProcedure.

Frequently Asked Questions about server-router-implementation

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

FAQPage Schema
How do I implement oRPC routers in a Hono backend?

To implement oRPC routers in a Hono backend, create router files under apps/server/src/routers and define procedures using publicProcedure and protectedProcedure. You then register these routers in the central appRouter for centralized API orchestration.

How do I map contract definitions to business logic in oRPC?

Mapping contract definitions to business logic in oRPC involves wiring server-side routers directly to the contracts. This separates API contracts from handler logic, allowing you to enforce access control and dependency injection while keeping handlers thin and testable.

Can I enforce authentication and access control in oRPC procedures?

Yes, you can enforce authentication and access control in oRPC procedures by utilizing protectedProcedure. This ensures endpoints are authenticated, while publicProcedure remains open for unauthenticated access within your Hono-based Node.js server.

What is the best way to organize oRPC routers in a Node.js backend?

The best way to organize oRPC routers in a Node.js backend is through centralized router registration. By creating dedicated router files under apps/server/src/routers and aggregating them into a central appRouter, you achieve robust API orchestration and clear separation of concerns.

How do I use dependency injection in oRPC server handlers?

Using dependency injection in oRPC server handlers is achieved by accessing context within your procedures. This pattern allows handlers to remain thin and highly testable by delegating business logic to injected dependencies rather than hardcoding them.