Backend only WordPress 01

Exploring the idea to use WordPress for the backend only.

Why

As the introduction says I’d like to explore the possibilities of using WordPress for the backend only. I love WordPress and the way it allows extending its backend but I think this little project might help me to better understand what goes on when a page request is made to a WordPress site.
The testing part of me has the upper hand here and wants to disassemble things for the sake of knowledge.

Setting up a test environment

I’ve grown fond of Rarst’s Composer stack for WordPress site development and have used it for the latest client projects. It allows for a quick and maintainable deployment that works well for small site projects (I do not have experience with big ones).
I’ve modified the original composer.json file to my own needs and tastes and that’s the starting point of this research of mine:

{
    "name": "name/project-slug",
    "description": "Project description",
    "authors": [
        {
            "name": "theAverageDev (Luca Tumedei)",
            "email": "[email protected]",
            "homepage": "http://theaveragedev.com"
        }
    ],
    "type": "project",
    "repositories": [
        {
            "type": "composer",
            "url": "http://wpackagist.org"
        }
    ],
    "config": {
        "vendor-dir": "vendor"
    },
    "require": {
        "johnpbloch/wordpress": ">=3.9",
        "xrstf/composer-php52": "*",
        "wpackagist-plugin/debug-bar": "*",
        "wpackagist-plugin/debug-bar-cron" : "*",
        "wpackagist-plugin/debug-bar-actions-and-filters-addon": "*",
        "wpackagist-plugin/debug-bar-screen-info": "*",
        "wpackagist-plugin/debug-bar-transients": "*",
        "wpackagist-plugin/debug-bar-query-count-alert": "*"
    },
    "require-dev": {
        "lucatume/function-mocker": "~0.2",
        "badcow/lorem-ipsum": "dev-master",
        "lucatume/wp-browser": "~1.5"
    },
    "extra": {
        "wordpress-install-dir": "wp"
    },
    "scripts": {
        "post-install-cmd": [
            "xrstf\\Composer52\\Generator::onPostInstallCmd"
        ],
        "post-update-cmd": [
            "xrstf\\Composer52\\Generator::onPostInstallCmd"
        ],
        "post-autoload-dump": [
            "xrstf\\Composer52\\Generator::onPostInstallCmd"
        ]
    }
}

create a composer.json file in the website root folder and init the Composer project

composer install --prefer-dist

and after some time (depending on the connection) everything will be at its place.
File structure after composer install
After some virtual machine or MAMP setup pointing to the project root (in my case aliased to the http://test.local domain) browsing to the folder will yield in either a 404 or a 403 error depending on your server configuration.

Hello world!

To honor a testing tradition I add an index.php file in the root of the project and simply return the traditional string

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Hello world</title>
</head>
<body>
   <p>Hello world!</p> 
</body>
</html>

that was the easy part.
Hello world

Next

Configuring WordPress for the unusual environment.

I appreciate your input