You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Server Actions 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.
Please refer to the documentation to learn about required tools for the Medusa Backend.
1. Run create-medusa-app with the nextjs-commerce starter:
npx create-medusa-app@nextjs-commerce
This will create a new main folder with two subfolders for Medusa and Next.js Commerce respectively.
2. Create a Postgres database named vercel-commerce and make sure the Postgres server is running locally.
3. Inside your newly created nextjs-commerce project, change to the medusa folder and seed the database:
cd nextjs-commerce/medusa
yarn seed
This will provide you with some demo products and the necessary product categories to fill out the homepage.
Running Medusa
From the medusa subfolder, run:
yarn start
Your Medusa server should now be running on localhost:9000.
Running Next.js Commerce
1. You will need to use the environment variables defined in .env.example to run Next.js Commerce. Copy the contents of .env.example to a .env file in the root of your Next.js Commerce project, and make sure the NEXT_PUBLIC_MEDUSA_BACKEND_API environment variable points to your Medusa backend domain (default: https://localhost:9000).
Note: You should not commit your .env file or it will expose secrets.