How menztel/nextframe works
Project Overview & Purpose
• This project is a Content Management Framework (CMF) that enables users to create and manage "vitrine" (display) websites.
• It is built with PHP 8 following the MVC (Model-View-Controller) design pattern, making it a full-stack web application with a strong focus on customizable templating and front-end assets (using SASS, GrapesJS, Amchart).
Key Components
a. Frontend:
• The public-facing layer is defined under the "public" directory (with an entry point index.php) and includes assets (CSS, JavaScript, images, SVGs).
• The "app/Views" directory is subdivided into front-office templates and pages, defining how content is rendered to users.
• "resources" includes JavaScript, SASS files, and a webpack configuration for building the front-end assets.
b. Backend:
• The "app" directory is the heart of the CMF:
• "Controllers" handles HTTP requests for various pages: home, dashboard, articles, users, security, etc.
• "Models" contains the business logic and data handling classes for interacting with articles, categories, comments, settings, and users.
• "Views" also includes a back-office section for administrative tasks, installer pages and partials.
• "config" and "core" directories include configuration files, routing settings (routes.yml), database connection (DB.php), and backup functionality.
• The custom templating engine is integrated in the views while the MVC pattern separates concerns within the app.
c. Infrastructure & Deployment:
• Docker:
• The project containerizes its environment using a docker-compose file along with dedicated configurations stored in the "docker" directory (nginx and PHP Dockerfiles, nginx.conf).
• These files indicate that Nginx acts as the web server/reverse proxy and PHP executes the application code.
• Build Tools:
• Composer is used to manage PHP dependencies (executed in the "app" directory).
• Node.js (npm) is used to manage front-end build processes (in the "resources" directory).
d. Database:
• The project includes an SQL script in "app/db/script.sql", indicating initial database schema creation.
• Although not explicitly seen as a running service in the file tree, the database component is implied as it supports the CMS functionality.
Important Architectural Patterns / Design Principles
• MVC Pattern: Clearly separate Controllers (managing request logic), Models (data and business logic), and Views (presentation).
• Templating and Custom Engine: Highlight that there is a bespoke templating system to render dynamic pages in both front-office and back-office contexts.
• Containerization: Emphasize the use of Docker, where Nginx and PHP services are containerized.
• Asset Build Pipeline: Note the role of Webpack, npm, and the SASS-based component system to deliver a responsive front-end.