DEV Community

Cover image for I built an open-source Shopify alternative with Next.js 16 & PayloadCMS
Naji Amer
Naji Amer

Posted on

I built an open-source Shopify alternative with Next.js 16 & PayloadCMS

Amerta Dashboard

For the last decade, building an e-commerce site has felt like choosing between two evils:

The "SaaS Trap" (Shopify): You get a nice dashboard, but you pay a monthly sub + a "transaction fee" on every sale. Want to customize checkout? That’ll be $2,000/month for an Enterprise plan, please.

The "Plugin Hell" (WooCommerce/Magento): You own the code, but you spend 50% of your time fighting conflicting plugins, security patches, and slow PHP server response times.

I believed there had to be a third way. A way that combines the DX (Developer Experience) of Next.js with the content management power of a headless CMS—without the bloat.

So, I built Amerta.

It is an MIT Licensed, open-source e-commerce standard built on PayloadCMS 3.7 and Next.js 16.

Amerta Product Page

Here is why (and how) I built it.

🛠 The Stack

Framework: Next.js 16 (App Router, Server Components)
CMS: PayloadCMS 3.0 (Headless, TypeScript-first)
Database: MongoDB
Styling: TailwindCSS
Deployment: Self-host (Docker/VPS) or Cloud (Vercel/Neon)

The "Local API" Architecture (No Fetch Overhead)
The biggest bottleneck in headless e-commerce is usually the HTTP requests between your frontend and your CMS.

Because PayloadCMS 3.0 supports the Local API, Amerta doesn't need to send HTTP requests to fetch products. Since Payload runs alongside Next.js in the same server instance, we query the database directly.

Traditional Headless:
Next.js (Server) -> HTTP Request -> Headless CMS -> DB

Amerta (Local API):
Next.js (Server) -> Direct Function Call -> DB

This means zero network latency for data fetching.

  1. Global by Default (Not a Plugin)
    Most platforms treat Multi-Currency and Localization as expensive plugins. I treated them as requirements.

  2. RTL Support: Native. The layout flips automatically based on the locale (great for MENA regions).

  3. Multi-Currency: Support for dynamic pricing (AED, USD, EUR) without relying on third-party scripts that slow down the DOM.

  4. The "SaaS Tax" is Gone
    This is the main reason I open-sourced this.
    When you use SaaS platforms, you often pay a % fee on every transaction on top of Stripe/PayPal fees.

With Amerta:

Bring Your Own Keys: Plug in your Stripe/Mamo keys directly.
Self-Host: Put it on a $5 DigitalOcean droplet or deploy to Railway.
No Limits: 100 products or 100,000 products. You don't pay per SKU.

Built for the "Next" Era

Try it out

I built this because I wanted to give developers a way to build custom, high-performance stores without being locked into a vendor's ecosystem.

It’s open source. It’s free. It’s yours to break, fork, and monetize.

🌟 Star the Repo
🚀 View the Demo

Let me know what you think in the comments! I'm actively looking for contributors.

Top comments (1)

Collapse
 
apogeewatcher profile image
Apogee Watcher

Nice work! How are you handling cache invalidation for inventory/price changes (TTL, tags, webhook revalidation, etc.)?