How h2lsoft/unee-project works
Main Components
• Core/Kernel: At the heart of the framework is the “core” directory. This contains the bootstrap file (core/bootstrap.php), a series of libraries (in core/lib) that include configuration handling, routing, database abstraction, session management, and logging, as well as the kernel that initializes the framework.
• Configuration Layer: Notice the stand-alone “config/default” directory with several key config files (e.g., app.php, app_dev.php, frontend.php, backend.php, firewall.php, etc.). This part is critical in defining the behavior of the application in different environments.
• Modules: UNEE is built on a modular design. Under the “core/module” folder you have distinct modules for both the backend (core-backend) and frontend (core-frontend). These include modules related to authentication, file management, newsletter mailing, user management, dashboard, logging, and more.
• Components and Assets: The framework includes reusable UI components (datagrid, form) and asset management (CSS, JS) inside the core/assets folder, along with theme assets in “core/theme” and “theme” directories.
• Routing and MVC Elements: Routing files (e.g., core/route/backend.php, frontend.php, frontend_blog.php) indicate the routing layer that directs incoming HTTP requests to the correct controllers (found in core/lib/class/Router.php or in the individual module controllers).
• CLI/Command Tools: The “core/command” directory handles command-line utilities such as installation, migration, and live updates, which are invoked via PHP commands.
• Public and Theme Assets: The “public” directory exposes the static assets and uploaded files (images, uploads for articles, galleries, etc.) while the “theme” directories provide the view layer (Twig templates) for rendering pages.
Relationships and Interactions
• The entry point (index.php) initializes the Kernel, which loads the configuration files and registers modules.
• The Router (in the core lib) maps HTTP requests to controllers located in the modules. Each module (e.g., core-backend, core-frontend) encapsulates its own controllers, views, and assets.
• The command-line tools enable tasks like installation, migration, and live-updates by triggering corresponding functions in the core libraries and modules.
• The public directory and themes provide the specialty to serve static content and dynamic view generation (using the Twig engine).
Architectural Patterns and Design Principles
• Modularity: Clear separation into modules, each with its own assets, controllers, and view templates.
• MVC-like Separation: Although not strictly “MVC,” you see a separation between application logic (modules/controllers), presentation (Twig templates in theme directories), and configuration.
• Reusability: The inclusion of reusable components (datagrid, forms, etc.) and assets shared across modules.
• Service Layer / Libraries: Core “lib” classes offer services such as database (DB.php), mailer (Mailer.php), and event management (EventManager.php).
Key Technologies and Framework Elements
• PHP and Composer for dependency management.
• Twig as the templating engine.
• Apache (as suggested in the prerequisites) for web serving.
• Built-in modules for common enterprise tasks (authentication, file management, live updater, etc.).
Detail and Clarity
• That every key element from the file tree (like asset management, theming, and configuration files) is captured;
• Not only the high-level modules but also their interdependencies — for example, how the “Router” depends on the “Config” files and interacts with both frontend and backend controllers;
Happy diagramming!