# Install a pre-configured version

### 1. Create the project

It is possible to start a new Uccello project very simply from the following command:

```bash
composer create-project --prefer-dist uccello/project ProjectName
```

{% hint style="info" %}
Replace `ProjectName`with the name of your project or by `.` to install Uccello in the current directory.
{% endhint %}

This command will close the project's [Git repository](https://github.com/uccellolabs/uccello-project) and automatically install all necessary dependencies. This will create a new **Laravel** project in which **Uccello** has been pre-configured.

### 2. Configure the environment

Once the project is created you can configure the `.env` file as explained in Laravel's [official documentation](https://laravel.com/docs/5.7/database#configuration).

{% code title=".env" %}

```
APP_URL=http://localhost:8000
...
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=uccello
DB_USERNAME=homestead
DB_PASSWORD=secret
```

{% endcode %}

{% hint style="warning" %}
This is an example. Put your own data into the `.env` file.
{% endhint %}

If you do not want to use the notion of multi domains, you can add the following line into the `.env` file:

{% code title=".env" %}

```
...
UCCELLO_MULTI_DOMAINS=false
```

{% endcode %}

### 3. Execute migrations

Once the database is configured, it is now possible to execute [migrations](https://laravel.com/docs/5.7/migrations) to create the database structure used by Uccello.&#x20;

```bash
php artisan migrate
```

### 4. Create an user

To easily create a new user, execute the following comman&#x64;**:**

```bash
php artisan uccello:user
```

### 5. Activate connection log

You can see last connections of a user in his detail page. To activate this functionality edit the file located at `app/Http/Controllers/Auth/LoginController.php` and the following code:

```php
use Carbon\Carbon;
use Uccello\Core\Models\Connection;

class LoginController extends Controller
{
  // ...
  
  /**
    * The user has been authenticated.
    *
    * @param  \Illuminate\Http\Request  $request
    * @param  mixed  $user
    * @return mixed
    */
    protected function authenticated(Request $request, $user)
    {
        Connection::create([
            'user_id' => $user->id,
            'datetime' => Carbon::now(),
        ]);
    }
}
```

### 6. It's ready!

If you would like to use PHP's built-in development server to serve your application, this command will start a local development server:

```bash
php artisan serve
```

Now you can go to the home page of your site: <http://localhost:8000>. Once redirected to the login page, you can authenticate yourself with the credentials created at the step 4.
