# Usage {#usage}

## Configure database \(optional\) {#configure-database}

To use **LadderJS **with an authentication and a private area, you need a PostgreSQL database.

First, create a PostgreSQL database:

```bash
$ createdb <DATABASE_NAME>
```

Then, add a `.env` file at the root of your project:

**/.env**

```ruby
# The database connection string
DATABASE_URL=postgres://<USER>:<PASSWORD>@<DATABASE>

# Enable the Sequelize logging, disabled by default
DATABASE_LOGGING=true
```

## Create LadderJS instance {#create-ladderjs-instance}

To start using **LadderJS **simply create an`index.js`file containing the following:

```js
const ladderjs = require('ladderjs')

const options = {}

const app = ladderjs(options)

app.start()
```

Then launch it use the command:

```bash
$ node .
```

You'll then have have a basic website, configured using all the default settings \([check it in the configuration page](https://havens.gitbooks.io/ladderjs/content/configuration.html)\). The basic app is using MaterializeCSS as CSS-JS framework, and shows a homepage, a login/signup pages, and a protected page.

## NB {#nb}

If you use Nodemon or any other file monitor, be sure tu exclude the `sessions` folder and the `*.log` files as they are automatically generated by the framework and would trigger a restart on each router call:

```bash
$ nodemon . -i sessions -i *.log
```



