Why Next.js?
Let me be real with you. When I started web development, I was using plain React with Create React App. It worked fine for small projects. But the moment I tried to build something serious, I hit walls everywhere:
• How do I handle routing? Install react-router, configure it manually.
• How do I do SEO? React renders on the client, so Google can't crawl it properly.
• How do I fetch data on the server? You need a separate Express/Node backend.
• How do I optimize images? Figure it out yourself.
• How do I deploy? Eject CRA, configure webpack, pray.
I was spending more time configuring tools than actually building features. That's when I found Next.js.
The Problem Next.js Solves
React is a UI library. It's incredible at rendering components. But it's JUST a library. It doesn't have opinions on routing, data fetching, server rendering, or deployment.
Next.js is a framework built on top of React. It makes all those decisions for you, with smart defaults that work for 95% of use cases. Think of it this way:
• React = engine
• Next.js = the full car (engine + steering + fuel system + dashboard)
You don't need to assemble the car yourself anymore.
My honest take
Next.js vs Plain React (Real Talk)
Who Uses Next.js?
This isn't some niche framework. Next.js is used by:
• Vercel (they made it)
• Netflix (their jobs portal)
• TikTok (web app)
• Notion (marketing site)
• Hulu, Nike, Twitch, Washington Post
• Thousands of startups and indie devs
It's the most popular React framework, period. Over 120k stars on GitHub. If you learn it, you're learning something companies actually hire for.
When NOT to Use Next.js
I'll be honest, Next.js isn't always the right choice:
• Tiny single-page apps (a calculator, a todo list) - overkill, just use Vite + React.
• Mobile apps - use React Native instead.
• Non-React projects - if you prefer Vue, use Nuxt. If you prefer Svelte, use SvelteKit.
• Static sites with no dynamic content - Astro might be lighter.
But for anything that involves multiple pages, needs SEO, has a backend, or will grow over time? Next.js is the move.
Bottom line
What Next.js Gives You (For Free)
Here's the full list of what you get out of the box when you choose Next.js:
• File-based routing - create a file, get a URL. No react-router config needed.
• Server-side rendering (SSR) - pages render on the server for fast load times and SEO.
• Static generation (SSG) - pre-build pages at compile time for blazing speed.
• API routes - full backend API without a separate server.
• Image optimization - automatic WebP, lazy loading, responsive sizes.
• Zero-config TypeScript - just rename .js to .tsx and go.
• Built-in CSS/Tailwind support - no webpack config nightmares.
• Middleware - run code before requests hit your pages (auth, redirects).
• Server Actions - mutate data from forms without writing API endpoints.
• Streaming & Suspense - show parts of the page as they load.
• Edge Runtime - run code at the CDN edge for ultra-low latency.
Setting Up Your First Project
Let's create a new Next.js project. Open your terminal and run:
1npx create-next-app@latest my-app --yes2cd my-app3npm run dev45# The --yes flag uses recommended defaults:6# ✔ TypeScript7# ✔ ESLint8# ✔ Tailwind CSS9# ✔ App Router10# ✔ Turbopack (default bundler now!)11# ✔ Import alias @/*Or if you want to customize, skip the --yes flag:
1npx create-next-app@latest2# Prompts:3# What is your project named? → my-app4# Would you like to use the recommended defaults?5# > Yes, use recommended defaults6# > No, customize settings7#8# If you customize:9# TypeScript? → Yes10# Linter? → ESLint (or Biome)11# React Compiler? → No (experimental, skip for now)12# Tailwind CSS? → Yes13# src/ directory? → Yes14# App Router? → Yes (ALWAYS yes)Always choose App Router
Turbopack is now the default
System Requirements
Before you start, make sure you have:
• Node.js 20.9+ (check with 'node -v')
• macOS, Windows, or Linux
• Any modern browser (Chrome 111+, Firefox 111+, Safari 16.4+)
Project Structure
After creation, here's what your project looks like:
1my-app/2├── src/3│ └── app/4│ ├── layout.tsx ← Root layout (wraps everything)5│ ├── page.tsx ← Homepage (renders at /)6│ ├── globals.css ← Global styles7│ └── favicon.ico8├── public/ ← Static files (images, fonts)9├── next.config.ts ← Next.js configuration10├── tsconfig.json ← TypeScript configuration11├── postcss.config.mjs ← PostCSS (for Tailwind)12├── eslint.config.mjs ← ESLint configuration13└── package.json1415# No tailwind.config needed! Tailwind v4 uses16# @import "tailwindcss" in globals.css directly.Key insight
Running Your App
1cd my-app2npm run dev34# Your app is now running at http://localhost:3000That's it. You've got a full-stack React framework running with TypeScript, Tailwind, and hot reload. In the next chapter, we'll dive into how file routing actually works.