GlemorDocs
Engineering

Local development

Three apps, three ports, and how far each one gets with nothing configured.

git clone <repo> && cd glemour
npm install          # root only — installs the storefront and the docs site

Node 20 or newer. Medusa itself wants ^20.19.0 || >=22.12.0.

The storefront — port 3000

npm run dev

Runs with no environment at all. With NEXT_PUBLIC_MEDUSA_BACKEND_URL or NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY unset, getCatalog() serves the static catalogue in src/lib/products.ts and logs that it did. So the shop works offline, on a plane, with no backend running.

To point it at a backend, copy .env.example to apps/storefront/.env.local and fill in:

NEXT_PUBLIC_MEDUSA_BACKEND_URL=https://glemor-admin.cenvora.dev
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=pk_...      # printed by the seed script
STRIPE_SECRET_KEY=sk_test_...                  # optional; without it checkout 503s to WhatsApp
STRIPE_WEBHOOK_SECRET=whsec_...                # printed by `stripe listen`

The publishable key is safe in the browser — it scopes reads to a sales channel. The admin API key is a different thing and must never appear in the storefront.

The docs site — port 3001

npm run docs:dev

Deliberately on 3001 so it can run beside the storefront. Content is MDX under apps/docs/content/; fumadocs-mdx regenerates .source/ on the fly.

Medusa — port 9000

Medusa needs Postgres. Redis is optional locally — without REDIS_URL it falls back to an in-memory event bus and lock, which is fine on a laptop and wrong in production, which is why medusa-config.ts gates the Redis modules on the variable rather than degrading silently.

cd apps/medusa && npm install     # its own node_modules, see The monorepo
cd ../..
npm run medusa:migrate
npm run medusa:dev

The admin is then at http://localhost:9000/app. Seed the catalogue with the seed script — it prints the publishable key the storefront needs.

Before you commit

Three separate gates. See The three gates; running the build alone is not enough.

On this page