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

# Development

> Clone the repo and run Claw Lens from source in development or production mode.

This guide is for contributors or anyone who wants to run Claw Lens from source. If you just want to use the dashboard, see [Quick Start](/quickstart).

<Note>
  Claw Lens requires **Node.js 18 or later**. Run `node --version` to check your version before proceeding.
</Note>

## Clone and install

```bash theme={null}
git clone https://github.com/msfirebird/claw-lens.git
cd claw-lens
npm install
cd src/ui && npm install && cd ../..
```

The project has two `node_modules` — one for the backend (Express + SQLite) and one for the frontend (React + Vite).

## Development mode

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

This runs the backend and frontend concurrently with hot reload:

* **Backend** — Express server via `ts-node-dev`, auto-restarts on file changes
* **Frontend** — React dev server on port `6060`, proxies API requests to the backend on `4242`

Code changes in either `src/server/` or `src/ui/` take effect immediately.

To use a custom port:

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

## Production build

Build the project and run the compiled server:

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

This compiles TypeScript to `dist/` and builds the React frontend to `src/ui/dist/`. The Express server serves both the API and the static frontend from a single process.

To use a custom port or suppress auto-open:

```bash theme={null}
npm start -- --port 3000
npm start -- --no-open
```

<Warning>
  Note the extra `--` before flags when using `npm start`. This tells npm to pass the flags to the underlying script rather than consuming them itself.
</Warning>
