IAMUVIN

Blog

Blog

Technical writing on Web3, AI, and building things. Written by Uvin Vindula.

130 articles · 7 in Full-Stack Engineering

Full-Stack Engineering13 min
IAMUVIN

Stripe Integration in Next.js: Payments, Subscriptions, and Webhooks

Everything I learned integrating Stripe into production Next.js apps: Checkout vs Elements, subscription billing with metered usage, webhook handling in Route Handlers, idempotency patterns, failed payment recovery, and the Customer Portal. Real patterns from FreshMart (UK grocery platform) and multiple client projects. Includes TypeScript code for every integration point, testing with Stripe CLI, and the architecture that handles thousands of transactions without losing a single one.

U
Uvin Vindula·March 17, 2025
Full-Stack Engineering12 min
IAMUVIN

Database Schema Design for Production Applications

The PostgreSQL schema design patterns I use in every production application I build through Supabase. From naming conventions and data type decisions to indexing strategy, UUID vs serial IDs, soft deletes, and migration workflows. Real schemas from EuroParts Lanka (products, orders, users, parts), uvin.lk (modules, lessons, progress tracking), and FreshMart (products, orders, carts). These aren't textbook patterns — they're battle-tested designs running in production right now, serving real users across Sri Lanka, the UK, and beyond.

U
Uvin Vindula·January 6, 2025
Full-Stack Engineering11 min
IAMUVIN

Error Handling in TypeScript and Next.js: Patterns That Scale

The error handling patterns I use in every TypeScript and Next.js project to keep production apps alive. From structured error types and consistent API responses to React error boundaries, Next.js error.tsx files, Result types, and proper logging. Real patterns from uvin.lk and EuroParts Lanka that handle the failures most tutorials pretend don't exist. Never swallow errors, never return string messages, never ship a catch block that does nothing.

U
Uvin Vindula·October 21, 2024
Full-Stack Engineering12 min
IAMUVIN

Authentication in Next.js with Supabase: Production Patterns

Production authentication patterns I use in every Next.js project with Supabase Auth. From email/password and OAuth flows to middleware-based session management, protected routes on both server and client, role-based access control, and the auth bugs that cost me hours. Real patterns from uvin.lk and EuroParts Lanka that handle expired sessions, OAuth callback races, and edge cases most tutorials skip.

U
Uvin Vindula·August 5, 2024
Full-Stack Engineering11 min
IAMUVIN

Zod Validation in Next.js: From Form Inputs to API Responses

A complete guide to using Zod v4 for runtime validation in Next.js applications. Covers form validation with Server Actions, API route validation, environment variable safety, external API response parsing, React Hook Form integration, custom error messages, and battle-tested validation patterns from production codebases.

U
Uvin Vindula·June 17, 2024
Full-Stack Engineering11 min
IAMUVIN

Next.js API Route Design Patterns for Production

Battle-tested Next.js API route design patterns from real production apps. Covers Route Handlers with Zod validation, authentication middleware, structured error handling, rate limiting, cursor-based pagination, file uploads, webhook endpoints, and a complete production API checklist.

U
Uvin Vindula·April 15, 2024
Full-Stack Engineering12 min
IAMUVIN

TypeScript Patterns I Use in Every Production App

The TypeScript patterns that survive production: strict mode enforcement, Zod runtime validation, discriminated unions for state machines, branded types for entity IDs, generic API clients, type-safe environment variables, and the utility types that actually matter. Real code from apps I've shipped, not textbook examples. Includes patterns I stopped using and why.

U
Uvin Vindula·March 25, 2024