# Running in development mode

## Backend

### 1.1 Prerequisites

To run the backend, you need to have Python 3.9 (we're using v3.9.5) installed.

{% hint style="danger" %}
The Python version has to be below 3.10 [because of dbt-postgres](https://github.com/dbt-labs/dbt-core/issues/2827#issuecomment-1022860423).
{% endhint %}

### 1.2 Installation

First, install the dependencies in a new virtual environment by running the following command from inside the `kuwala/core/backend` directory:

```shell-session
DBT_PSYCOPG2_NAME=psycopg2 pip install --no-cache-dir -r requirements.txt --no-binary dbt-postgres
```

To set up a new virtual environment, you can follow the steps outlined [here](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/).

### 1.3 Launching

First, start the backend database by running the following command from inside the `root` directory of the repository:

```shell-session
docker-compose --profile backend_database up
```

After you installed all requirements, you can launch the API by running the following command from inside the `kuwala/core/backend` directory:

```shell-session
python3 app/main.py
```

To force the API server to reload everytime when code changes have been detected, simply pass `--dev=True` as a parameter when launching the API.

```shell-session
python3 app/main.py --dev=True
```

{% hint style="warning" %}
**Important:** You need to set the following environment variables:

```shell
DATABASE_USER=kuwala
DATABASE_PASSWORD=password
DATABASE_NAME=kuwala
DATABASE_HOST=localhost
```

{% endhint %}

## Frontend

### 2.1 Prerequisites

To run the frontend, you need to have Node.js (we're using v16) together with npm installed.

### 2.2 Installation

Install the dependencies by running the following command from inside the `kuwala/core/canvas` directory.

```shell-session
npm ci
```

### 2.3 Launching

To launch the frontend, run:

```shell-session
npm start
```

Now open [http://localhost:3000](http://localhost:3000/) in your browser, and you are good to go. 🚀


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kuwala.io/launching-kuwala/running-in-development-mode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
