diff --git a/setup/app.php b/setup/app.php
new file mode 100644
index 0000000..83cf9f3
--- /dev/null
+++ b/setup/app.php
@@ -0,0 +1,50 @@
+load();
+
+$builder = new Builder();
+
+$folders = [
+ 'common',
+ $__environment
+];
+$files = [
+ 'config',
+ 'setup'
+];
+foreach ($files as $file) {
+ foreach ($folders as $folder) {
+ $filename = implode(DIRECTORY_SEPARATOR, [
+ __DIR__,
+ $folder,
+ $file . '.php'
+ ]);
+ if (!file_exists($filename)) {
+ continue;
+ }
+ $builder->addDefinitions($filename);
+ }
+}
+
+$container = $builder->build();
+$app = Bridge::create($container);
+$app->setBasePath($container->get('base_url'));
+
+foreach ($folders as $folder) {
+ $filename = implode(DIRECTORY_SEPARATOR, [
+ __DIR__,
+ $folder,
+ 'middleware.php'
+ ]);
+ if (!file_exists($filename)) {
+ continue;
+ }
+ include_once $filename;
+}
+
+include_once 'router.php';
diff --git a/setup/common/config.php b/setup/common/config.php
new file mode 100644
index 0000000..0b1b9ad
--- /dev/null
+++ b/setup/common/config.php
@@ -0,0 +1,16 @@
+ true,
+ 'base_url' => $_ENV['BASE_URL'],
+ 'folders' => function() {
+ $directory = new Tree(DIRECTORY_SEPARATOR);
+ return $directory->build([
+ [dirname(__DIR__, 2), null, 'base'],
+ ['public', 'base', 'public'],
+ ['resources', 'base', 'resources'],
+ ['routes', 'resources', 'routes']
+ ]);
+ }
+];
diff --git a/setup/composer.php b/setup/composer.php
new file mode 100644
index 0000000..2d27ee1
--- /dev/null
+++ b/setup/composer.php
@@ -0,0 +1,6 @@
+getContainer()->get('folders')->routes,
+ $__environment . '.php'
+]);
diff --git a/setup/web/config.php b/setup/web/config.php
new file mode 100644
index 0000000..5948859
--- /dev/null
+++ b/setup/web/config.php
@@ -0,0 +1,49 @@
+ DI\decorate(function($prev, Container $c) {
+ $merger = new Merger(DIRECTORY_SEPARATOR);
+ $arr = (array) $prev;
+ $arr['templates'] = $merger->start()->add($prev->resources)->add('views')->merge();
+ $arr['cache'] = $merger->start()->add($prev->base)->add('cache')->merge();
+ return (object) $arr;
+ }),
+ 'urls' => function(Container $c) {
+ $tree = new Tree('/');
+ return $tree->build([
+ [$c->get('base_url'), null, 'base'],
+ ['assets', 'base', 'assets'],
+ ['images', 'assets', 'images'],
+ ['scripts', 'assets', 'scripts'],
+ ['styles', 'assets', 'styles']
+ ]);
+ },
+ 'assets' => function(Container $c) {
+ $arr = [
+ 'links' => [
+ ''
+ ],
+ 'fonts' => [
+ 'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.7/themes/default/assets/fonts/icons.eot',
+ 'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.7/themes/default/assets/fonts/icons.ttf',
+ 'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.7/themes/default/assets/fonts/icons.woff',
+ 'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.7/themes/default/assets/fonts/icons.woff2',
+ 'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.7/themes/default/assets/fonts/outline-icons.eot',
+ 'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.7/themes/default/assets/fonts/outline-icons.ttf',
+ 'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.7/themes/default/assets/fonts/outline-icons.woff',
+ 'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.7/themes/default/assets/fonts/outline-icons.woff2',
+ 'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.7/themes/default/assets/fonts/brand-icons.eot',
+ 'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.7/themes/default/assets/fonts/brand-icons.ttf',
+ 'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.7/themes/default/assets/fonts/brand-icons.woff',
+ 'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.7/themes/default/assets/fonts/brand-icons.woff2'
+ ],
+ 'scripts' => [
+ ''
+ ]
+ ];
+ return $arr;
+ }
+];
diff --git a/setup/web/setup.php b/setup/web/setup.php
new file mode 100644
index 0000000..c1071bd
--- /dev/null
+++ b/setup/web/setup.php
@@ -0,0 +1,20 @@
+ function(Container $c) {
+ if (!file_exists($c->get('folders')->cache)) {
+ mkdir($c->get('folders')->cache);
+ chmod($c->get('folders')->cache, 777);
+ }
+ return new ProVM\Common\Definition\View(
+ $c->get('folders')->templates,
+ $c->get('folders')->cache,
+ null,
+ [
+ 'urls' => $c->get('urls'),
+ 'assets' => $c->get('assets')
+ ]
+ );
+ }
+];