What is Alxarafe?

Alxarafe, it reads Aljarafe, is a free software project, which aims to become a simple but powerful development environment, designed with PHP 7.4 and composer, following an MVC design pattern. It is not intended to reach the size of Laravel or Symfony, but it does have a much smaller learning curve.

The objective of Alxarafe, is to build a robust and scalable system that can be used to develop different applications adding modules, Alxarafe is responsible for offering life support to these modules.

Basically, the MVC design pattern consists of separating the code into Model, View, and Controller. There is a lot of documentation on this design pattern, so it’s not hard to understand and use it successfully.

How does Alxarafe apply the MVC design pattern?

The MVC (Model-View-Controller) design pattern works in Alxarafe as follows:

  • The entry point is in the index.php file in the home directory, which loads the configuration and launches a dispatcher running a certain controller, from a certain module.
  • The controller can use different models that allow you to access and manipulate data, in the tables of the database.
  • The controller will also set a view that will display the result on the screen, and allow interaction with the user.

The development of the models, are initially based on MySQL (or MariaDB), but it is very simple to implement any other database engine, because it uses PDO for it.

The views are based on a system of themes and templates, implemented with Twig, that allow a complete customization of the appearance of the application.

Features of Alxarafe

Being still in development, it may not be advisable to use it in production, but it provides us with a tool with which to start without starting from scratch.

Among others, Alxarafe provides the following functionalities:

  • Connecting to database using PDO.
  • A dispatcher that allows you to select the handler to run based on the URL.
  • Management of table models.
  • Managing views using Twig.
  • A debugging bar with multiple tabs.
  • User authentication.

Alxarafe could be an alternative to frameworks such as Laravel or symfony that undoubtedly provide higher performance; but it is also true, that sometimes it is not worth adding so much complexity to a project… Or if…

If you’re interested in collaborating, you can do so from github’s rsanjoseo/alxarafe repository.