Next.js 15 in eCommerce: A New Standard for Modern Online Stores
By Paweł Fulara
By Paweł Fulara
Fast load times, efficient rendering, and flexible architecture are essential for building modern eCommerce websites that support online purchases, and mobile commerce. Technical decisions such as choosing the right front-end framework directly affect performance, security, and developer productivity.
Next.js 15, the latest version of the popular framework by Vercel, is a true game-changer for eCommerce application developers. With new features such as Server Actions, the App Router, streaming, and optimized rendering and data fetching, we can now build faster, lighter, and more responsive stores.
In this article, I’ll show you how the latest features of Next.js 15 can significantly improve the development and user experience of online retail sales.
The new App Router, introduced in Next.js 13 and expanded in versions 14 and 15, replaces the old pages/ routing system. It’s based on the app/ folder, giving you greater control over application structure.
Modular store structure - e.g. separate layouts for checkout, user panel, and homepage
Isolated logic and data - easier management of cart state, promotions, and user sessions
Automatic loading and fallback management via loading.tsx, error.tsx, and not-found.tsx
The biggest addition in Next.js 15 is the stable version of Server Actions - a feature that allows server-side logic execution without creating separate API routes.
You define a function marked with use server:
'use server'
export async function addToCart(productId: string) {
await db.cart.add(productId)
return {
message: "Product added to cart",
}
}
And then call it directly from your component.
<form action={addToCart}>
<button type="submit">Add to cart</button>
</form>
Adding a product to the cart
Handling login/registration
Submitting forms (e.g. newsletter, contact)
Updating user account data
This eliminates complex fetch calls, error handling, and spinners - everything works natively within React.
Next.js 15 fully supports React Server Components, which are rendered on the server without sending their code to the client.
Smaller bundle = faster page loads
Less JavaScript on the client
Better FCP and SEO - crucial in eCommerce
Product lists, user data, and recommended items - all rendered server-side without burdening the browser.
Next.js now supports content streaming – loading parts of the UI as soon as they’re generated, instead of waiting for all data at once.
The layout appears instantly, while product listings stream in seconds later
In checkout, user data and cart items load separately without blocking the interface
Result? Perceived faster loading and a smoother user experience.
The new layout.tsx and template.tsx system enables differentiated layouts for various parts of the store:
Checkout with simplified navigation
Customer panel with a side menu
Campaign landing pages with unique layouts
This not only improves UX but also simplifies code maintenance and testing.
These hooks allow for dynamic form handling without managing local state. Users get immediate interface feedback - spinners, "sending..." messages, and success or error indicators.
Order forms
Login/registration
Reviews and comments
Contact forms
Next.js 15 further enhances its media optimization tools:
next/image with lazy loading and WebP support
next/font loads fonts without flash of invisible text (FOIT)
Better CLS, LCP, and Web Vitals - which translate to SEO and conversion improvements.
Middleware in Next.js lets you dynamically react to requests - e.g., redirecting users to a localized store version or blocking access to the account panel if they're not logged in.
You can still create API routes to handle data access, payments, or ERP integrations.
Absolutely. Here’s a quick overview of key features and their value:
Feature | eCommerce Benefits |
---|---|
App Router | Modular architecture and better layout management |
Server Actions | Less boilerplate, simpler code, improved security |
Server Components | Better SEO and performance |
Streaming | Faster load times and enhanced UX |
Layouts & Templates | Simple code maintenance and testing |
useFormState | Smooth, reactive form handling |
Media Optimization | Improved Web Vitals and conversion rates |
Middleware/API | Advanced logic without backend infrastructure |
Next.js 15 is the ultimate tool for building an online store that looks great, loads instantly, converts users efficiently, and scales with your business.
If you're planning to build a new online store, improve an existing eCommerce business, or migrate it, our team will help to change your platform with modern tools like Next.js.