commerce/README.md
2023-05-12 14:32:31 +03:00

3.1 KiB
Raw Blame History

Deploy with Vercel

Next.js Commerce x Medusa

Note: Looking for Next.js Commerce v1? View the code, demo, and release notes

A Next.js 13 and App Router-ready ecommerce template, built with Medusa, featuring:

  • Next.js App Router
  • Optimized for SEO using Next.js's Metadata
  • React Server Components (RSCs) and Suspense
  • Route Handlers for mutations
  • Edge runtime
  • New fetching and caching paradigms
  • Dynamic OG images
  • Styling with Tailwind CSS
  • Automatic light/dark mode based on system settings

What is Medusa?

Medusa is a set of commerce modules and tools that allow you to build rich, reliable, and performant commerce applications without reinventing core commerce logic. The modules can be customized and used to build advanced ecommerce stores, marketplaces, or any system that needs foundational commerce primitives. All modules are open-source and freely available on NPM.

Learn more about Medusas architecture and commerce modules in Medusa's documentation.

Running locally

You will need to use the environment variables defined in .env.example to run Next.js Commerce. It's recommended to use Vercel Environment Variables for this, but a .env file is all that is necessary.

Note: You should not commit your .env file or it will expose secrets.

1. Install Vercel CLI:

npm i -g vercel

2. Link local instance with Vercel and GitHub accounts (which creates a .vercel directory):

vercel link

3. Download your environment variables:

vercel env pull

4. Install dependencies and run your app:

npm install
npm run dev

Your app should now be running on localhost:3000.

How to configure your Medusa backend for Next.js Commerce

Next.js Commerce x Medusa requires a running Medusa backend.

Please refer to this guide in the Medusa documentation to learn how to create a Medusa backend.