Frontend
The part of the app people see: React, Vite, Tailwind and shadcn/ui, the browser errors that break it, and making it fast, installable and pleasant on a phone.
99 posts · page 4 of 4
How to Deploy a React App (Vite): Every Option Explained
A Vite React app builds into static files, so you can host it almost anywhere. How to build it, deploy to Cloudflare, Netlify, Vercel or GitHub Pages, serve it from your own server with Nginx or Caddy, fix 404s on refresh and blank pages, and handle environment variables and an API.
z-index Not Working? The Real Reasons (Stacking Contexts Explained)
Set z-index: 9999 and the element is still behind something? z-index only works on positioned elements and only within its stacking context. The four common causes, how to spot a stacking context, and the fixes — including portals for modals and dropdowns.
rem vs em vs px in CSS: Which Unit Should You Use?
px is fixed, rem is relative to the root font size, em is relative to the current element's font size. What each unit means, why rem is the safe default for font sizes and spacing, where em and px still make sense, and when to reach for %, vw, vh and dvh.
CSS Position Explained: static, relative, absolute, fixed and sticky
The five CSS position values and what each does: static (normal flow), relative (nudge and anchor), absolute (place inside the nearest positioned ancestor), fixed (stick to the screen) and sticky (stick while scrolling). With examples and the reasons sticky and absolute 'don't work'.
Flexbox vs Grid: Which CSS Layout Should You Use?
Flexbox lays things out in one direction — a row or a column. Grid lays things out in two — rows and columns at once. When to use each, the handful of properties that do most of the work, and the Tailwind classes you'll see in AI-generated code.
Canonical URLs Explained: Fixing Duplicate Content
A canonical URL tells search engines which version of a page is the main one when the same content is reachable at several addresses — www vs non-www, tracking parameters, sorting options, trailing slashes. How rel=canonical works, how to set it in Next.js, and common mistakes.
How to Build a Landing Page That Gets Sign-Ups
A landing page has one job: get the visitor to take one action. The sections that work, how to write a headline that says what the product does, where to put the sign-up form, what to measure, and the technical basics that stop it looking broken when shared.
Astro vs Next.js: Which Should You Use for Your Site?
Astro ships almost no JavaScript by default and shines for content sites. Next.js is a full React application framework. How they differ in philosophy, performance, data handling and hosting — and a simple rule for picking between them.
How to Add Google Analytics to Your Website (GA4, Next.js, React)
Step by step: create a GA4 property, get your measurement ID, add the tag to plain HTML, Next.js or a React SPA, verify it with Realtime, and handle cookie consent. Plus the common reasons GA shows no data, and privacy-friendly alternatives.
301 vs 302 Redirects (and 307, 308): Which Should You Use?
301 means moved permanently; 302 means temporarily somewhere else. How each affects browsers, caching and SEO, what 307 and 308 add, setting redirects in Nginx, Caddy, Next.js, Express and Cloudflare, and the mistakes that cause redirect loops and lost rankings.
What Is Vite? The Build Tool Behind Lovable and Bolt Apps, Explained
Vite is the tool that runs your React app during development and bundles it for production. What Vite does, what npm run dev and npm run build actually produce, why VITE_ environment variables are public, and how to deploy the dist folder.
What Is Tailwind CSS? Why Every AI-Built App Seems to Use It
Tailwind CSS styles your app with small utility classes written straight in the HTML. What Tailwind is, how it differs from normal CSS and Bootstrap, why AI tools love it, what changed in Tailwind v4, and how to read those long class lists.
What Is shadcn/ui? The Component Collection Behind Lovable and v0 Apps
shadcn/ui isn't a normal component library — it copies component code into your project so you own it. What shadcn/ui is, how the CLI works, what's in a components/ui folder, why AI builders use it, and how to customise and update it.
What Is a PWA? Progressive Web Apps Explained for Beginners
A progressive web app is a website that can be installed like an app, work offline and send notifications. What a PWA needs (manifest, service worker, HTTPS), what it can and can't do on iPhone and Android, and when it's a better first step than an app-store app.
How to Turn Your Web App Into a Mobile App (Without Rebuilding It)
Three realistic paths from a web app to a phone app: make it a PWA, wrap it with Capacitor for the App Store and Google Play, or rebuild with React Native. Costs, what Apple rejects, what you need (yes, a Mac), and how to choose.
robots.txt and sitemap.xml Explained: A Beginner's Guide
Two small files that tell search engines (and AI crawlers) what to crawl and what exists on your site. How robots.txt and sitemap.xml work, examples, the robots.txt mistake that hides your whole site, why Disallow doesn't remove pages from Google, and how to generate both in Next.js.
React App Shows a Blank Page After Deploying? Here's How to Fix It
Works locally, white screen in production. The usual causes of a blank page after deploying a React or Vite app — wrong base path, missing environment variables, a JavaScript crash, routing, caching — and how to diagnose each in two minutes with DevTools.
How to Optimize Images for the Web: Formats, Sizes, and Lazy Loading
Images are usually the heaviest part of a page. Which format to use (WebP vs AVIF vs JPEG vs PNG vs SVG), how big to make them, responsive images with srcset, lazy loading done right, and the one image you should never lazy-load.
Next.js Hydration Errors: What They Mean and How to Fix Them
"Hydration failed because the server rendered HTML didn't match the client" — what hydration is, the usual culprits (dates, random values, window, browser extensions, invalid HTML, theme switchers), and the correct fix for each.
How to Add Dark Mode to Your Website (CSS, Tailwind, and a Toggle)
Add dark mode the right way: follow the system setting with prefers-color-scheme, organise colours with CSS variables, use Tailwind's dark: variant, add a toggle that remembers the choice, and avoid the white flash on page load.
Core Web Vitals Explained: LCP, INP, and CLS for Beginners
Google's Core Web Vitals measure how fast, responsive and stable your pages feel. What LCP, INP and CLS mean, the thresholds for "good", how to check your scores, the difference between lab and field data, and the usual fixes.
How to Add a Contact Form to Your Website (With or Without a Backend)
Four ways to make a contact form actually deliver messages — form services, your host's built-in forms, Google Forms, and your own backend route — plus how to stop spam and why you should never put an email API key in frontend code.
"Cannot Read Properties of Undefined": What It Means and How to Fix It
The most common JavaScript error, explained for beginners: what "TypeError: Cannot read properties of undefined (reading 'map')" means, the five usual causes, how to find the exact line, and the right fixes — not just sprinkling ?. everywhere.
Async/Await in JavaScript, Explained Simply (With the Mistakes AI Code Makes)
Why some JavaScript code has to wait, what a Promise is, how async and await work, how to handle errors, how to run things in parallel, and the common async bugs — like the missing await — that show up in AI-generated code.
How to Add a Favicon to Your Website (HTML, Next.js, and Vite)
The small set of favicon files a modern site actually needs, the HTML tags to add, the Next.js and Vite shortcuts, the sizes Google and iPhones use, and why your new favicon still isn't showing.
How to Add a CAPTCHA to Your Forms (Cloudflare Turnstile, reCAPTCHA, hCaptcha)
Stop bots spamming your signup, login and contact forms. How modern CAPTCHAs work, Turnstile vs reCAPTCHA vs hCaptcha, a working Cloudflare Turnstile example with the server-side check most tutorials forget, and when a CAPTCHA isn't the right tool.
Why Refreshing Your React Page Gives a 404 (and How to Fix It on Any Host)
Your single-page app works when you click around but shows 404 Not Found when you refresh or share a link. Why client-side routing causes it, and the exact fix for Nginx, Caddy, Netlify, Vercel, GitHub Pages and Express.