You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the framework is a monolithic library with a mix of "Libraries", "Modules", and core components in src/. This structure creates tight coupling and unclear boundaries (e.g., Config depending on Loader which depends on App).
We propose moving to a Monorepo Structure using a packages/ directory. This will allow for:
Strict Decoupling: Each package has its own src and explicit dependencies.
Clearer Architecture: Separation of Core (Kernel) from App (Adapters) and Features (Http, Database).
Future-Proofing: Easier to extract/publish standalone components.
Proposed Structure
The src/ directory will be dissolved into packages/.
/packages
├── Core/ (Bootstrap: App Kernel, Container, Config, Loader, Env, Hook)
├── App/ (Glue: Web/Console Adapters, Traits)
├── Http/ (Request, Response, Middleware)
├── Console/ (Commands, Output)
├── Pipeline/ (New Shared Pipe Builder)
├── Database/ (ORM, Migrations)
├── Security/ (Csrf, Encryption, Hasher)
├── ... (See full plan for Auth, Session, etc.)
This refactoring directly supports the goals of Issue #373:
Boot Pipeline: The new packages/Pipeline component enables the "Boot Stages" logic.
Explicit Kernel: Moving App, Container, and Loader to packages/Core physically defines the "Application Execution Boundary".
DI Ownership: Centralizing Container in Core makes it the clear owner of service lifetimes.
Critical Changes
Split App: src/App/App.php moves to packages/Core. src/App/Adapters moves to packages/App. This resolves the circular dependency between the Kernel and the Http layer.
Config in Core: src/Config moves to packages/Core to resolve dependencies on Loader and Di.
Security Grouping: Csrf, Encryption, and Hasher are grouped under packages/Security.
Description
Currently, the framework is a monolithic library with a mix of "Libraries", "Modules", and core components in
src/. This structure creates tight coupling and unclear boundaries (e.g.,Configdepending onLoaderwhich depends onApp).We propose moving to a Monorepo Structure using a
packages/directory. This will allow for:srcand explicit dependencies.Core(Kernel) fromApp(Adapters) andFeatures(Http, Database).Proposed Structure
The
src/directory will be dissolved intopackages/.Synergy with Issue #373 (App Bootstrapping)
This refactoring directly supports the goals of Issue #373:
packages/Pipelinecomponent enables the "Boot Stages" logic.App,Container, andLoadertopackages/Corephysically defines the "Application Execution Boundary".ContainerinCoremakes it the clear owner of service lifetimes.Critical Changes
App:src/App/App.phpmoves topackages/Core.src/App/Adaptersmoves topackages/App. This resolves the circular dependency between the Kernel and the Http layer.src/Configmoves topackages/Coreto resolve dependencies onLoaderandDi.Csrf,Encryption, andHasherare grouped underpackages/Security.Migration Checklist
packages/directory structure.App,Di,Environment,Hook,Loader,Config,Tracertopackages/Core.Auth,Database,Session,View,Validationtopackages/*.Http,Console,Routertopackages/*.AdaptersandTraitstopackages/App.src/directories.composer.jsonautoloading to mapQuantum\to these new paths.