> For the complete documentation index, see [llms.txt](https://blitslabs.gitbook.io/filecoin-loans/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blitslabs.gitbook.io/filecoin-loans/develop/quickstart-guide/running-the-server.md).

# Running the server

Actions described here are executed in the web module.

## Setting up the environment variables

Create a .env file with the schema of the .env.example file.

```bash
DB_HOST="your db host"
DB_USER="your db user"
DB_PASSWORD="your db password"
DB_NAME="your db name"
JWT_SECRET="your secret"
PORT="port of the app"
NODE_ENV=dev
SERVER_HOST=http://host:port
API_HOST="http://host:port/api/"
API_WALLET="wallet api url"
REACT_HOST=http://rect_host:react_port
```

{% hint style="danger" %}
Do not add this file to the control version system
{% endhint %}

## Installing dependencies

```bash
$ npm install
```

## **Starting the server and database**

```bash
$ npm run test
```

{% hint style="success" %}
A server should be started at the defined port and a database with the specified name should be created with its tables.
{% endhint %}

## **Saving the addresses of the deployed contracts**

{% hint style="info" %}
You only need to save the addresses of the deployed contracts once.
{% endhint %}

If it is the first time you are running the project or you deploy a new contract, you must register it in the database.

Insert the addesses of  protocol contracts into the `protocolLabs` table and addresses of assets into `loansAssets`table.

{% hint style="info" %}
You can fill the other fields as you prefer.
{% endhint %}
