client-server-communications

Standardize client-server API communication with centralized endpoint patterns and React Query.

Updated Mar 28, 2025
One-click install
npx skills add https://github.com/gileck/app-template-ai --skill client-server-communications
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: client-server-communications
Source: https://github.com/gileck/app-template-ai/tree/main/.ai/skills/template/client-server-communications
Command: npx skills add https://github.com/gileck/app-template-ai --skill client-server-communications

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill consolidates the way client and server components communicate by defining a single, extensible API endpoint pattern, reducing boilerplate and coordination overhead across domains.

Core Features & Use Cases

  • Centralized domain API naming, types, and server handlers to promote consistent implementation.
  • A clear client-facing contract for data fetching with React Query, enabling safe caching and offline resilience.
  • A scalable pattern for adding new API domains without duplicating logic, including a server coordinator and modular domain handlers.

Quick Start

Follow the repository's guidelines to implement and wire domain APIs: export domain names in index.ts, implement handlers in handlers/, assemble server.ts with re-exports, and register the domain in apis.ts. The description above is plain text instructions.

Frequently Asked Questions about client-server-communications

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

FAQPage Schema
What is the best way to standardize client-server API communication in TypeScript?

Standardizing client-server API communication involves implementing a single, centralized API endpoint pattern with strictly typed TypeScript definitions, reducing boilerplate and coordination overhead across domains.

How do I structure a centralized API endpoint pattern for React Query data fetching?

Structure centralized API endpoints by exporting domain names in index.ts, implementing modular server handlers, assembling a server coordinator in server.ts, and registering the domain in apis.ts for safe, cacheable data access.

Why define domain types in types.ts for client-server communication?

Defining domain types in types.ts ensures strictly typed TypeScript definitions that enable a clear client-facing contract, safe caching, and offline-friendly data access with React Query.

Can I use this centralized API pattern to add new domains without duplicating logic?

Yes, this centralized API pattern provides a scalable structure for adding new API domains through a server coordinator and modular domain handlers, eliminating logic duplication across domains.

Does this client-server communication approach support offline resilience with React Query?

Yes, the approach provides a clear client-facing contract for data fetching with React Query that enables safe caching and offline resilience for client-server communication.