Welcome to the first step of our journey to create a cutting-edge blog using the latest technologies: Next.js 15.1.7
and Tailwind CSS 4.0.7
(as of this writing). I’m excited to walk you through this process with the depth and clarity you’d expect from a technical deep dive. Our goal here is to establish a robust development environment, ensuring we have full control over our tech stack and laying a solid groundwork for a feature-rich blog.
Let’s dive into the nitty-gritty of initializing our project, step by step. Each step is thoroughly explained, highlighting the reasoning, actions, and verification processes to showcase the setup of a modern blog using Next.js 15.1.7
and Tailwind CSS 4.0.7
.
Step 1: Installing Node.js 20.x.x – The Engine of Our Project
Before we can wield the power of Next.js and Tailwind CSS, we need a reliable runtime environment. Node.js is our engine, and version 20.x.x is the latest Long-Term Support (LTS)
release as of early 2025, offering stability and modern JavaScript features. To get started, head over to the official Node.js website at nodejs.org. Once there, locate the LTS
section and download the installer tailored to your operating system—whether it’s Windows, macOS, or Linux.
Run the installer by double-clicking the downloaded file. For Windows users, a setup wizard greets you with a friendly "Welcome to Node.js" message. Click "Next", accept the license agreement (a quick skim confirms it’s standard fare), and choose the default installation path—typically C:\Program Files\nodejs\
. Here’s a pro tip: ensure the box labeled "Add to PATH"
is checked. This step makes Node.js and its package manager, npm
, globally accessible from your terminal, saving you headaches later. If prompted, opt to install additional tools like Chocolatey on Windows—it streamlines future updates.
Once the installation completes, it’s time to verify our work. Open your terminal (Command Prompt, PowerShell, or your preferred shell) and type node -v
. You should see something like v20.x.x
—the exact patch version might vary, but the "20" confirms we’re on the right track. Next, check npm
with npm -v
, expecting a version like 10.x.x
. If both commands return these results, congratulations! Node.js 20.x.x
is ready to power our blog.
Step 2: Scaffolding the Next.js Project – Crafting Our Blog’s Skeleton
With Node.js humming along, let’s scaffold our blog using Next.js, the React framework that’s revolutionizing web development. In your terminal, execute the following command:
npx create-next-app@latest blog --use-npm
This command leverages npx
(a tool bundled with Node.js) to fetch the latest version of create-next-app
, ensuring we snag Next.js 15.x.x
fresh from the oven. The blog argument names our project directory, and --use-npm
specifies npm
as our package manager (sorry, Yarn fans!).
As the command runs, you’ll be greeted with a series of prompts to customize your setup. Here’s how we’ll answer them, along with why:
- Would you like to use TypeScript? Choose
"Yes."
TypeScript’s static typing catches errors early, enhances IDE support, and aligns with modern development practices—perfect for a blog we want to scale. - Would you like to use ESLint? Select
"Yes."
ESLint keeps our code consistent and clean, enforcing rules like proper indentation and no unused variables—a must for maintainable documentation. - Would you like to use Tailwind CSS? Say
"No."
Here’s the twist: whilecreate-next-app
offers Tailwind integration, it installs an older version (likely 3.x.x). We’re after Tailwind CSS 4.x.x, so we’ll handle that manually later for the latest features. - Would you like to use
src/
directory? Opt for"Yes."
Thesrc/
directory organizes our source code neatly, separating it from configuration files likenext.config.mjs
—a tidy structure for a polished blog. - Would you like to use App Router? Answer
"Yes."
The App Router in Next.js 15.x.x unlocks React Server Components, streaming, and advanced routing—ideal for a performant, SEO-friendly blog. - Would you like to customize the default import alias? Choose
"Yes"
and set it to@/*
. This alias simplifies imports (e.g.,@/components/Header
instead of../../components/Header
), making our code more readable.
After answering these prompts, the scaffolding process whirs to life, creating a blog/
directory with a barebones Next.js app. You’ll see files like next.config.ts
, package.json
, package-lock.json
, next-env.d.ts
, tsconfig.json
, and an initial src/app/
structure. This skeleton is our canvas—ready for us to paint with features.
Step 3: Manually Installing Next.js 15.x.x – Ensuring the Latest Version
While create-next-app
typically grabs the latest Next.js, let’s double-check. In your terminal, run npm info next version
to peek at the current stable release—it should read 15.x.x.
If, for some reason, the scaffolded version lags (check package.json
’s "next"
field), update it with npm install next@latest
. This command ensures we’re riding the cutting edge of Next.js, with goodies like the React 19 compiler and enhanced Turbopack
support.
Step 4: Manually Installing Tailwind CSS 4.0.7 – Precision Styling Control
Since we skipped Tailwind’s default installation coming from the previous scaffolding process, let’s bring in version 4.0.8 manually for its modern CSS-first approach. Run this command:
npm install -D tailwindcss postcss autoprefixer
Here’s the breakdown:
-
tailwindcss
: The core Tailwind CSS library. -
postcss
: A tool for transforming CSS with JavaScript. -
autoprefixer
: A PostCSS plugin to add vendor prefixes to CSS.
This trio ensures we harness Tailwind 4.x.x’s full potential—think CSS variables for theming and lightning-fast builds. Post-installation, we’ll configure it through the config file (more on that later), but for now, we’ve got the raw materials all within our disposal.
Step 5: Installing Additional Dependencies – Powering Our Features
Our blog project isn’t just a pretty face—it’s packed with additional functionalities. Let’s install the libraries to make it up and running:
- MDX Parsing:
npm install @next/mdx gray-matter
- @next/mdx: Integrates
MDX
(Markdown + JSX) with Next.js 15, letting us write rich blog posts. - gray-matter: Parses
frontmatter
(e.g., title, tags) from MDX files, crucial for categorization.
- @next/mdx: Integrates
- Google Fonts:
npm install unplugin-fonts
- A dev dependency for fetching modern fonts like
Inter
andMerriweather
seamlessly.
- A dev dependency for fetching modern fonts like
- Typography:
npm install -D @tailwindcss/typography
- Enhances blog post readability with beautiful prose styling.
- Modern Icons:
npm i react-icons
- Adding more beauty to the user interface.
- Dark Mode:
npm install next-themes
- Enables effortless light/dark mode toggling.
- RSS:
npm install rss
- Generates an RSS feed for subscribers.
- Search:
npm install fuse.js
- Powers fuzzy search across posts—fast and flexible.
- SEO/Open Graph/JSON-LD:
npm install next-seo
- Boosts discoverability with structured data and social previews.
And don't worry if during the installation of the above dependencies and library, you may have encountered some warnings, just ignore them as for now. These tools later on, collectively transform our blog into a powerhouse of modern web development.
Step 6: Verifying the Installation – Double-Checking Our Work
Let us ensure everything’s in place. Open package.json
in your blog/
root directory and inspect the "dependencies"
and "devDependencies"
sections. You should see something like the following code.
{ "name": "blog", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev --turbopack", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "@next/mdx": "^15.1.7", "@tailwindcss/postcss": "^4.0.9", "fuse.js": "^7.1.0", "gray-matter": "^4.0.3", "next": "15.1.7", "next-seo": "^6.6.0", "next-themes": "^0.4.4", "react": "^19.0.0", "react-dom": "^19.0.0", "react-icons": "^5.5.0", "rss": "^1.2.2", "unplugin-fonts": "^1.3.1" }, "devDependencies": { "@eslint/eslintrc": "^3", "@tailwindcss/typography": "^0.5.16", "@types/node": "^20", "@types/react": "^19", "@types/react-dom": "^19", "autoprefixer": "^10.4.20", "eslint": "^9", "eslint-config-next": "15.1.7", "postcss": "^8.5.3", "prettier": "^3.5.2", "prettier-plugin-tailwindcss": "^0.6.11", "tailwindcss": "^4.0.9", "typescript": "^5" } }
Versions might have minor increments (e.g., 15.0.1), but the major versions confirm we are current. To test, run npm run dev
and visit http://localhost:3000 in your browser. A basic Next.js welcome page should greet you—proof our foundation is solid.
Step 7: Git/GitHub Integration – Version Control from the Start
Collaboration and version tracking are non-negotiable, so let’s integrate Git and GitHub. Navigate to your project with cd blog and initialize a Git repository: git init
. Next, create a .gitignore
file to exclude clutter:
node_modules/ .next/ dist/ *.log
Stage everything with git add .
and commit: git commit -m "Initial project setup"
. Now, head to GitHub, create a new repository named blog
, and link it locally: git remote add origin <repo-url>
(replace with your repo’s URL, like https://github.com/username/blog.git
). Push it up with git push -u origin main
. Your code is now safely versioned and shareable!
Wrapping Up Project Initialization
And there you have it! We’ve installed Node.js 20.x.x
, scaffolded a Next.js 15.x.x
project with deliberate options, manually added Tailwind CSS 4.x.x
, and loaded up essential libraries
—all while setting up Git
for collaboration. This setup isn’t just a starting point; it’s a launchpad for a blog packed with modern features like dark mode
, search
, and SEO optimization
. In the next section, we’ll configure Next.js and Tailwind CSS to bring our vision to life. I'll see you on the next page!
Top comments (0)