Project Setup and Configuration
Set up a new Next.js 15 project using the latest tools and configure basic settings for optimal development.
Project Setup and Configuration is a free Next.js 15 Fullstack Web Apps lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Next.js 15 Fullstack Web Apps learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Kickstarting Your Next.js Project
Time to spin up your first Next.js 15 app — prerequisites, the scaffolding tool, the file layout, and the dev server. This foundation matters.
Essential Tools: Node.js & npm
You need Node.js (the JS runtime for builds and the server) and npm, which ships with it. Check both: node -v and npm -v.
Creating Your First Next.js App
Scaffold a project with create-next-app. It asks about TypeScript, ESLint, Tailwind, and the App Router — which we will definitely use.
npx create-next-app@latest my-next-app --typescript --eslint --app --no-tailwind --import-alias "@/*"Understanding Project Structure
Key files after scaffolding: app/ holds your routes and layouts, public/ serves static assets, and next.config.js configures the app.
Running the Development Server
Start the dev server with npm run dev from your project folder. You get hot reloading, so code changes show up in the browser instantly.
cd my-next-app
npm run devYour First Page: Hello, CoddyKit!
Visit http://localhost:3000 to see the welcome page, rendered from app/page.js — the React component for your app's root route.
// app/page.js
export default function Home() {
return (
<main>
<h1>Hello, CoddyKit!</h1>
<p>Your Next.js app is running.</p>
</main>
);
}package.json: Project's Heartbeat
package.json is the project's heartbeat: name and version, the dev/build/start scripts, and your dependency list.
{
"name": "my-next-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "^15.0.0",
"react": "^18",
"react-dom": "^18"
}
}next.config.js: Customizing Next.js
next.config.js customizes your app — image domains, redirects, custom headers, webpack tweaks — by exporting a config object.
/** @type {import('next').NextConfig} */
const nextConfig = {
// For example, enable React Strict Mode
reactStrictMode: true,
// Or configure image domains for `next/image`
images: {
domains: ['example.com', 'another-domain.com'],
},
};
module.exports = nextConfig;Environment Variables with .env
Use .env.local for environment variables like API keys. Anything prefixed NEXT_PUBLIC_ reaches the client; everything else stays server-only.
# .env.local
NEXT_PUBLIC_ANALYTICS_ID=UA-123456789-1
DATABASE_URL="postgresql://user:password@host:port/database"Quick Check: Project Setup
Let's test your understanding of setting up a Next.js project.
Recap: Your Next.js Journey Begins!
You set up a Next.js 15 project: Node and npm, create-next-app, the app/ structure, the dev server, and the key config files. Routing next!
Frequently asked questions
Is the “Project Setup and Configuration” lesson free?
Yes — the full text of “Project Setup and Configuration” is free to read here on the web, and the Next.js 15 Fullstack Web Apps course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Next.js 15 Fullstack Web Apps course, upgrade to CoddyKit PRO.
What will I learn in “Project Setup and Configuration”?
Set up a new Next.js 15 project using the latest tools and configure basic settings for optimal development. You practise Next.js 15 Fullstack Web Apps with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Next.js 15 Fullstack Web Apps?
No prior experience is required. Next.js 15 Fullstack Web Apps on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Project Setup and Configuration” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Next.js 15 Fullstack Web Apps lesson?
Yes. Every Next.js 15 Fullstack Web Apps lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Introduction to Next.js 15
- Project Setup and Configuration
- Pages, Layouts & Routing Basics
- Metadata, SEO, and the Document Head