What problem does it solve?
Provides a structured, decision-driven approach to choosing API architectures and designing consistent response formats, versioning, pagination, and security practices so teams avoid mismatched choices and fragile interfaces.
Core Features & Use Cases
- Decision guidance: A decision tree for choosing REST, GraphQL, tRPC, gRPC, or WebSocket approaches based on consumers and constraints.
- Design standards: Recommendations for resource naming, HTTP methods, status codes, response envelopes, pagination strategies, and versioning choices.
- Security & testing: Patterns for authentication (JWT, OAuth, Passkeys), rate limiting, OWASP API security checks, and a script to validate OpenAPI specs and common API code issues.
- Use Case: Selects tRPC for a TypeScript monorepo to achieve end-to-end types, chooses GraphQL for complex multi-client querying, or picks REST + OpenAPI for a public cross-platform API and validates the implementation with the included validator script.
Quick Start
Run the api-patterns validator on the project root to scan for OpenAPI issues, missing responses, validation gaps, and common API anti-patterns.