# Mahaut Full AI Context ## Summary Mahaut is a lightweight PHP 8 framework for small websites and documentation sites. The framework can work with or without a database. The promo site is built with Mahaut itself and does not use a database. ## Value Proposition Mahaut helps developers build readable PHP applications with explicit routes, plain controllers, simple PHP views, and concise documentation. ## Request Flow 1. `public/index.php` receives the request. 2. `Core\Bootstrap::init()` loads configuration, autoloaders, runtime settings, and session support. 3. `app/routes.php` registers routes. 4. `Core\Router::dispatch()` matches method and path. 5. Route middleware runs when configured. 6. Controller action executes. 7. A view renders when `->view()` is attached to the route. ## Router Syntax ```php $router->get('/docs/{id:[a-z0-9-]+}', 'DocsController@article')->view('docs/page'); ``` Supported methods: GET, POST, PUT, PATCH, DELETE, OPTIONS. HEAD falls back to GET when no HEAD route exists. Parameters are injected into controller methods by name. ## Agent Editing Rules - Keep changes small. - Do not add database usage to the promo site. - Keep database support optional and disabled by default. - Do not add heavy dependencies unless there is a strong reason. - Keep documentation, examples, website copy, and code comments in English. - Keep user-facing reports in Russian when requested. - Do not restore files from `storage/review/quarantine` without manual review. ## Documentation Map - `/docs` - documentation index - `/docs/installation` - setup - `/docs/lifecycle` - request lifecycle - `/docs/configuration` - configuration - `/docs/middleware` - middleware - `/routing` - route syntax - `/examples` - examples - `/agents` - AI agent optimization - `/docs/security` - security baseline - `/docs/database` - optional database support