# Chamikara Nayanajith, AI First Full-Stack Engineer > Portfolio and blog of Chamikara Nayanajith, an AI first full-stack engineer from Sri Lanka specializing in React, Next.js, TypeScript, Node.js, AI and RAG systems, cloud infrastructure, smart contracts, and ESP32 IoT. Available for freelance projects, collaborations, and full-time opportunities. With over nine years of experience, Chamikara builds web and AI-powered applications, leads engineering teams, and delivers projects end to end for clients worldwide. His approach is AI first: AI assists planning, architecture, coding, debugging, testing, and documentation, and it also ships inside the products as LLM features, retrieval-augmented generation (RAG) pipelines, vector search, and agents. Preferred contact: email connect@cnayanajith.com or the contact form at https://cnayanajith.com/contact. ## Pages - [About](https://cnayanajith.com/): Professional background, skills, testimonials, and client logos - [Projects](https://cnayanajith.com/projects): Portfolio of web and mobile applications with detailed case studies - [Resume](https://cnayanajith.com/resume): Work experience, education, and technical skills - [Blog](https://cnayanajith.com/blog): Tutorials and articles on React, TypeScript, CSS, and modern web development - [Contact](https://cnayanajith.com/contact): Contact form, availability, and frequently asked questions ## Projects - [AI-Powered Support Automation Platform](https://cnayanajith.com/projects/ai-powered-support-automation-platform/case-study): AstraFlow is an AI-powered support automation platform built for a web hosting company facing high ticket volumes and slow response times. The system automatically analyzes and replies to support tickets, manages multi-turn conversations, and escalates complex issues to human agents with clear AI-generated summaries. Integrated Slack, email, and CRM updates ensure seamless handoff. The solution reduced human-handled tickets by 55%, improved response speed, and enabled scalable, efficient customer support operations. - [DG Upali & Sons (Pvt) Ltd - Corporate Website Design](https://cnayanajith.com/projects/dg-upali-sons-pvt-ltd-corporate-website-design/case-study): DG Upali & Sons (Pvt) Ltd is a logistics and cargo handling company that previously had no website to showcase its services or experience. I designed and developed a professional corporate website that clearly presents their offerings, company background, and completed projects. The new site improves how the business is represented online, makes it easier for customers to understand services, and increases engagement through a clean structure, modern design, and clear calls to action. - [Neeroga Healthcare - Unified Hospital Management System](https://cnayanajith.com/projects/neeroga-healthcare-unified-hospital-management-system/case-study): Neeroga Healthcare is a multi-specialty medical facility that struggled with fragmented paper-based records and manual scheduling. I developed a high-performance Next.js ecosystem that digitizes the entire patient journey, from AI-powered appointment booking to automated billing and Electronic Medical Records (EMR). The system streamlines clinical workflows, reduces patient wait times, and provides doctors with real-time access to critical health data through a minimal, high-contrast dashboard. ## Blog Posts - [useActionState: Validation Errors, Resets and Typed State](https://cnayanajith.com/blog/useactionstate-form-validation): useActionState with real validation: typed Zod field errors, inputs that survive React 19's form reset, pending UI, and Vitest tests with real output. - [useEffect in React: Dependencies, Cleanup, and Timing](https://cnayanajith.com/blog/react-useeffect-guide): How useEffect really works: the dependency array, cleanup functions, StrictMode double runs, async effects, and the cases where you should not use it. - [useMemo vs useCallback vs React.memo: When to Use Each](https://cnayanajith.com/blog/usememo-usecallback-react-memo): useMemo caches a value, useCallback caches a function, React.memo skips a re-render. The difference, when each pays off, and what the React Compiler changes. - [useRef in React: DOM Access, Mutable Values, and Types](https://cnayanajith.com/blog/react-useref-guide): Use useRef for DOM nodes and mutable values that survive renders without triggering one. Covers useRef vs useState, ref callbacks, and TypeScript typing. - [useReducer in React: When It Beats useState](https://cnayanajith.com/blog/react-usereducer-guide): useReducer keeps related state in one place. Compare it with useState, type reducers with discriminated unions, and see where it beats a state library. - [React Suspense and lazy: Loading States Without Flicker](https://cnayanajith.com/blog/react-suspense-lazy): React Suspense shows a fallback while its children load. Covers React.lazy code splitting, boundary placement, streaming SSR, and avoiding layout flicker. - [React Server Components and Server Actions in Next.js](https://cnayanajith.com/blog/react-server-components-nextjs): How React Server Components work in the Next.js App Router: the server and client boundary, data fetching, Server Actions, and the errors you will hit. - [LLM API Integration: Streaming, Retries, and Cost Control](https://cnayanajith.com/blog/llm-api-integration-nodejs): Take an LLM API from quickstart to production: server-side keys, SSE streaming, typed error handling, structured output, prompt caching, and timeouts. - [RAG Pipeline: Retrieval Augmented Generation, Step by Step](https://cnayanajith.com/blog/rag-pipeline-guide): Build a RAG pipeline end to end: chunking, embeddings, vector storage, reranking, and grounded prompts, plus how to evaluate retrieval instead of guessing. - [Chunking Strategies and Embeddings for Better RAG](https://cnayanajith.com/blog/chunking-embeddings-vector-search): Retrieval quality is set by chunking and search, not the prompt. Compares chunking strategies, text embeddings, hybrid search, reranking and measuring recall. - [AI Agents and Tool Calling: Building a Loop That Works](https://cnayanajith.com/blog/ai-agents-tool-calling): How tool calling actually works, writing tool descriptions models use correctly, capping the agent loop, keeping context small, and when not to build an agent. - [ESP32 Projects for Beginners: Setup, Wi-Fi, and Sensors](https://cnayanajith.com/blog/esp32-projects-beginners): Four ESP32 projects for beginners: set up the Arduino IDE, blink an LED, connect to Wi-Fi, read a DHT22 sensor, and run a web server, plus the pins to avoid. - [ESP32 Weather Station: BME280, Deep Sleep, and MQTT](https://cnayanajith.com/blog/esp32-weather-station): Build a battery-powered ESP32 weather station: BME280 in forced mode, deep sleep between readings, static IP Wi-Fi, MQTT publishing, and battery monitoring. - [JWT Authentication in Node.js: Refresh Tokens Done Right](https://cnayanajith.com/blog/jwt-authentication-nodejs): How JWT auth actually works in Node.js: signing and verifying, access and refresh token rotation, where to store tokens, and when a session beats a JWT. - [REST API Design: Status Codes, Versioning, and Pagination](https://cnayanajith.com/blog/rest-api-design): Design a REST API people can use: resource naming, the status codes that matter, error response shape, cursor pagination, and versioning without breakage. - [API Rate Limiting: Token Bucket, Redis, and 429 Headers](https://cnayanajith.com/blog/api-rate-limiting): Rate limit an API properly: fixed window vs sliding window vs token bucket, a Redis implementation, the RateLimit headers to send, and per-user keying. - [WebSockets vs SSE vs Polling: Picking a Real-Time Transport](https://cnayanajith.com/blog/websockets-vs-sse-vs-polling): Compare WebSockets, Server-Sent Events and polling for real-time data: reconnection, scaling across instances, proxy buffering, and which to actually pick. - [Node.js Streams and Backpressure: Handling Large Data](https://cnayanajith.com/blog/nodejs-streams-backpressure): Process files larger than memory with Node.js streams: readable and writable streams, pipeline, backpressure, async iterators, and the errors that leak memory. - [Validating API Input with Zod: Schemas, Types, and Errors](https://cnayanajith.com/blog/validating-api-input-zod): Validate untrusted API input with Zod 4: schemas and inferred types, safeParse vs parse, discriminated unions, middleware, and what changed from Zod 3. - [React Context API: Provider, useContext, and Its Limits](https://cnayanajith.com/blog/react-context-api-guide): How React Context actually works: create a provider, read it with useContext, avoid the re-render trap, and know when Context beats Redux and when it loses. - [Fetching Data in React: useEffect, SWR, and TanStack Query](https://cnayanajith.com/blog/fetching-data-in-react): Fetch data in React without the usual bugs: race conditions in useEffect, AbortController cleanup, and what SWR and TanStack Query actually cache for you. - [React TypeScript: Props, Hooks and Events in React 19](https://cnayanajith.com/blog/getting-started-react-typescript): Set up React with TypeScript in Vite, type props, state and events the React 19 way, and fix the compiler errors that code from older tutorials now triggers. - [Tailwind CSS Breakpoints: Responsive Design in v4](https://cnayanajith.com/blog/building-responsive-uis-tailwind): Tailwind CSS v4 breakpoints: the rem scale, the mobile-first cascade, max-* ranges, custom breakpoints with @theme, and when a container query fits better. - [React State Management: Zustand, Jotai, and Redux Compared](https://cnayanajith.com/blog/modern-state-management-react): Compare React state management libraries: Zustand, Jotai, Recoil, Valtio, and Redux Toolkit. When to use each, plus useReducer and Context API trade-offs. - [Polling in React with TanStack Query and refetchInterval](https://cnayanajith.com/blog/polling-react-tanstack-query): Poll APIs in React with TanStack Query: set up refetchInterval, add conditional polling and dynamic intervals, and avoid the common performance pitfalls. ## API Read-only, no authentication. Described in OpenAPI 3.1 at https://cnayanajith.com/openapi.json and listed in the RFC 9727 API catalog at https://cnayanajith.com/.well-known/api-catalog. - `GET /feed.xml`: RSS 2.0 feed of every blog post - `GET /llms.txt`: this document - `GET /sitemap.xml`: XML sitemap of all indexable URLs - `GET /robots.txt`: crawler rules and Content-Signal usage preferences - `GET /auth.md`: agent authentication and registration (none required) - `GET /api/health`: health check, returns `{"status":"ok"}` as JSON ## Optional - [RSS Feed](https://cnayanajith.com/feed.xml): Full blog feed in RSS 2.0 format - [Sitemap](https://cnayanajith.com/sitemap.xml): All indexable URLs