Step 1: Download the developer edition

To get started, download the latest edition of Monte.

Please note that for now Monte doesn't provide regular updates to your current project. Contact us directly for support or more information.

Step 2: Host it locally or live

To provide a smooth installation, Monte has been tested on these hosts: DigitalOcean, HostGator, 1&1, DreamHost, GoDaddy, Bluehost, InMotion.

You should not worry about any dependencies, terminal functions or deploying problems. Monte is a standalone system, and it was built to be extremely flexible across different environments.

Step 3: Configure the basic

By default, Monte will be installed on an automatically generated sqlite file. If you want to change it to MySQL please do that before installation in /engine/storage/config/config.ini.php file.

Please note that the only 2 things you'd have to change before deploying your project is the base_url option in config file and MySQL database configuration if it's not SQlite.

Step 4: Install the project in browser

That should be easy.
It will just create an account for you, and get you to the backend, where all the management is going to happen.

Step 5: Code your app & design

We've prepared the Site app for you, which gives you a nice kick-start in the development. Using it you can add routes, connect views, code complex logic and so much more. Find out more in the development guide.

Most of the work should be enough to do in just 1 folder: /apps/Site.

Add: Add a new app

The minimal structure for your app to be fully integrated into Monte.

Folder structure

YourApp
  - Controller
    - YourAppController.php
  - Models
  - resources
  - views
  - Configuration.php

YourAppController.php

<?php

namespace Apps\YourApp\Controllers;

use Engine\Base\ApplicationsController;

class YourAppController extends ApplicationsController
{
    public function index()
    {
        // The view files are taken from from /apps/YourApp/views/

        $this->render('index', true);
    }

    public static function subtitle()
    {
        return 'Enter a subtitle for your app';
    }
}

Configuration.php

<?php

namespace Apps\YourApp;

use Engine\Base\ApplicationsConfiguration;

use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Database\Schema\Blueprint;
use Engine\Helpers\Utils;
use Engine\Models\ApplicationsModel;

class Configuration extends ApplicationsConfiguration
{

    public function routes()
    {
        return [];
    }

    public function updates()
    {
        return [];
    }

    public function database()
    {

    }

    public function seed()
    {
        // Adds the app in the database
        ApplicationsModel::create([
            'name' => 'YourApp',
            'folder' => 'YourApp',
            'slug' => Utils::slug('Your App')
        ]);
    }

    public function remove()
    {
        ApplicationsModel::where('folder', 'YourApp')->delete();
    }

}

Create this folder inside your project (/apps folder) and then update everything in the backend -> Settings.

Add: Add a new page

Create a route in the configuration.

public function routes()
    {
        return [
            '/' => [
                'namespace' => 'Apps\\YourApp\\Controllers\\YourAppController',
                'controller' => 'YourAppController',
                'action' => 'homepage',
                'method' => 'GET'
            ],
            '/your-page-url' => [
                'namespace' => 'Apps\\YourApp\\Controllers\\YourAppController',
                'controller' => 'YourAppController',
                'action' => 'yourPageMethod',
                'method' => 'GET'
            ]
        ];
    }
                        

Add the yourPageMethod in the controller.

public function yourPageMethod()
{
    $this->data['metaTags']['title'] = 'Your Page';

    // The css & js files are taken from from /apps/YourApp/resources/.
    // Resources folder is copied to /public/build/apps/your-app.
    $this->data['css'] = ['style.css'];
    $this->data['js'] = ['scripts.js'];

    // The view files are taken from from /apps/YourApp/views/
    $this->render(['header', 'your-page', 'footer']);
}
                        

Update: Update an app

Add the static method in the configuration.

public function updates()
    {
        return [
            'Apps\\YourApp\\Controllers\\UpdatesController::removeTestTable',
            'Apps\\YourApp\\Controllers\\UpdatesController::changeAppName',
            'Apps\\YourApp\\Controllers\\UpdatesController::yourMethod',
        ];
    }

Add whatever you want into your method.

public static function removeTestTable()
    {
        Capsule::schema()->drop('yourapp_test');
    }

    public static function changeAppName()
    {
        $siteApplication = ApplicationsModel::where('folder', 'Site')->first();
        $siteApplication->name = 'Monte';
        $siteApplication->save();
    }

    public static function yourMethod()
    {
        Capsule::schema()->table('yourapp_members', function (Blueprint $table) {
            $table->increments('id');
            $table->string('member_name');
            ...
        });
    }

