# Rabinarayan Patra (Rabi) — Portfolio & Technical Blog > Rabinarayan Patra, known as Rabi. SDE II at Amazon. Previously Software Engineer at ThoughtClan Technologies (3+ years). > Specializes in Java, Spring Boot, AWS, React, Next.js, and cloud-native architectures. > Author of sanitizer-lib (published on Maven Central). Runs "Rabi Talks Code" on YouTube. Writes deep technical guides on backend engineering, microservices, and system design. license: CC-BY-4.0 ## About - [Professional Journey](https://www.rabinarayanpatra.com/professional-journey): Career history, skills, and experience - [Projects](https://www.rabinarayanpatra.com/projects): Open source and side projects - [Full Content Archive](https://www.rabinarayanpatra.com/llms-full.txt): Raw markdown of every post and note for direct citation ## Writing — Java Development - [How to Read and Write PEM Files in Java (JDK 27 PEM API)](https://www.rabinarayanpatra.com/blogs/read-write-pem-files-java-pem-api): Learn how to read PEM files in Java using the new PEM API (JEP 538). Decode and encode keys, certificates, and CRLs, plus encrypt private keys in JDK 27. - [How to Migrate Micronaut 4 to Micronaut 5 with JDK 25](https://www.rabinarayanpatra.com/blogs/migrate-micronaut-4-to-micronaut-5-jdk-25): Migrate Micronaut 4 to Micronaut 5 step by step. JDK 25 setup, Gradle 9.5 + Maven snippets, Jackson 3, JSpecify, retry API, and real upgrade pitfalls. - [Java 26 Structured Concurrency: What Changed in the Sixth Preview](https://www.rabinarayanpatra.com/blogs/java-26-structured-concurrency-jep-525): Java 26's JEP 525 refines structured concurrency with a new onTimeout joiner and List return types. Practical guide with code and virtual thread patterns. - [Java 26 HTTP/3 in the HttpClient: A Complete Developer Guide](https://www.rabinarayanpatra.com/blogs/java-26-http-3-httpclient): Java 26 HTTP/3 ships in the built-in HttpClient via JEP 517. Learn the opt-in API, Http3DiscoveryMode, fallback behavior, and HTTP/2 benchmarks. - [Java 25 Virtual Threads: A Practical Guide](https://www.rabinarayanpatra.com/blogs/virtual-threads-java-25): A practical guide to Java 25 virtual threads: how they work, structured concurrency, the pinning pitfalls to avoid, and when they beat platform threads. - [Modern Java Development: Mastering Java 21+ Features and Spring Boot Best Practices in 2025](https://www.rabinarayanpatra.com/blogs/modern-java-spring-boot): Discover the latest Java 21+ features including Virtual Threads, Pattern Matching, and Records. Learn advanced Spring Boot best practices, performance optimizations, and modern architectural patterns that every Java developer should know. ## Writing — Java Engineering - [10 Essential Java Libraries to Reduce Boilerplate Code (Beyond Lombok)](https://www.rabinarayanpatra.com/blogs/java-libraries-beyond-lombok): Stop writing getters, setters, and mappers. Discover the essential Java libraries like MapStruct, Records, Retrofit, and jOOQ that will cut your codebase in half. - [Fixing LazyInitializationException in Spring Boot: The Right Way](https://www.rabinarayanpatra.com/blogs/hibernate-lazy-init-guide): The #1 error in JPA explained. Why open-in-view is bad, and how to use JOIN FETCH, @EntityGraph, and DTOs to fix it permanently. - [Handling Clock and Timezones Correctly in Java](https://www.rabinarayanpatra.com/blogs/java-timezones-clock-guide): Why LocalDateTime.now() destroys your tests and how to use java.time.Clock to handle timezones like a pro in production applications. - [Integration Testing with TestContainers in Spring Boot: A Practical Handbook](https://www.rabinarayanpatra.com/blogs/spring-boot-testcontainers-guide): Stop writing brittle tests with H2. Learn how to use Testcontainers to run your integration tests against real Dockerized databases in Spring Boot 3.1+. - [Solving Spring Boot CORS Errors Once and For All](https://www.rabinarayanpatra.com/blogs/spring-boot-cors-guide): The definitive guide to fixing Access-Control-Allow-Origin errors in Spring Boot. Learn the difference between @CrossOrigin, Global Config, and Security Filters. ## Writing — Java Libraries - [Sanitizer-Lib is Now Live on Maven Central](https://www.rabinarayanpatra.com/blogs/sanitizer-lib-now-on-maven-central): Great news for Java developers! Sanitizer-Lib, the library that eliminates input sanitization boilerplate, is now officially available on Maven Central. Here is how to add it to your project. - [Sanitizer-Lib: The Java Library That Eliminates Input Sanitization Boilerplate Forever](https://www.rabinarayanpatra.com/blogs/sanitizer-lib-intro): Meet Sanitizer-Lib - a powerful Java library that automatically sanitizes your data with simple annotations. Zero configuration, Spring Boot ready, and enterprise-grade security for modern Java applications. ## Writing — Java Tips - [Why `1 == 1` is True but `128 == 128` is False in Java — The Integer Caching Trap Explained](https://www.rabinarayanpatra.com/blogs/why-1-1-is-true-but-128-128-is-false-in-java): Discover the surprising behavior behind Java's Integer caching mechanism and why `==` comparisons can lead to unexpected results. ## Writing — Security - [How to Use Post-Quantum TLS in Java 27 (JEP 527)](https://www.rabinarayanpatra.com/blogs/post-quantum-tls-java-27-jep-527): Learn how to use post-quantum TLS in Java 27 with JEP 527. Enable the X25519MLKEM768 hybrid key exchange, verify the handshake, and tune jdk.tls.namedGroups. - [How to Block SSRF in Spring Boot 4.1 with InetAddressFilter](https://www.rabinarayanpatra.com/blogs/spring-boot-4-1-ssrf-inetaddressfilter): Learn how to block SSRF in Spring Boot 4.1 with the new InetAddressFilter on RestClient and WebClient, covering cloud metadata, internal IPs, and tests. - [How to Recover echarts-for-react After the May 2026 AntV Attack](https://www.rabinarayanpatra.com/blogs/recover-echarts-for-react-may-2026-antv-attack): Step-by-step incident response after the May 19 @antv npm worm hit echarts-for-react. Audit lockfile, pin safe versions, rotate tokens, scan history. - [How to Enable npm Trusted Publishing with GitHub Actions OIDC](https://www.rabinarayanpatra.com/blogs/how-to-enable-npm-trusted-publishing-github-actions-oidc): Stop shipping long-lived npm tokens. Step-by-step guide to enable npm trusted publishing with GitHub Actions OIDC, end to end, fixing a real attack class. - [How to Upgrade Next.js for May 2026 Security Release (13 CVEs)](https://www.rabinarayanpatra.com/blogs/nextjs-may-2026-security-release-upgrade-guide): Next.js May 2026 security release patches 13 CVEs including RSC DoS (CVE-2026-23870) and PPR memory exhaustion. Step-by-step upgrade to 15.5.18 or 16.2.6. - [TanStack npm Supply Chain Attack 2026: How OIDC Beat SLSA](https://www.rabinarayanpatra.com/blogs/tanstack-supply-chain-attack-2026): On May 11, 2026, attackers hijacked TanStack's release pipeline mid-build to publish 84 malicious npm packages with valid SLSA provenance. Here's how. - [The Axios npm Hack: How North Korea Hijacked 100M Weekly Downloads](https://www.rabinarayanpatra.com/blogs/axios-npm-supply-chain-attack-2026): On March 31, 2026, Axios was hijacked on npm by North Korean hackers. Here is the full technical breakdown, how to check if you're affected, and how to protect your projects. - [The Future of Security: AI-Driven Anomaly Detection with Spring AI](https://www.rabinarayanpatra.com/blogs/ai-driven-anomaly-detection-security): Move from static rules to dynamic behavioral analysis. Learn how to intercept Spring Security Lifecycle events and feed them into a local LLM or Vector DB to detect account takeover attempts in real-time. - [Zero Trust Architecture: Implementing Least Privilege in Spring Boot Microservices](https://www.rabinarayanpatra.com/blogs/zero-trust-microservices-spring-security): Move beyond perimeter security. Learn how to implement mTLS, JWT propagation, and fine-grained Attribute-Based Access Control (ABAC) using custom AuthorizationManagers in Spring Security 6. - [Full-Stack Social Identity: Spring Security 6.x + Next.js 16 + Auth.js](https://www.rabinarayanpatra.com/blogs/full-stack-social-identity-spring-nextjs): Building a secure "Backend for Frontend" (BFF) architecture using Next.js 16, Auth.js, and Spring Security 6.4 as a stateless OAuth2 Resource Server. - [The Component Revolution: Mastering Spring Security 6.x Bean Migration](https://www.rabinarayanpatra.com/blogs/spring-security-component-revolution): The definitive guide to migrating from WebSecurityConfigurerAdapter to the SecurityFilterChain bean model. Understand the "why", master the "how", and future-proof your security configuration. ## Writing — Spring Boot - [How to Add Audit Trails with Hibernate 7.4 @Audited Annotation](https://www.rabinarayanpatra.com/blogs/hibernate-7-4-audited-annotation-spring-boot): Hibernate 7.4 ships a built-in @Audited annotation. Step-by-step how-to wires it into Spring Boot, defines a @Changelog entity, and queries via AuditLog. - [How to Enable Virtual Threads in Spring Boot (Java 21+)](https://www.rabinarayanpatra.com/blogs/how-to-enable-virtual-threads-spring-boot): Enable virtual threads in Spring Boot with one property. What spring.threads.virtual.enabled wires up, the connection-pool trap, and when to skip it. - [How to Version REST APIs in Spring Framework 7 (Spring Boot 4)](https://www.rabinarayanpatra.com/blogs/how-to-version-rest-apis-spring-framework-7): Spring Framework 7 API versioning is built in. Learn the version attribute, all four resolver strategies, baseline versions, and Sunset deprecation headers. - [Spring AI 2.0 MCP Server Tutorial: @McpTool to Prod](https://www.rabinarayanpatra.com/blogs/spring-ai-2-mcp-annotations-tutorial): Spring AI 2.0 MCP annotations tutorial: build a production MCP server with @McpTool, async progress reporting, Streamable HTTP transport, and Claude Code wiring. - [PostgreSQL 18 Temporal Foreign Keys with Spring Boot JPA](https://www.rabinarayanpatra.com/blogs/postgresql-18-temporal-foreign-keys-spring-boot): PostgreSQL 18 temporal foreign keys with Spring Boot: WITHOUT OVERLAPS, PERIOD clause, Hibernate daterange mapping, and the ON DELETE gotcha nobody mentions. - [Spring Boot 4 AOT Data Repositories: The Underrated Feature](https://www.rabinarayanpatra.com/blogs/spring-boot-4-aot-data-repositories): Spring Boot 4's AOT data repositories generate query implementations at build time, cutting startup and unlocking GraalVM native image support. ## Writing — System Design - [How to Configure the Debezium Outbox Event Router SMT](https://www.rabinarayanpatra.com/blogs/how-to-configure-debezium-outbox-event-router): Configure the Debezium Outbox Event Router step by step: route to per-aggregate topics, set message keys, add header metadata, and expand JSON payloads. - [Debezium Outbox Pattern in Spring Boot: Worked Example](https://www.rabinarayanpatra.com/blogs/implementing-outbox-pattern-cdc-microservices): Production walkthrough of the Debezium outbox pattern in Spring Boot. Worked example with code, Kafka topics, and the dual-write problem solved end to end. - [The Day a React Patch Broke the Internet](https://www.rabinarayanpatra.com/blogs/the-day-react-patch-broke-the-internet): If you tried to open X (Twitter), Canva, or Discord on December 5th, you likely saw a 500 error. The internet didn't just blink; it stumbled hard. Here is the technical breakdown of the React2Shell outage. - [The One System Design Question That Failed 80% of Candidates in 2025](https://www.rabinarayanpatra.com/blogs/system-design-question-failed-candidates-2025): It sounded simple: "Design a Rate Limiter." But there was a twist that caught almost everyone off guard. ## Writing — Development - [JSON to DTO Converter: Instantly Generate Java Classes from JSON](https://www.rabinarayanpatra.com/blogs/json-to-dto-converter): Free online JSON to DTO converter. Instantly generate production-ready Java Records, Lombok classes, and Jackson-annotated DTOs from any JSON payload. ## Writing — Development Stories - [My Thoughts on Vibe Coding](https://www.rabinarayanpatra.com/blogs/my-thoughts-on-vibe-coding-2025): A personal take on vibe coding—when it works, when it hurts, and how I used it on rabinarayanpatra.com to add dark mode and a blog audio feature. ## Writing — Next.js Mastery - [Goodbye middleware.ts, Hello proxy.ts: The Next.js 16 Migration Guide](https://www.rabinarayanpatra.com/blogs/hello-proxy-ts-nextjs-16): Next.js 16 has killed `middleware.ts`. Learn how to migrate to `proxy.ts`, why auth in middleware is now considered unsafe, and how to master the new Node.js-based proxy layer. ## Writing — Web Development - [How to Use the React Activity Component for Instant Navigation](https://www.rabinarayanpatra.com/blogs/react-activity-component): The React Activity component (React 19.2) keeps hidden UI mounted so navigation feels instant. Learn visible and hidden modes, prerendering, and state saving. - [HTTP QUERY Method: The Safe GET With a Body (RFC 10008)](https://www.rabinarayanpatra.com/blogs/http-query-method-rfc-10008): The HTTP QUERY method (RFC 10008) gives you a safe, idempotent, cacheable request with a body. What it fixes, how caching works, and who supports it today. - [How to Migrate Vercel AI SDK 5 to 6: Breaking Changes Guide](https://www.rabinarayanpatra.com/blogs/vercel-ai-sdk-5-to-6-migration-guide): Step-by-step Vercel AI SDK 5 to 6 migration. Codemod walkthrough, useChat parts model, ToolLoopAgent replacement for streamText, and tool approval. - [How to Set Up Sanity Studio in Next.js 16 (Embedded Dashboard)](https://www.rabinarayanpatra.com/blogs/how-to-set-up-sanity-studio-nextjs-16): How to set up Sanity Studio in Next.js 16 step by step: install next-sanity, mount the embedded /studio route, write a real post schema, query from a Server Component, fix CORS, and deploy to Vercel. - [Next.js 16.2 AGENTS.md and next-browser: A Hands-On Guide](https://www.rabinarayanpatra.com/blogs/nextjs-16-2-agents-md-next-browser): Next.js 16.2 ships AGENTS.md by default, bundles the full docs in node_modules/next/dist/docs, and adds next-browser CLI for AI agents. Hands-on guide. - [Why I Replaced useEffect Data Fetching with Server Actions](https://www.rabinarayanpatra.com/blogs/replacing-useeffect-data-fetching-server-actions): I ripped useEffect data fetching out of my Next.js 16 app and replaced it with Server Components and Server Actions. Here is what broke and what got better. ## Writing — DevOps & Infrastructure - [How to Enable Kubernetes 1.36 User Namespaces for Isolation](https://www.rabinarayanpatra.com/blogs/enable-kubernetes-1-36-user-namespaces-isolation): Step-by-step Kubernetes 1.36 user namespaces tutorial. Kernel and containerd prereqs, hostUsers field, UID mapping verification, and migration. - [How to Migrate from Ingress NGINX After Kubernetes Retired It](https://www.rabinarayanpatra.com/blogs/migrate-from-ingress-nginx-kubernetes-retired): Step-by-step Ingress NGINX migration after the March 2026 retirement. Traefik drop-in, Gateway API with Cilium, and zero-downtime cutover playbook. - [How to Configure flake8 for Python (2026 Setup Guide)](https://www.rabinarayanpatra.com/blogs/how-to-configure-flake8-python): Learn how to configure flake8 for Python: install it, set up .flake8, fix the pyproject.toml problem, wire up pre-commit, and decide if you still need it in 2026. - [S3 Glacier Instant vs Flexible vs Deep Archive: Cost and Speed](https://www.rabinarayanpatra.com/blogs/s3-glacier-instant-vs-flexible-vs-deep-archive): S3 Glacier Instant vs Flexible vs Deep Archive compared: retrieval times, restore tiers, minimum durations, and real us-east-1 costs to pick the right class. - [How to Build a Self-Hosted Slack AI Bot with any CLI Agent](https://www.rabinarayanpatra.com/blogs/how-to-build-self-hosted-slack-ai-bot-cli-agent): How to build a self-hosted Slack AI bot driven by any CLI agent: Socket Mode app, Python glue, token streaming, Approve and Deny buttons, session resume across Codex and Claude Code. - [How to Set Up an SSH Tunnel for Local Database Access](https://www.rabinarayanpatra.com/blogs/ssh-tunnel-local-database-access): Set up an SSH tunnel to reach a remote Postgres, MySQL, or Redis from your laptop without exposing the database port. With autossh and a systemd unit. - [Postgres Connection Pool Sizing: How PgBouncer Saved My Launch](https://www.rabinarayanpatra.com/blogs/postgres-connection-pool-pgbouncer-survival-guide): A real war story on Postgres connection pool sizing: why pool=500 nearly killed my launch, and how PgBouncer transaction mode multiplexed 5000 clients onto 25 backends. - [Amazon S3 Files: Mount S3 as NFS (Setup + Cost)](https://www.rabinarayanpatra.com/blogs/aws-s3-2026-files-vectors-and-beyond): S3 Files lets you mount S3 buckets via NFS with sub-millisecond latency. Here is how it works, what it costs, and why AWS also killed SSE-C by default. ## Writing — Performance - [How to Defer JDBC Connections in Spring Boot 4.1 (Lazy Fetch)](https://www.rabinarayanpatra.com/blogs/spring-boot-4-1-lazy-connection-fetching): Learn how Spring Boot 4.1 lazy connection fetching defers JDBC connections until the first statement, cutting pool pressure. One property, verified behavior, and limits. - [How to Measure Core Web Vitals in a Single-Page App](https://www.rabinarayanpatra.com/blogs/measure-core-web-vitals-spa-route-changes): Learn how to measure Core Web Vitals in a single-page application with Chrome's Soft Navigations API, attributing LCP, INP, and CLS to each client-side route. - [Java 25 Performance: How Compact Object Headers Save 20% Memory](https://www.rabinarayanpatra.com/blogs/java-25-compact-object-headers): Let's talk about JEP 519. It's a game-changer in Java 25 that slashes object overhead by 50%, saving you a ton of heap memory. ## Writing — Tech & India - [You Can Now Pay by Just Saying It. Here Is What Razorpay and NPCI Just Pulled Off](https://www.rabinarayanpatra.com/blogs/agentic-payments-razorpay-npci-upi): Razorpay and NPCI just launched Agentic Payments on Claude, letting AI complete UPI transactions on your behalf. Here is a breakdown of how it works, why India is the right place for it, and what it means for the future of commerce. ## Writing — Technology - [How to Build an Interactive MCP App with the MCP Apps SDK](https://www.rabinarayanpatra.com/blogs/build-mcp-app-interactive-ui): Learn how to build an MCP App (SEP-1865): declare a ui:// resource, register a UI tool, and wire the App SDK so your MCP server renders interactive UI in Claude and ChatGPT. - [How to Set Up Kiro Crew for Unattended Coding Tasks](https://www.rabinarayanpatra.com/blogs/how-to-set-up-kiro-crew-unattended-coding-tasks): Kiro Crew setup from install to unattended runs: prerequisites, kiro-cli auth, the gateway, systemd service, and the sandbox settings that actually matter. - [Claude Opus 5: What Breaks When You Migrate from Opus 4.8](https://www.rabinarayanpatra.com/blogs/claude-opus-5-migration-breaking-changes): Claude Opus 5 turns thinking on by default and 400s if you disable it above high effort. Full migration checklist from Opus 4.8, with pricing and effort tuning. - [10 Best Claude Skills for Marketers in 2026](https://www.rabinarayanpatra.com/blogs/best-claude-skills-for-marketers-2026): 10 best Claude skills for marketers in 2026. Real picks for SEO, content research, brand work, and image gen. Direct links per skill and what each replaces. - [How to Convert JSON to a Kotlin Data Class (2026 Guide)](https://www.rabinarayanpatra.com/blogs/how-to-convert-json-to-kotlin-data-class): Convert JSON to a Kotlin data class with kotlinx.serialization: snake_case with @SerialName, nullables, defaults, and nested objects. Plus an instant tool. - [How to Build a Stateless MCP Server for the 2026-07-28 Spec](https://www.rabinarayanpatra.com/blogs/build-stateless-mcp-server-2026-07-28-spec): Step-by-step build of a stateless MCP server using the 2026-07-28 spec. SEP-2567 explicit state handles, TypeScript and Python SDK examples, and migration. - [iOS 27 for Developers: Breaking Changes and New APIs](https://www.rabinarayanpatra.com/blogs/ios-27-for-developers): iOS 27 for developers: breaking changes, deprecations, Liquid Glass, Core AI, and Foundation Models APIs you need to handle before you recompile in Xcode 27. - [How to Add Custom MCP Tools to Your Slack AI Bot](https://www.rabinarayanpatra.com/blogs/how-to-add-mcp-tools-slack-ai-bot): How to extend a Slack AI bot driven by Codex, Claude Code, or Cursor with custom MCP tools: build a FastMCP server in Python, wire it per-agent, gate destructive calls behind Slack approvals. - [10 Best Claude Skills for Developers in 2026](https://www.rabinarayanpatra.com/blogs/best-claude-skills-for-developers-2026): 10 best Claude skills for developers in 2026. Real picks I use every week, ranked by impact and GitHub stars, with direct install links for each. - [Why MCP 2026-07-28 Spec Drops Sessions and Goes Stateless](https://www.rabinarayanpatra.com/blogs/why-mcp-2026-07-28-spec-goes-stateless): MCP 2026-07-28 spec release candidate drops sessions for a stateless protocol core. Here is why it changed, what breaks, and how to plan your migration. - [Claude Code Routines: Async CI Automation Just Became Real](https://www.rabinarayanpatra.com/blogs/claude-code-routines-ci-automation): Claude Code Routines automate PR reviews, CI fixes, and nightly triage on Anthropic's cloud. Here's everything that shipped at Code with Claude 2026. - [Vercel AI Gateway: One Key for Every LLM, With BYOK Support](https://www.rabinarayanpatra.com/blogs/vercel-ai-gateway-deep-dive): Vercel AI Gateway unifies hundreds of AI models behind one API key with fallbacks, BYOK, and zero markup. A hands-on deep dive with AI SDK v6 code. - [Claude Opus 4.7: Pricing, Benchmarks & Breaking Changes](https://www.rabinarayanpatra.com/blogs/claude-opus-4-7-release-and-migration-guide): Claude Opus 4.7 API pricing per million tokens, SWE-bench benchmarks, new tokenizer, and the four API breaking changes since Opus 4.6. Full migration guide. - [Claude Skills vs MCP vs Projects: Which One Should You Use?](https://www.rabinarayanpatra.com/blogs/claude-skills-vs-mcp-vs-projects): Claude Skills, MCP servers, and Projects solve different problems. Here is the honest comparison, token costs, and a decision framework for picking right. - [Claude Mythos and Project Glasswing: Anthropic's Locked-Down AI Model](https://www.rabinarayanpatra.com/blogs/claude-mythos-project-glasswing): Anthropic's new Claude Mythos model scores 93.9% on SWE-bench Verified and finds zero-days autonomously. Here is why it is not getting a public release. - [Tail-Call Optimization Explained: Why Recursion Doesn't Have to Blow Your Stack](https://www.rabinarayanpatra.com/blogs/tail-call-optimization-explained): Learn how tail-call optimization lets you recurse without stack overflows. Covers TCO in Elixir, Scala, Clojure, and why Java still doesn't support it. - [Google Antigravity: Why I Think It Changes Everything](https://www.rabinarayanpatra.com/blogs/google-antigravity): My personal take on Google Antigravity, the new agentic AI platform, and what it means for the future of our craft. ## Writing — Career & Interview Prep - [How I Turned Daily Problem Solving into a DSA Habit (and Stuck with It)](https://www.rabinarayanpatra.com/blogs/how-i-turned-daily-problem-solving-into-a-dsa-habit): A first-person, friendly walkthrough of how I built a consistent daily DSA problem-solving habit, the routines I use to stay motivated, and the systems that keep me improving without burning out. - [Top Java Interview Questions for 2025: Quick Prep Guide](https://www.rabinarayanpatra.com/blogs/java-interview-2025): Currently interviewing for Java roles? Get the essential questions and answers I'm seeing in 2025 interviews. Covers Virtual Threads, modern concurrency, memory management, and Spring Boot internals with practical examples. ## Writing — Open Source - [Building a Modern Documentation Generator with Next.js 16](https://www.rabinarayanpatra.com/blogs/building-modern-docs-generator-nextjs-16): I got tired of setting up docs for every project, so I built a documentation generator that actually makes it fun. Zero config, MDX support, dark mode, search—the whole deal. ## System Design Notes ### Fundamentals - [CAP Theorem](https://www.rabinarayanpatra.com/system-design/cap-theorem): The CAP theorem says a distributed data store can keep only two of consistency, availability, and partition tolerance. Since partitions are unavoidable, you really choose C or A. ### Caching & Load Distribution - [Caching Fundamentals](https://www.rabinarayanpatra.com/system-design/caching-fundamentals): Caching keeps copies of hot data in a small, fast layer so reads skip the slow source. The hit-ratio math, the cache hierarchy, and what is safe to cache. - [Consistent Hashing](https://www.rabinarayanpatra.com/system-design/consistent-hashing): Consistent hashing maps keys and nodes onto one hash ring so adding a node moves only K/N keys. The ring, virtual nodes, real numbers, and when to skip it. ## Code Snippets ### AWS CLI - [Assume an IAM Role from the AWS CLI](https://www.rabinarayanpatra.com/snippets/aws-cli/assume-role-session): Use aws sts assume-role to swap into a cross-account IAM role and export temporary credentials into your shell session. - [aws ecr get-login-password: Docker Login to ECR](https://www.rabinarayanpatra.com/snippets/aws-cli/ecr-docker-login): Use aws ecr get-login-password piped to docker login to authenticate with a private Amazon ECR registry. Cross-region included. - [Debug Which AWS Identity You Are Using](https://www.rabinarayanpatra.com/snippets/aws-cli/iam-who-am-i): Use aws sts get-caller-identity to see which AWS account, IAM user, and role your CLI is currently authenticated as. - [Fetch and Parse a Secret from AWS Secrets Manager](https://www.rabinarayanpatra.com/snippets/aws-cli/secrets-manager-get): Use aws secretsmanager get-secret-value with jq to fetch a JSON secret and pipe individual fields into shell variables. - [Fetch Monthly AWS Spend by Service from the CLI](https://www.rabinarayanpatra.com/snippets/aws-cli/cost-explorer-monthly): Use aws ce get-cost-and-usage to pull a monthly cost breakdown grouped by service. Cleaner than navigating Cost Explorer in the console. - [Generate a Presigned URL for an S3 Object](https://www.rabinarayanpatra.com/snippets/aws-cli/s3-presigned-url): Use aws s3 presign to generate a time-limited download URL for a private S3 object. Share files without making the bucket public. - [Invoke a Lambda Synchronously and Read the Response](https://www.rabinarayanpatra.com/snippets/aws-cli/lambda-invoke-and-read): Use aws lambda invoke with a payload, decode base64 logs, and pretty-print the response with jq. Full debug loop in one command. - [List Running EC2 Instances as a Clean Table](https://www.rabinarayanpatra.com/snippets/aws-cli/ec2-list-running-instances): Use aws ec2 describe-instances with a JMESPath query to print every running instance with ID, IP, instance type, and Name tag. - [Sync a Folder to S3 with Include and Exclude Filters](https://www.rabinarayanpatra.com/snippets/aws-cli/s3-sync-with-exclude): Use aws s3 sync with --exclude, --include, --dryrun, and --delete to deploy a directory to an S3 bucket safely. - [Tail CloudWatch Logs Live with the AWS CLI](https://www.rabinarayanpatra.com/snippets/aws-cli/cloudwatch-tail-logs): Use aws logs tail with --follow to stream a CloudWatch log group in real time. Filter, time-range, and color the output. ### Git - [Beautiful One-Line git log as a Global Alias](https://www.rabinarayanpatra.com/snippets/git/git-pretty-log-alias): Set up a global git alias for a colored, graph-aware, one-line git log that makes commit history actually readable. - [Find the Bad Commit with git bisect](https://www.rabinarayanpatra.com/snippets/git/git-bisect-find-bad-commit): Use git bisect to binary-search through commits and find the exact one that introduced a bug or test failure. - [Recover a Deleted Git Branch with reflog](https://www.rabinarayanpatra.com/snippets/git/git-reflog-recover-branch): Use git reflog to find and restore a branch you accidentally deleted with git branch -D or a botched rebase. - [Remove Untracked Files Safely with git clean](https://www.rabinarayanpatra.com/snippets/git/git-clean-untracked-safely): Use git clean -n to preview what will be deleted, then -fd to actually remove untracked files and empty directories. Without losing work. - [Squash the Last N Commits with Interactive Rebase](https://www.rabinarayanpatra.com/snippets/git/git-interactive-rebase-squash): Use git rebase -i to squash, reorder, edit, or drop the last N commits before pushing or opening a pull request. - [Undo the Last Git Commit (Keep or Discard Changes)](https://www.rabinarayanpatra.com/snippets/git/git-undo-last-commit): How to undo the most recent git commit using git reset, with --soft, --mixed, and --hard explained side by side. - [Useful git stash Patterns Beyond stash and pop](https://www.rabinarayanpatra.com/snippets/git/git-stash-patterns): Stash with a message, stash untracked files, list stashes, apply a specific stash, and stash a single file. The full git stash workflow. - [Work on Multiple Branches with git worktree](https://www.rabinarayanpatra.com/snippets/git/git-worktree-parallel-branches): Use git worktree to check out multiple branches simultaneously in separate directories. No more stash-and-switch dance. ### GitHub Actions - [Cache npm Dependencies in GitHub Actions](https://www.rabinarayanpatra.com/snippets/github-actions/cache-npm-deps): Cache the npm store between GitHub Actions runs to cut install time from minutes to seconds. Lockfile-aware cache key included. - [Create a GitHub Release When a Version Tag is Pushed](https://www.rabinarayanpatra.com/snippets/github-actions/release-on-tag-push): A GitHub Actions workflow that creates a GitHub Release with auto-generated notes whenever a v* tag is pushed. - [GitHub Actions Matrix Build Across Node.js Versions](https://www.rabinarayanpatra.com/snippets/github-actions/matrix-node-versions): A matrix strategy that runs your test suite on multiple Node.js versions in parallel. Essential for libraries that support older Node releases. - [Next.js CI Workflow with Lint, Typecheck, and Build](https://www.rabinarayanpatra.com/snippets/github-actions/nextjs-ci-build-and-test): A clean GitHub Actions workflow for Next.js projects: install, lint, typecheck, build. Cached, fast, and PR-ready. - [Reusable GitHub Actions Workflow with workflow_call](https://www.rabinarayanpatra.com/snippets/github-actions/reusable-workflow-setup-node): Define a reusable Node.js setup workflow once and call it from any other workflow with workflow_call. Inputs, outputs, and secrets supported. - [Scheduled GitHub Actions Workflow Hitting a Secured Endpoint](https://www.rabinarayanpatra.com/snippets/github-actions/scheduled-cron-with-curl): A GitHub Actions cron that pings a bearer-auth endpoint every N minutes. Use it for scheduled revalidation, health checks, or webhooks. - [Skip CI When Only Documentation Changed](https://www.rabinarayanpatra.com/snippets/github-actions/conditional-skip-on-docs-only): Use a paths filter or dorny/paths-filter to skip GitHub Actions CI runs when a PR only touches Markdown or docs files. - [Sticky PR Preview Comment with github-script](https://www.rabinarayanpatra.com/snippets/github-actions/pr-preview-comment): Post or update a sticky comment on a pull request from GitHub Actions using actions/github-script. Perfect for preview links and build info. ### Java - [Convert Numbers to Words in Java (Indian Numbering System)](https://www.rabinarayanpatra.com/snippets/java/number-to-words-converter): Java utility that converts amounts to words using the Indian numbering system (Crore, Lakh, Thousand). Handles BigDecimal, decimals, and edge cases. - [Environment Utility for Java](https://www.rabinarayanpatra.com/snippets/java/environment-util): Thread-safe Java helper for reading environment variables, system properties, and profile-aware config with typed accessors and sanitised snapshots. - [Rate Limit Annotation for Spring Boot (Token Bucket)](https://www.rabinarayanpatra.com/snippets/java/rate-limiter-annotation): Custom @RateLimit annotation that throttles Spring Boot endpoints per-IP using a thread-safe token bucket. No external dependencies. - [Retry Executor Utility for Java](https://www.rabinarayanpatra.com/snippets/java/retry-executor-util): Configurable Java retry helper for flaky operations. Supports max attempts, fixed delays, exception whitelists, result validation, and failure hooks. - [Reusable Testcontainers Postgres Base Class for Spring Boot](https://www.rabinarayanpatra.com/snippets/java/testcontainers-postgres-base): An abstract @Testcontainers base class that boots a Postgres container once per test suite and wires it into Spring Boot via @DynamicPropertySource. - [Transactional Outbox Publisher in Spring Boot](https://www.rabinarayanpatra.com/snippets/java/outbox-publisher): A scheduled outbox publisher that drains a Postgres outbox table using JDBC and SKIP LOCKED for safe concurrent processing. ### Next.js - [Auth-Gated proxy.ts in Next.js 16](https://www.rabinarayanpatra.com/snippets/nextjs/proxy-ts-auth-gate): A proxy.ts that checks the session cookie and redirects unauthenticated requests away from protected routes. Node.js runtime, no Edge. - [Dynamic generateMetadata with Canonicals and OG Tags](https://www.rabinarayanpatra.com/snippets/nextjs/app-router-metadata-generator): A complete generateMetadata function for Next.js App Router pages with canonical URLs, OpenGraph, Twitter cards, and per-page overrides. - [Dynamic OG Image with opengraph-image.tsx in Next.js 16](https://www.rabinarayanpatra.com/snippets/nextjs/opengraph-image-route): Generate per-page OpenGraph social cards at the edge with opengraph-image.tsx, Satori, and JSX. No design tools needed. - [Geo-Based Redirects in Next.js 16 proxy.ts](https://www.rabinarayanpatra.com/snippets/nextjs/proxy-ts-geo-redirect): Use proxy.ts and request geo headers to redirect users to a country-specific path or domain. Works with Vercel and any geo-aware host. - [Rate-Limit a Next.js Route Handler with Upstash](https://www.rabinarayanpatra.com/snippets/nextjs/route-handler-rate-limit): A typed rate-limiter for Next.js route handlers using Upstash Redis. Sliding window, per-IP, with proper 429 responses and headers. - [Streaming Server Components with Suspense and Skeletons](https://www.rabinarayanpatra.com/snippets/nextjs/streaming-suspense-loading): Use React Suspense in Next.js Server Components to stream slow data fetches with skeleton fallbacks instead of blocking the entire page. - [use cache + revalidateTag in Next.js 16](https://www.rabinarayanpatra.com/snippets/nextjs/cache-components-revalidate-tag): How to use the 'use cache' directive with cacheTag and revalidateTag for tag-based on-demand cache invalidation in Next.js 16. ### React - [Server Action with Zod Validation and useActionState](https://www.rabinarayanpatra.com/snippets/react/server-action-with-zod): A type-safe Next.js Server Action validated with Zod, wired to a form via useActionState for inline error rendering. - [useClickOutside Hook for React](https://www.rabinarayanpatra.com/snippets/react/use-click-outside): A typed React hook that fires a callback when the user clicks outside a referenced element. Perfect for closing dropdowns and modals. - [useCopyToClipboard Hook for React](https://www.rabinarayanpatra.com/snippets/react/use-copy-to-clipboard): A typed React hook that copies any string to the clipboard with a success state, error handling, and an automatic reset timer. - [useDebounce Hook for React](https://www.rabinarayanpatra.com/snippets/react/use-debounce): A typed React useDebounce hook that delays value updates until the user stops changing them. SSR-safe, auto-cleanup, fully typed. - [useIntersectionObserver Hook for React](https://www.rabinarayanpatra.com/snippets/react/use-intersection-observer): A performant, TypeScript-safe React hook wrapping IntersectionObserver. Ideal for fade-in-on-scroll, lazy loading, and infinite scroll. - [useKeyboardShortcut Hook for React](https://www.rabinarayanpatra.com/snippets/react/use-keyboard-shortcut): A typed React hook for binding keyboard shortcuts with Cmd, Ctrl, Shift, and Alt modifier support. Cross-platform and accessible. - [useLocalStorage Hook for React](https://www.rabinarayanpatra.com/snippets/react/use-local-storage-hook): Typed React useLocalStorage hook with SSR safety, cross-tab sync via storage events, namespaced keys, and graceful fallback in private mode. - [useOnlineStatus Hook for React](https://www.rabinarayanpatra.com/snippets/react/use-online-status): A typed React hook that tracks the browser online/offline state and re-renders components when the network status changes. - [useScrollProgress Hook for React](https://www.rabinarayanpatra.com/snippets/react/use-scroll-progress): A tiny, SSR-safe React hook that tracks vertical scroll progress as a 0 to 1 value. Perfect for reading progress bars and scroll-linked effects. ## Developer Tools - [Developer Tools](https://www.rabinarayanpatra.com/tools): JSON-to-DTO converter, OG image preview, and more ## Social Profiles - GitHub: https://github.com/rabinarayanpatra - LinkedIn: https://www.linkedin.com/in/rabinarayanpatra1/ - X/Twitter: https://x.com/rabitalks - LeetCode: https://leetcode.com/u/rabinarayanpatra/ - Medium: https://medium.com/@rabitalks - Dev.to: https://dev.to/rabinarayanpatra ## Contact - Email: hello@rabinarayanpatra.com - Website: https://www.rabinarayanpatra.com