Skip to content

Get Started

PreviousNext

Run Space locally on port 3000 with a Postgres database.

Install dependencies

postinstall also runs prisma generate and fumadocs-mdx, so the Prisma client and the docs index are ready after install.

pnpm install

Configure .env

Space reads one central .env file — never create .env.local or other variants.

VariablePurpose
DATABASE_URLPostgres connection. Without it the public site renders empty states.
NEXT_PUBLIC_SITE_URLCanonical origin for metadata, sitemap and JSON-LD.
AUTH_SECRET32+ random characters; signs the admin session cookie.
ADMIN_PASSWORDShared staff password for /ar/dashboard.
SPACE_WHATSAPPWhatsApp number in international format, e.g. 249912345678.
SPACE_IMAGE_HOSTSComma-separated hosts whose images may go through the Next image optimizer.

Migrate and seed

pnpm db:migrate
SEED_ALLOW=samples pnpm db:seed

Run the dev server

pnpm dev

Open http://localhost:3000 — it redirects to /ar.

Scripts

CommandWhat it does
pnpm devDev server on port 3000
pnpm buildprisma generate + production build
pnpm typecheckRoute type generation + tsc --noEmit
pnpm lintESLint
pnpm db:studioPrisma Studio