Buildathons.ai

Next.js: The React framework for the web

Next.js supercharges React with built-in routing, server-side rendering, and performance optimizations — everything you need to build production-grade web…

Overview

Next.js is built on top of React and adds everything React doesn't include out of the box: a file-based router, server components, API routes, image optimization, and more. It's trusted by companies like Netflix, Twitch, and GitHub for production web apps. The App Router (Next.js 13+) uses React Server Components, letting you fetch data directly in components without extra state management.

Core concepts

File-based routing: Create a file at app/contact/page.tsx and /contact is your new route. No router configuration required. Server vs. Client components: Components render on the server by default (faster, SEO-friendly). Add 'use client' to enable browser-side interactivity. App Router: The modern routing system based on nested layouts, loading states, and error boundaries. API Routes: Create backend endpoints at app/api/*/route.ts — your frontend and backend live in one project.

When to use Next.js

SEO matters (blog, marketing site, e-commerce) You need server-side logic alongside your React UI Building a full-stack app in one codebase

Quick-start tip

Every file in the `app/` folder becomes a route automatically. Create `app/about/page.tsx` and your site instantly has an `/about` page — no router config needed.