Stop Coding the Same CRUDs: How I Built a PHP Framework for the AI Era (Vibecoding)

php dev.to

If you build software for the educational or administrative sector, you know the drill. Requirements change weekly, databases grow massively, and you find yourself rewriting the exact same logic for views, tables, pagination, and permissions for every new system.

Working as a developer and academic technician at a University Research Center, I reached a point where my job felt like 80 percent repetitive boilerplate and 20 percent actual business logic. My code was becoming a burden rather than a creative solution.

I needed a way out. I needed a system where I could declare what I wanted, rather than programming how to render it every single time.

The Philosophy: Configuration over Programming

I decided to build a higher-level layer leveraging the blazing speed of CodeIgniter 4 and MariaDB. The goal was simple: stop touching HTML views and controllers for standard administrative tasks.

Instead of writing a controller, a model, and five different views for a Users module, what if I could just write a single configuration array?

Enter Ragnos, the open-source enterprise framework I built to solve this exact problem.

Show, Don't Tell: The Data Dictionary Magic

In Ragnos, everything revolves around the RDatasetController. You define a Data Dictionary (a PHP array), and the framework automatically renders a fully functional, secure dashboard.

Here is a quick example of how you define a module in Ragnos:

// Just a simple configuration array
namespace App\Controllers\Store;

use App\ThirdParty\Ragnos\Controllers\RDatasetController;

class Customers extends RDatasetController
{
    public function __construct()
    {
        parent::__construct();

        // Security and context
        $this->checkLogin();
        $this->setTitle('Customers');

        // Persistence
        $this->setTableName('customers');
        $this->setIdField('customerNumber');
        $this->setAutoIncrement(false);

        // Fields
        $this->addField('customerName', [
            'label' => 'Name',
            'rules' => 'required'
        ]);

        // Calculated field
        $this->addField('Contact', [
            'label' => 'Contact',
            'rules' => 'readonly',
            'query' => "concat(contactLastName, ', ', contactFirstName)",
            'type'  => 'hidden'
        ]);

        // Relationships
        $this->addSearch('salesRepEmployeeNumber', 'Store\\Employees');

        // Grid
        $this->setTableFields([
            'customerName',
            'Contact',
            'salesRepEmployeeNumber'
        ]);
    }
}
Enter fullscreen mode Exit fullscreen mode

By just feeding this array to the framework, Ragnos automatically generates:

  • A dynamic data table with automatic pagination.
  • Advanced search filters.
  • Excel and CSV export capabilities.
  • Add and Edit forms with automatic CSRF protection and validation.
  • RESTful API endpoints
  • Protection against SQL injection and Cross-Site Scripting.

The Era of Vibecoding

Because Ragnos relies entirely on declarative configuration arrays, it creates an unexpected but massive advantage: It is the perfect framework for AI.

Since you don't need to generate complex HTML structures or multi-file MVC boilerplate, you can ask an AI: "Generate a Ragnos Data Dictionary for an Inventory Management module with these 10 fields." The AI spits out the PHP array, you paste it into your controller, and boom, you have a fully functional, secure, and styled module in 30 seconds. I call this Vibecoding: acting as the architect while the AI handles the typing, and the framework handles the rendering.

Secure by Default

When building systems for a Research Center, security isn't optional. Ragnos abstracts the risks by not allowing the developer to interact directly with raw queries or un-sanitized superglobals. It also includes a granular Role-Based Access Control out of the box, so you can hide sensitive fields or restrict actions based on user roles just by adding a roles condition to your array.

Try it out (It's Open Source)

Ragnos is the tool I use daily in production, and I've decided to release it fully open-source.

If you are a PHP developer tired of the CRUD grind, I would love for you to give it a spin, break it, and let me know your thoughts. Check out the docs and repo at ragnos.build. If you find it useful, dropping a star on GitHub means the world to me!

Want to master the architecture?

Because the project scaled significantly, I also wrote a complete, 162-page official manual called "Ragnos from Zero to Pro". It covers advanced hooks, deep RBAC integration, and AI Vibecoding techniques. If you want to support the project or implement it at an enterprise level, you can find the book on Leanpub.

But primarily, I want you to try the framework. Let's stop coding repetitive boilerplate and start building real solutions! Let me know what you think in the comments.

Read Full Tutorial open_in_new
arrow_back Back to Tutorials