Deployment

Backend — Railway

The Medusa backend (packages/api) is deployed to Railway as a Node.js service.

  1. Create a Railway project and point it at the repo.
  2. Set Root Directory to the repo root.
  3. Set the required env vars (database URL, JWT secret, cookie secret, Redis URL).
  4. Railway builds and starts the service automatically on push.

Storefront — Railway

The Next.js storefront (apps/storefront) is deployed to Railway.

Required env vars:

VarPurpose
MEDUSA_BACKEND_URLMedusa backend URL
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEYPublishable key from the Medusa admin
NEXT_PUBLIC_BASE_URLPublic storefront URL
NEXT_PUBLIC_DEFAULT_REGIONDefault region (e.g. us)
NEXT_PUBLIC_SANITY_PROJECT_IDSanity project id
NEXT_PUBLIC_SANITY_DATASETproduction
NEXT_PUBLIC_SANITY_API_VERSIONPinned API version
SANITY_API_READ_TOKENServer-only read token
SANITY_REVALIDATE_SECRETWebhook signature secret

Admin + Vendor — Railway

Deploy apps/admin and apps/vendor as separate Railway services. Both are static React + Vite builds; configure the build command to bun run build and the publish directory to dist/.

Sanity Studio

Studio is hosted on Sanity's managed infrastructure. Deploy schema changes with:

cd apps/storefront
bun run studio:deploy