# Run it locally (https://prood.com/docs/run-locally)

This section is for people working on Prood's source. It walks you through installing the monorepo, configuring environment variables, seeding the database, and running every application in development. Opening a store on Prood needs none of this: start with [Get started](/docs/getting-started).

## Prerequisites [#prerequisites]

| Tool | Version |
| --- | --- |
| **Node.js** | 24 or later |
| **pnpm** | 10 |
| **Neon Postgres** | A database URL (local Docker or Neon cloud) |

Optional for full checkout flows:

- **Upstash Redis** — checkout session storage
- **Stripe** (or Easypay / Ifthenpay) — a test account. Keys are entered per store in the dashboard, under Integrations

## Quick install [#quick-install]

```bash
git clone <your-repo-url>
cd prood-commerce-platform
pnpm install
cp .env.example .env.local
pnpm env:link
pnpm db:migrate
pnpm db:seed
pnpm dev
```

After `pnpm dev`, Turbo starts all apps. Open the **gateway** at [http://localhost:3001](http://localhost:3001): it stands in for prood.com and sends each path to the app behind it, so the dashboard, admin console, checkout, docs and API share one origin, as they do in production.

| Open | App |
| --- | --- |
| [http://localhost:3000](http://localhost:3000) | Storefront (a store is `{slug}.localhost:3000`) |
| [http://localhost:3001](http://localhost:3001) | Marketing |
| [http://localhost:3001/dashboard](http://localhost:3001/dashboard) | Dashboard |
| [http://localhost:3001/admin](http://localhost:3001/admin) | Admin |
| [http://localhost:3001/docs](http://localhost:3001/docs) | Docs |
| [http://localhost:3001/pay](http://localhost:3001/pay) | Checkout |
| [http://localhost:3001/v1/health](http://localhost:3001/v1/health) | API |

Each app also listens on its own port (3002 dashboard, 3003 docs, 3004 checkout, 3005 api, 3006 admin), which the gateway rewrites to. Sign in through the gateway: the session cookie belongs to the origin you signed in on, and passkeys are set up for `localhost:3001`.

## Monorepo applications [#monorepo-applications]

| App | Port | Purpose |
| --- | --- | --- |
| `storefront` | 3000 | Customer-facing store: catalog, cart, checkout redirect, account |
| `web` | 3001 | Marketing site and the gateway (prood.com) |
| `dashboard` | 3002 | Merchant admin: products, orders, integrations, domains, team |
| `docs` | 3003 | This documentation site (Fumadocs + OpenAPI) |
| `checkout` | 3004 | Hosted payment app: Stripe, Easypay, Ifthenpay |
| `api` | 3005 | Commerce REST API (`/v1/*`), MCP server, Agent Auth |
| `admin` | 3006 | Platform admin console (`/admin`) |

## Database scripts [#database-scripts]

1. **`pnpm db:migrate`** — Applies the versioned migrations in `packages/platform/drizzle` with `drizzle-kit migrate`: the commerce tables, the Better Auth tables (user, session, account, organization, agent auth, `tenant_domain`, `integration_config`), the `prood_app` role and the row-level-security policies. Already-applied migrations are skipped, so re-running it is a no-op.
2. **`pnpm db:seed`** — Seeds the demo store: the `org_demo` organization (slug `prood-demo`), European countries, the demo catalog in EUR, and an admin user from `ADMIN_EMAIL` / `ADMIN_PASSWORD` when those env vars are set. Idempotent.

The storefront resolves the demo store from its host: open [http://prood-demo.localhost:3000](http://prood-demo.localhost:3000).

## Shared environment [#shared-environment]

All apps read from a **single root** `.env.local`. Run `pnpm env:link` to generate `apps/*/.env.local` from it. The script copies the root file and writes the local one-domain URLs into each app (`NEXT_PUBLIC_DASHBOARD_URL=http://localhost:3001/dashboard`, `CHECKOUT_URL=http://localhost:3001/pay`, the passkey settings for `localhost`, and so on), so it overrides any URL variable in the root file. Run it again after you change the root file.

## Documentation map [#documentation-map]

<Cards>
  <Card title="Installation" href="/docs/run-locally/installation" description="Detailed install steps, monorepo layout, and build commands." />
  <Card title="Walkthrough" href="/docs/run-locally/walkthrough" description="End-to-end flow: browse → cart → checkout → payment." />
  <Card title="Environment variables" href="/docs/run-locally/environment" description="Complete reference for every env var in `.env.example`." />
</Cards>

## Default demo credentials [#default-demo-credentials]

After seeding, the platform creates an admin user if `ADMIN_EMAIL` and `ADMIN_PASSWORD` are set in `.env.local`. Use these to sign in to the dashboard at `http://localhost:3001/dashboard`.

The seeded catalog belongs to the `org_demo` organization. The storefront serves it at `prood-demo.localhost:3000` (the `{slug}.{NEXT_PUBLIC_PLATFORM_DOMAIN}` host).
