Prebaked medusajs 2.0 monorepo (backend + postgres + redis + storefront)
one-click deploy on railway!
Combine Medusa's modules for your commerce backend with the newest Next.js 14 features for a performant storefront.
This boilerplate is a monorepo consisting of the officially released MedusaJS 2.0 backend and storefront application. It is a pre-configured, ready-to-deploy solution, modified for seamless deployment on railway.app.
Updated: to version 2.0.4
🥳
- MinIO file storage: Replaces local file storage with MinIO cloud storage, automatically creating a 'medusa-media' bucket for your media files. README
- Resend email integration setup video - special thanks to aleciavogel for Resend notification service, and react-email implementation! README
- Stripe payment service: setup video
- Meilisearch integration: Adds powerful product search capabilities to your store. When deployed on Railway using the template, MeiliSearch is automatically configured and products are automatically indexed through subscribers (backend/src/subscribers/product-upsert.ts and product-delete.ts).
Video instructions: https://youtu.be/PPxenu7IjGM
cd /backend
pnpm install
ornpm i
- Rename
.env.template
->.env
- To connect to your online database from your local machine, copy the
DATABASE_URL
value auto-generated on Railway and add it to your.env
file.- If connecting to a new database, for example a local one, run
pnpm ib
ornpm run ib
to seed the database.
- If connecting to a new database, for example a local one, run
pnpm dev
ornpm run dev
- postgres database (Automatic setup when using the Railway template)
- redis (Automatic setup when using the Railway template) - fallback to simulated redis.
- MinIO storage (Automatic setup when using the Railway template) - fallback to local storage.
- Meilisearch (Optional) - provides advanced search capabilities.
cd backend/
npm run ib
or pnpm ib
will initialize the backend by running migrations and seed the database with required system data.
npm run dev
or pnpm dev
will start the backend (and admin dashboard frontend on localhost:9000/app
) in development mode.
pnpm build && pnpm start
will compile the project and run from compiled source. This can be useful for reproducing issues on your cloud instance.
Video instructions: https://youtu.be/PPxenu7IjGM
Install dependencies npm i
Rename .env.local.template
-> .env.local
- A running backend on port 9000 is required to fetch product data and other information needed to build Next.js pages.
cd storefront/
npm run dev
will run the storefront on uncompiled code, with hot-reloading as files are saved with changes.
- How to setup credit card payment with Stripe payment module: https://youtu.be/dcSOpIzc1Og
- https://funkyton.com/medusajs-2-0-is-finally-here/#succuessfully-deployed-whats-next