Connect: Use other apps

Go to any app's main controller, and use any static function they provide. For example for the Blog app, you could use these methods:

public static function getPosts($limit = 6, $page = 1, $category_id = false)
    {
        $articles = BlogArticlesModel::select(['blog_articles.*'])
            ->where('blog_articles.draft', false)
            ->orderBy('blog_articles.created_at', 'desc')
            ->leftJoin('blog_article_categories', 'blog_articles.id', '=', 'blog_article_categories.article_id');

        if (!empty($category_id)) {
            $articles->where('blog_article_categories.category_id', $category_id);
        }

        $articles = $articles->groupBy('blog_articles.id');

        $articles = $articles->withPagination($limit, $page);

        foreach ($articles as $article) {
            $article->user = UsersListModel::find($article->user_id);
            $article->categoryIds = BlogArticleCategoriesModel::where('article_id', $article->id)->pluck('category_id')->toArray();
            if (!empty($article->categoryIds)) {
                $article->categoryTitles = BlogCategoriesModel::whereIn('id', $article->categoryIds)->pluck('title')->toArray();
            }
        }

        return $articles;
    }

    public static function getSinglePost($params = ['slug' => false])
    {
        $singleArticle = BlogArticlesModel::where('slug', $params['slug'])->orderBy('id', 'desc')->first();

        if (empty($singleArticle)) {
            return [];
        }

        $singleArticle->user = UsersListModel::find($singleArticle->user_id);
        $singleArticle->categoryIds = BlogArticleCategoriesModel::where('article_id', $singleArticle->id)->pluck('category_id')->toArray();

        if (!empty($singleArticle->categoryIds)) {
            $singleArticle->categories = BlogCategoriesModel::whereIn('id', $singleArticle->categoryIds)->get();
        }

        return $singleArticle;
    }

    public static function getSingleCategory($params = ['slug' => false])
    {
        return BlogCategoriesModel::where('slug', $params['slug'])->first();
    }
}

Variables: Global data

Go to /engine/Base/BaseController.php to see all public variables used in the whole project.

Monte uses $this->data['yourVariable'] to pass variables across controllers. In views you can use them as $yourVariable.

Structure: Apps, Design, Engine & Resources

Everything in Monte happens in apps & engine. The public folder is there to start the website, and to keep the public files, e.g. uploaded images, the resources folder from all apps and more.

Configuration.php
Configuration.php
composer.json composer.lock Configuration.php
Configuration.php
Configuration.php
Configuration.php
Configuration.php
compose.json compose.lock Monte.php
readme.txt

App Ideology: Integrate & combine more apps

We believe this could be the next standard of building complex web apps. The simple idea of having several apps which can communicate with each other is amazing. That's the core of Monte, and inside it stands a simplistic structure, based on the MVC model.

App Updates: Keep your app organised

Each app goes with time through different stages: Installation, Customisation, Connecting views, Communicating with other apps, Adding the CRUD panel...

To ensure a stable development, we've introduced the updates feature. Each app can create a database structure, seed data in the Configuration.php file, but afterwards you can link what code the update system should take over, and Monte will take care about the whole process..

Theme Ideology: A part of an app

You can integrate any HTML theme into any app in a couple of minutes. There're 2 things to keep in mind: the view files are taken from /apps/YourApp/views based on the Latte template engine and the resources folder is for css,js,img - and its files are going to be copied into the /public/build/apps/your-app/ folder.

Database: Illuminate Database

The Illuminate Database component is a full database toolkit for PHP, providing an expressive query builder, ActiveRecord style ORM, and schema builder. It currently supports MySQL and SQLite. It also serves as the database layer of the Laravel PHP framework.

Learn more →

Routing: PHRoute

A super fast PHP router, with route parameters, restful controllers, filters and reverse routing.

Each app has a Configuration file, where the developer can add any type of routes and connect them to any method in the project.

Learn more →

Template Engine: Latte

Latte is a template engine for PHP which eases your work and ensures the output is protected against vulnerabilities, such as XSS.

Latte is fast: it compiles templates to plain optimized PHP code.
Latte is secure: it is the first PHP engine introducing content-aware escaping.
Latte speaks your language: it has intuitive syntax and helps you to build better websites easily.

Learn more →