api-tier-architecture

Implement a 3-tier API architecture with Convex WebSocket, SSE, and REST.

7|Updated Dec 4, 2025
One-click install
npx skills add https://github.com/planetaryescape/blah.chat --skill api-tier-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-tier-architecture
Source: https://github.com/planetaryescape/blah.chat/tree/main/.claude/skills/api-tier-architecture
Command: npx skills add https://github.com/planetaryescape/blah.chat --skill api-tier-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a robust cross-platform API architecture template that unifies web and mobile data access through a 3-tier model: Convex WebSocket for real-time updates, SSE for near-real-time mobile streams, and REST for reliable fallbacks. It also consolidates platform detection, hybrid hooks, and a DAL pattern to ensure secure, scalable data access across layers.

Core Features & Use Cases

  • Cross-platform data access: Unified data fetching across desktop web and mobile devices using Convex WebSocket, SSE, and REST.
  • Platform-aware data hooks: Hybrid hooks that switch data strategies based on client capabilities and context.
  • DAL-driven server access: Data access layer enforces ownership, validation, and consistent response envelopes.
  • Use Case: Build a feature that streams real-time inventory updates to a web dashboard while providing reliable REST fallbacks for offline mobile clients.

Quick Start

Set up a 3-tier API architecture with Convex WebSocket, SSE, and REST, wire in platform detection and DAL, and create a hybrid data hook for cross-platform data fetching.

Frequently Asked Questions about api-tier-architecture

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

FAQPage Schema
How do I handle real-time data access across web and mobile using Convex?

Real-time data access across web and mobile using Convex is handled through a 3-tier API architecture that utilizes Convex WebSocket for live web updates, SSE for mobile streams, and REST for reliable fallbacks.

What is a DAL pattern and when do I need it for cross-platform API architecture?

A DAL pattern is a Data Access Layer that enforces ownership, validation, and consistent response envelopes. You need it for cross-platform API architecture to ensure secure, scalable server access and avoid direct client Convex calls.

How do I build a hybrid data hook that switches between WebSocket and REST?

Build a hybrid data hook by applying platform detection to evaluate client capabilities, then automatically switch data fetching strategies between Convex WebSocket, SSE, and REST based on the detected context and connection reliability.

Does this 3-tier API architecture work for offline mobile clients?

Yes, the 3-tier API architecture works for offline mobile clients by providing robust REST fallbacks that ensure reliable data fetching when WebSocket or SSE connections are unstable or unavailable.

Why should I avoid direct client Convex calls in my API architecture?

You should avoid direct client Convex calls in your API architecture to enforce authenticated server paths, ensuring that the DAL layer properly handles data ownership, validation, and secure access control across all platforms.

Can I use SSE for near-real-time updates instead of WebSocket on mobile?

Yes, you can use SSE for near-real-time updates on mobile devices, as the 3-tier architecture employs SSE specifically for mobile streaming scenarios while reserving Convex WebSocket for full real-time web desktop synchronization.