How elihjz/bienesraicesmvc works
Main Components
• Front Controller & Routing – The project features a central "Router.php" (and likely public/index.php) that acts as the entry point to the application. It directs incoming HTTP requests to the appropriate controllers.
• Controllers – The "controllers" directory contains various controllers (e.g., LoginController, PaginasController, PropiedadController, VendedoresController) which handle request processing, application logic, and delegate tasks.
• Models – In the "models" folder, you have classes like ActiveRecord, Admin, Propiedad, and Vendedor; this suggests an ActiveRecord-based approach to interact with the database.
• Views & Templates – The "views" folder (with subdirectories for auth, paginas, propiedades, vendedores) along with the "includes/templates" folder handle presentation. They render the HTML views for the end-user.
• Configuration & Utilities – Files under "includes" (like app.php, config/database.php, funciones.php) provide bootstrapping, configuration, and common functions.
• Frontend Asset Pipeline – The "src" folder (with SCSS, JS, images) and accompanying gulpfile.js indicate the use of Gulp for processing assets (CSS, JS) which are then outputted to "public/build".
• External Dependencies – The project uses Composer (composer.json, composer.lock) for PHP dependency management (including PHPMailer) and Node (package.json, package-lock.json) for frontend dependencies.
Relationships and Data Flow
• Controllers interact with Models (using ActiveRecord patterns) to retrieve or modify data, and then pass data to the Views.
• Views pull templated fragments from the "includes/templates" to build the final output.
• Meanwhile, configuration and utility functions (from includes/) support these operations.
• Asset pipeline flow: source files in "src" are transformed (via Gulp tasks as specified in gulpfile.js) into production-ready files in "public/build" (CSS, JS, images).
• External services such as the database (configured in includes/config/database.php) and the mailing service (PHPMailer via Composer) should be included as connected components.
Architectural Patterns and Technologies
• MVC Pattern – Clearly separate the Model (data), View (presentation), and Controller (logic) layers.
• ActiveRecord – Use of an ActiveRecord class indicates dynamic interaction with the database.
• Asset Management – The use of Gulp and a clear division between source (src) and build (public/build) assets.
• PHP Dependency Management – Composer for managing libraries (like PHPMailer) and ensuring dependencies are properly injected.
• Frontend Assets – SCSS and modern JavaScript (located in the src directory) indicate modern web practices.