Installation

Requirements

A note about Docker
While Docker is not is not required to use Enso, the documentation will assume you are using Docker for development.

Installation

  1. Install a new Laravel project. Where [SITE_NAME] is the name of your site.

    mkdir [SITE_NAME]
    docker run --rm -i -v $(pwd):/opt -w /opt shippingdocker/php-composer:latest composer create-project --prefer-dist laravel/laravel=^6.0 [SITE_NAME]
    cd [SITE_NAME]
    
  2. Add the Yadda repository to your projects composer.json

    "repositories": [
       {
           "type": "composer",
           "url": "https://packages.maya.agency"
       }
    ]
    
  3. Use the temporary docker container to install Enso via composer.

    docker run --rm -it -v $(pwd):/opt -v ~/.ssh:/root/.ssh -w /opt shippingdocker/php-composer:latest composer require --prefer-stable yadda/enso-core:^2.0 yadda/enso-utilities:^2.0
    
  4. Fill in details in .env.

  5. In config/filesystems.php change default to public;

  6. Use the temporary container to publish laravel & enso vendor assets

    docker run --rm -it -v $(pwd):/opt -w /opt shippingdocker/php-composer:latest php artisan vendor:publish --all
    
  7. You can now remove the temporary container.

    docker image rm shippingdocker/php-composer:latest
    
  8. You may need to change the permissions on the enso script

    sudo chmod 744 enso
    
  9. start your docker container, and then run the enso install script

    enso start
    enso artisan enso:install
    
  10. Add some Enso starter routes to your routes/web.php file.

Route::group(['middleware' => 'auth'], function() {
    Route::post('admin/pages/publish', 'Admin\PagePublishController@publish')->name('admin.pages.publish');
    Route::post('admin/pages/unpublish', 'Admin\PagePublishController@unpublish')->name('admin.pages.unpublish');
    EnsoCrud::routes('admin/pages', "\\" . config('enso.crud.page.controller'), 'admin.pages');
    Route::get('admin', 'Admin\DashboardController@index');
});
Route::get('{page}', ['as' => 'pages.show', 'uses' => 'PageController@show']);
  1. Add meta tags to your main template. In resources/views/layouts/app.blade.php in the <head> remove the <title> element and replace it with:
@include('enso-meta::display')
  1. Install npm dependencies
enso yarn add --dev \
    axios \
    babel-preset-es2015 \
    buble \
    bulma \
    eslint \
    eslint-config-airbnb \
    eslint-config-prettier \
    eslint-plugin-prettier \
    gulp \
    imagemin-svgo@^4.2.0 \
    imagemin-webpack-plugin \
    laravel-mix@^5.0 \
    lodash \
    vue-axios \
    vue-multiselect@next \
    vue-slider-component \
    vuejs-datepicker \
    vue2-leaflet@~0.0.60 \
    moment \
    moment-timezone \
    portal-vue \
    prettier \
    quill \
    quill-render \
    resumablejs \
    stylelint-config-airbnb \
    [email protected] \
    vuedraggable \
    [email protected] \
    vuex \
    webpack-svgstore-plugin
  1. Compile your frontend assets
enso yarn run dev
  1. Your should now be able to use your site!

You might also want to...

Development

If you're developing enso-core you can use the following to load your packages from a local directory.

"repositories": [
    {
        "type": "path",
        "url": "./packages/yadda/enso-core"
    },
    {
        "type": "path",
        "url": "./packages/yadda/enso-utilities"
    }
]