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

# Developer Setup

> Set up your development environment for Libredesk

Libredesk is a monorepo with a Go backend and two Vue.js frontend apps: the main agent dashboard and the live chat widget. Both use Shadcn for UI components.

## Prerequisites

* Go
* Node.js and pnpm (if working on frontend)
* Redis
* PostgreSQL (≥13)

## First-time setup

<Steps>
  <Step title="Clone the repository">
    ```bash theme={null}
    git clone https://github.com/abhinavxd/libredesk.git
    cd libredesk
    ```
  </Step>

  <Step title="Configure Libredesk">
    Copy `config.sample.toml` as `config.toml` and add your configuration:

    ```bash theme={null}
    cp config.sample.toml config.toml
    ```
  </Step>

  <Step title="Build and install">
    Build the libredesk binary and run the DB setup:

    ```bash theme={null}
    make
    ./libredesk --install
    ```

    Sets up the database and prompts you for the System user password.
  </Step>
</Steps>

## Running the dev environment

<Tabs>
  <Tab title="Full stack">
    Run the backend and both frontend apps in development mode:

    <Steps>
      <Step title="Start backend server">
        ```bash theme={null}
        make run-backend
        ```

        This starts the libredesk backend dev server on `:9000`
      </Step>

      <Step title="Start the main app">
        ```bash theme={null}
        make run-frontend-main
        ```

        This starts the agent dashboard in dev mode using pnpm on `:8000`

        Requests are proxied to the backend running on `:9000` (check `vite.config.js` for proxy config)
      </Step>

      <Step title="Start the widget app">
        ```bash theme={null}
        make run-frontend-widget
        ```

        This starts the live chat widget in dev mode on `:8001`, also proxied to the backend on `:9000`

        Only needed if you are working on the widget.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Backend only">
    ```bash theme={null}
    make run-backend
    ```

    Access the backend API at `http://localhost:9000`
  </Tab>

  <Tab title="Frontend only">
    ```bash theme={null}
    make run-frontend-main
    ```

    Access the main app at `http://localhost:8000`

    ```bash theme={null}
    make run-frontend-widget
    ```

    Access the widget at `http://localhost:8001`
  </Tab>
</Tabs>

## Production build

To build a production-ready binary:

```bash theme={null}
make
```

This builds the Go binary and both frontend apps, embeds the static assets, and produces a single self-contained binary: `libredesk`.

To build just one app: `make frontend-build-main` or `make frontend-build-widget`.
