StackPractices

api

Practical resources about api for software engineers.

101 results

Building Robust APIs

APIs are the contract between systems. Whether you are exposing a public REST endpoint, designing an internal GraphQL schema, or integrating with a third-party service, the patterns you choose determine reliability, performance, and developer experience.

Here you will find recipes for handling CORS, implementing pagination, versioning endpoints, managing rate limits, and documenting APIs with OpenAPI. Each example includes runnable code in multiple languages so you can adapt it to your stack immediately.

intermediate

Middleware

How to implement request/response middleware for logging, auth, and error handling across Python,...

intermediate

Configure Nginx as a Reverse Proxy and API Gateway

How to use Nginx as a reverse proxy for backend services, implement load balancing, SSL...

intermediate

Node.js WebSocket Real-Time Communication with Socket.io

Build real-time WebSocket applications in Node.js with Socket.io

intermediate

Pagination

How to implement cursor-based and offset-based pagination in APIs and databases across Python,...

intermediate

Python API Rate Limiting with Token Bucket

Implement token bucket rate limiting in Flask and FastAPI with Redis support

intermediate

Rate Limiting

How to implement API rate limiting using token bucket, sliding window, and fixed window algorithms...

intermediate

Build Real-Time Notifications with WebSockets

Implement a real-time notification system using WebSockets and Redis pub/sub for broadcasting...

intermediate

REST API Design: What Works

Design reliable, scalable REST APIs with proper HTTP methods, status codes, versioning, and...

intermediate

Send Transactional Emails with SMTP in Python, Node.js

Learn to send transactional and bulk emails via SMTP with Python, Node.js, and Java. Covers auth,...

intermediate

Server-Sent Events (SSE): One-Way Real-Time Streaming

Implement one-way real-time streaming from server to browser using Server-Sent Events. Covers...

api sse server-sent-events real-time
intermediate

Implement Server-Sent Events in Go for Real-Time Updates

Build a production-ready Server-Sent Events endpoint in Go with connection management, heartbeat...

server-sent-events sse golang real-time
intermediate

Server-Sent Events with Node.js and Express

Build server-to-client push with Server-Sent Events in Node.js and Express. Covers connections,...

intermediate

Webhooks

How to create and consume webhook endpoints for real-time event-driven integrations.

intermediate

WebSocket Authentication and Security Patterns

How to authenticate WebSocket connections, implement token validation, and handle authorization for...

intermediate

Build a Bidirectional Chat with WebSocket and Node.js

How to build a real-time bidirectional chat application using WebSocket with room-based messaging,...

intermediate

WebSocket Server

How to build a WebSocket server for bidirectional real-time communication, with connection...

api bidirectional java rest
intermediate

Design a Scalable API Gateway for Microservices

Build an API gateway that routes requests, handles authentication, rate limiting, caching, and...

intermediate

Use Spring Cache Annotations with Redis Backend

Apply Spring's @Cacheable, @CachePut, and @CacheEvict annotations with a Redis cache manager for...

intermediate

Implement Redis Cache Invalidation in Node.js

Invalidate Redis cache entries in Node.js with TTL expiry, explicit deletion, pattern-based...

intermediate

Cache HTTP Responses with httpx and CacheControl in Python

Cache HTTP responses in Python using httpx with CacheControl for HTTP-compliant caching, ETag...

No results found.