Complete Phase 1: MVC, DB migrations, Auth, RBAC, Security, and Views
This commit is contained in:
41
bootstrap/app.php
Normal file
41
bootstrap/app.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
// Bootstrap Environment configurations
|
||||
if (file_exists(__DIR__ . '/../.env')) {
|
||||
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/..');
|
||||
$dotenv->load();
|
||||
}
|
||||
|
||||
use App\Core\Container;
|
||||
use App\Core\App;
|
||||
use App\Services\Database\Connection;
|
||||
use App\Services\Auth\AuthService;
|
||||
use App\Services\Auth\RBAC;
|
||||
use App\Services\Database\ActivityLogger;
|
||||
use App\Middleware\CsrfProtection;
|
||||
use App\Middleware\RateLimit;
|
||||
use App\Middleware\SecurityHeaders;
|
||||
use App\Middleware\Authenticate;
|
||||
|
||||
$container = new Container();
|
||||
|
||||
// Database Core configurations
|
||||
$container->singleton(Connection::class, Connection::class);
|
||||
|
||||
// Services bindings
|
||||
$container->singleton(AuthService::class, AuthService::class);
|
||||
$container->singleton(RBAC::class, RBAC::class);
|
||||
$container->singleton(ActivityLogger::class, ActivityLogger::class);
|
||||
|
||||
// Middleware bindings
|
||||
$container->bind(CsrfProtection::class, CsrfProtection::class);
|
||||
$container->bind(RateLimit::class, RateLimit::class);
|
||||
$container->bind(SecurityHeaders::class, SecurityHeaders::class);
|
||||
$container->bind(Authenticate::class, Authenticate::class);
|
||||
|
||||
// Instantiate App
|
||||
$app = new App($container);
|
||||
|
||||
return $app;
|
||||
Reference in New Issue
Block a user