Skip to main content
ENGINEERING BLOG

Real-world
engineering.

Production notes on Python, FastAPI, React, security architecture and AI-augmented development. No tutorials — actual patterns from deployed systems.

RSS
AI Site Search
Filter:
1
#Anthropic Claude#FastAPI#Python#Multi-tenancy#Cost Optimization#Architecture

Anthropic Batch API for Asynchronous Multi-Tenant AI Processing: Cutting Claude Costs by 50% Without Sacrificing Feature Responsiveness

Implement FastAPI endpoints that queue AI feature requests (document summarization, bulk classification) into Anthropic's Batch API for 50% cost reduction, then use PostgreSQL LISTEN/NOTIFY to push results back to React 19 dashboards in real-time when batch jobs complete—ideal for CitizenApp's heavy users.

6 June 2026
5 min read Read
4
#SQLAlchemy#PostgreSQL#Performance#Multi-tenancy#Python#Database Design

SQLAlchemy Hybrid Properties for Computed Tenant Metrics: Avoiding SELECT N+1 When Aggregating AI Feature Usage Across Multi-Tenant Hierarchies

Use SQLAlchemy's hybrid_property decorator to define computed columns (feature adoption rate, AI inference cost per user, permission inheritance depth) that execute efficiently at the SQL layer instead of in Python, catching performance cliffs before they crater your analytics queries in production.

6 June 2026
5 min read Read
5
#Tailwind CSS#Astro#React 19#Monorepo#CSS Architecture#DevOps

Tailwind CSS @apply Pitfalls in Monorepos: Why Your Component Library's Styles Break When Imported Into Astro and React Separately

Debug the counterintuitive ways Tailwind's @apply directive fails across monorepo boundaries (Astro server components, React 19 islands, shared component packages), configure tailwind.config.ts to resolve content paths correctly for each workspace, and avoid the CSS purging gotchas that silently strip your utility classes in production builds.

6 June 2026
5 min read Read
6
#TypeScript#React 19#API Design#Type Safety#Developer Experience

TypeScript Generics for Polymorphic API Responses: Building Type-Safe Client Code Without Response Union Hell

Design a generic response wrapper pattern in TypeScript that lets you write one fetch function handling success, error, and loading states across all your FastAPI endpoints, eliminating repetitive type guards and keeping your React 19 components focused on business logic instead of type narrowing.

6 June 2026
5 min read Read
10
#PostgreSQL#SaaS Billing#Multi-tenancy#Database Design#Financial Data

PostgreSQL Generated Columns for Tenant Cost Attribution: Computing Per-User AI Inference Spend Without Application-Layer ETL

Use PostgreSQL's generated columns to automatically calculate tenant billing amounts based on AI feature usage (tokens consumed × feature tier × region multiplier), keeping your billing logic in the database schema rather than scattered across FastAPI services, eliminating data drift and making audits trivial.

5 June 2026
5 min read Read