> ## Documentation Index
> Fetch the complete documentation index at: https://docs.theroyalglow.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started

> Local development setup for the Royal Glow monorepo — running in minutes.

# Getting Started

This guide takes you from a fresh clone to all three apps running locally. Every
external integration is a **guarded extension point** — with a key absent it
no-ops and logs, so the project builds and runs with **zero secrets**.

<Info>
  **Prefer the big picture first?** Skim [Architecture](/docs/architecture) and
  the [Tech Stack](/docs/tech-stack), then come back here to run it.
</Info>

## Prerequisites

| Name         | Type       | Required | Description                                                   |
| ------------ | ---------- | -------- | ------------------------------------------------------------- |
| `Bun`        | `1.3+`     | Yes      | Primary runtime and package manager for the whole monorepo.   |
| `Node.js`    | `20.9+`    | Yes      | Needed by Payload CMS / the Render origin.                    |
| `PostgreSQL` | `Neon URL` | No       | A Neon connection string (or any Postgres URL for local dev). |

## Setup

<Steps>
  <Step title="Install dependencies">
    ```bash theme={null}
    bun install
    ```

    This installs every workspace: `apps/web`, `apps/cms`, `docs`, and the shared
    `packages/*`.
  </Step>

  <Step title="Create your environment files">
    Copy the templates and fill in whatever keys you have.

    ```bash theme={null}
    cp .env.example apps/web/.env.local
    cp apps/cms/.env.example apps/cms/.env.local
    ```

    <Warning>
      While keys are incomplete, keep `SKIP_ENV_VALIDATION=1` in
      `apps/web/.env.local` to bypass build-time env validation. See
      [Environment Variables](/docs/environment-variables) for the full canonical list.
    </Warning>
  </Step>

  <Step title="Run the app you need">
    <Tabs>
      <Tab title="Customer">
        ```bash theme={null}
        # Customer site — http://localhost:3000
        bun run dev --filter=@rgss/web
        ```
      </Tab>

      <Tab title="Admin">
        ```bash theme={null}
        # Admin portal (admin.theroyalglow.in)
        bun run dev --filter=@rgss/admin
        ```
      </Tab>

      <Tab title="CMS">
        ```bash theme={null}
        # Payload CMS admin
        bun run dev --filter=@rgss/cms
        ```
      </Tab>

      <Tab title="Docs">
        This documentation site is published by Mintlify from `docs/` — edit the `.mdx`
        files and `docs/docs.json`, then push. There is no local dev server to run.
      </Tab>
    </Tabs>
  </Step>

  <Step title="Verify the quality gates">
    ```bash theme={null}
    bun run typecheck     # tsc --noEmit across all packages
    bun run lint          # Biome
    bun run test:unit     # Vitest unit + property-based tests
    bun run build         # turbo build (all apps)
    ```

    All of these pass with **no environment keys** configured.
  </Step>
</Steps>

## Repository layout

<Tree>
  <Tree.Folder name="apps" defaultOpen>
    <Tree.Folder name="web">
      <Tree.File name="@rgss/web — Next.js 16 customer site (theroyalglow.in)" />
    </Tree.Folder>

    <Tree.Folder name="admin">
      <Tree.File name="@rgss/admin — Next.js 16 admin portal (admin.theroyalglow.in)" />
    </Tree.Folder>

    <Tree.Folder name="cms">
      <Tree.File name="@rgss/cms — Payload CMS v3, marketing content (cms.theroyalglow.in)" />
    </Tree.Folder>

    <Tree.Folder name="invoicing">
      <Tree.File name="@rgss/invoicing — Cloud Run PDF render service" />
    </Tree.Folder>
  </Tree.Folder>

  <Tree.Folder name="packages" defaultOpen>
    <Tree.File name="db — Drizzle schema + Neon client + queries" />

    <Tree.File name="business — pure business logic (no I/O)" />

    <Tree.File name="types — shared Zod schemas + TS types" />

    <Tree.File name="errors — AppError + error-code registry" />

    <Tree.File name="logger — structured JSON logger" />
  </Tree.Folder>

  <Tree.Folder name="docs" />
</Tree>

<Info>
  Next up: read [Conventions](/docs/conventions) for the coding standards every
  change is expected to follow, then the [Git Workflow](/docs/git-workflow) for
  how branches flow `dev → test → pprd → prod`.
</Info>


## Related topics

- [FAQ](/content/docs/faq.md)
- [Overview](/content/docs/index.md)
- [Git Workflow](/content/docs/git-workflow.md)
- [Observability](/content/docs/observability.md)
- [Customer Guide](/content/docs/product/customer-guide.md)
