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

# Installation

> Install and configure Markup locally for development.

# Installation

## Requirements

Before starting, ensure you have the following installed:

* Node.js 18+ (latest LTS recommended)
* npm or another compatible package manager
* PostgreSQL database
* WorkOS application credentials

Optional:

* Rust toolchain
* Tauri v2 CLI (for desktop builds)

***

# Clone the Repository

```bash theme={null}
git clone https://github.com/pphilfre/markup.git
cd markup
```

***

# Install Dependencies

```bash theme={null}
npm install
```

***

# Configure Environment Variables

Create a `.env.local` file in the project root.

Example configuration:

```dotenv theme={null}
# PostgreSQL / Prisma
DATABASE_URL=postgresql://user:password@localhost:5432/markup

# WorkOS AuthKit
WORKOS_CLIENT_ID=
WORKOS_API_KEY=
WORKOS_COOKIE_PASSWORD=
NEXT_PUBLIC_WORKOS_REDIRECT_URI=http://localhost:3000/api/auth/callback
```

## Environment Variable Details

### DATABASE\_URL

PostgreSQL connection string used by Prisma.

Example:

```dotenv theme={null}
DATABASE_URL=postgresql://markup:password@localhost:5432/markup
```

### WORKOS\_CLIENT\_ID

Your WorkOS application client ID.

### WORKOS\_API\_KEY

Your WorkOS secret API key.

### WORKOS\_COOKIE\_PASSWORD

A long random string used for session encryption.

You can generate one with:

```bash theme={null}
openssl rand -base64 32
```

### NEXT\_PUBLIC\_WORKOS\_REDIRECT\_URI

Authentication callback URL.

For local development:

```dotenv theme={null}
NEXT_PUBLIC_WORKOS_REDIRECT_URI=http://localhost:3000/api/auth/callback
```

***

# Database Setup

Generate the Prisma client:

```bash theme={null}
npx prisma generate
```

Run database migrations:

```bash theme={null}
npx prisma migrate dev
```

(Optional) Open Prisma Studio:

```bash theme={null}
npx prisma studio
```

***

# Start the Development Server

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

Open the app:

```txt theme={null}
http://localhost:3000
```

***

# Production Build

Build the application:

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

Start the production server:

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

***

# Optional - Tauri Desktop

## Run Desktop Development Build

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

## Build Desktop Application

```bash theme={null}
npm run tauri:build
```

***

# Troubleshooting

## Prisma Client Errors

Regenerate the Prisma client:

```bash theme={null}
npx prisma generate
```

## Migration Issues

Reset the local database:

```bash theme={null}
npx prisma migrate reset
```

## Port Already in Use

Run the app on another port:

```bash theme={null}
npm run dev -- -p 3001
```

***

# Next Steps

* Configure deployment environment variables
* Set up PostgreSQL backups
* Configure WorkOS authentication providers
* Build the optional Tauri desktop app
