# 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.


---

# 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://uccello.gitbook.io/doc/installation/pre-configured-version.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.
