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

# Development Setup

> Configure your local environment to contribute to Corgtex.

Welcome to the Corgtex engineering team. Follow this guide to set up your local development environment for the monorepo.

## Prerequisites

* Node.js version 22
* Docker and Docker Compose (Desktop)
* A GitHub account and local SSH keys configured

## 1. Clone and Install

```bash theme={null}
git clone https://github.com/corgtex/corgtex.git
cd corgtex
npm install
```

## 2. Infrastructure (Database)

We use Docker Compose to run the local PostgreSQL database seamlessly alongside development.

```bash theme={null}
docker compose up -d postgres
```

## 3. Environment Variables

Copy the example file to set up your local `.env`. Ensure your database URL points to `localhost` (the default in the example).

```bash theme={null}
cp .env.example .env
```

If you plan to test AI completions locally, you will need to add a valid `MODEL_API_KEY` (e.g., an OpenRouter or OpenAI token) and configure the relevant `MODEL_PROVIDER` in your `.env`.

## 4. Prisma Setup

Before you start the Next.js server, you must compile the Prisma Client and apply any pending database schema migrations.

```bash theme={null}
# Generate the TypeScript client based on the current schema
npm run prisma:generate

# Apply migrations to your local Postgres container
npm run prisma:migrate:deploy

# Run the production bootstrap seed to create the configured workspace/admin baseline
npm run prisma:seed

# Optional: create the E2E UI user from AGENT_E2E_EMAIL / AGENT_E2E_PASSWORD
npm run seed:e2e

# Optional: load the Corgtex dogfood workspace fixture explicitly
npm run seed:dogfood

# Optional: load only the JNJ demo fixture explicitly
npm run seed:jnj-demo

# Optional: load both dogfood and JNJ demo fixtures explicitly
npm run seed:dogfood-demo
```

The J\&J demo seed is refreshable and includes public-safe showcase data for current product surfaces such as goals, agent identities, agent observability, recognitions, audit logs, governance, finance, meetings, and the Organization Brain. Shared demo deployments can set `CORGTEX_AUTO_SEED_JNJ_DEMO=true` so each deploy refreshes the demo after migrations and the base seed.

## 5. Run the Application

Start the local development server:

```bash theme={null}
npm run dev
```

This command leverages turborepo or standard npm workspaces to boot both the Next.js web application (usually on port `3000`) and the background worker process.

Open [http://localhost:3000](http://localhost:3000) to view the application. Log in using the credentials defined in your `ADMIN_EMAIL` and `ADMIN_PASSWORD` `.env` variables.
