January 15, 20251 min read
Getting Started with Next.js 15
Learn how to build modern web applications with Next.js 15, the React framework for production.
Learn how to build modern web applications with Next.js 15, the React framework for production.
Next.js 15 brings exciting new features that make building web applications easier than ever. In this guide, we'll explore the key concepts you need to know.
Next.js provides a great developer experience with features like:
First, create a new Next.js project:
npx create-next-app@latest my-app
cd my-app
npm run dev
In Next.js 15, pages are created in the app directory:
// app/page.tsx
export default function HomePage() {
return (
<main>
<h1>Welcome to my app!</h1>
</main>
);
}
By default, all components in the app directory are Server Components. To use client-side features, add the "use client" directive:
"use client";
import { useState } from "react";
export function Counter() {
const [count, setCount] = useState(0);
return <button onClick={() => setCount(count + 1)}>Count: {count}</button>;
}
Now that you understand the basics, explore more advanced topics like data fetching, authentication, and deployment.