Git Product home page Git Product logo

vercel-commerce's Introduction

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
  • 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.

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

Getting started

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: http://localhost:9000).

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

2. From the nextjs-commerce subfolder, run:

yarn dev

Your app should now be running on localhost:3000.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.