/medusa-2.0

Monorepo including medusajs 2.0 backend and storefront

Primary LanguageTypeScript

Medusa logo Railway logo

Medusajs open source ecommerce platform
one-click deploy on railway!

Combine Medusa's modules for your commerce backend with the newest Next.js 14 features for a performant storefront.

PRs welcome! Discord Chat Follow @medusajs

About this boilerplate

This boilerplate is a monorepo consisting of snapshot of newly released medusajs 2.0 (preview) backend and storefront app created with npx create-medusa-app@preview July 2024. Modified to be plug n' play deployable on railway.app!

medusajs-backend

railway setup

Please change the value of environtment variables: COOCKIE_SECRET and JWT_SECRET.

local setup

  • Install dependencies yarn
  • Rename .env.template -> .env
  • To connect to your online database, from local; copy the DATABASE_URL value that have been auto generated on railway, and add to your .env

requirements

  • postgres database (will be automatically generated if using railway template)
  • redis (will be automatically generated if using railway template)

commands

cd medusajs-backend/ yarn build will compile app. yarn dev will start local admin dashboard app to manage products and orders etc. yarn start will start the backend server, needed for the storefront

medusa-storefront

local setup

intall dependencies yarn Rename .env.local.template -> .env.local

requirements

  • running backend npm run start - needed to fetch products data and more, to build nextjs pages.

commands

cd medusajs-storefront/ yarn wait will keep calling backend endpoint until a backend responds. yarn build will build the nextjs app - remember to start backend app prior to running this command. yarn start will serve the frontend web shop.