38 comments

[ 3.3 ms ] story [ 96.7 ms ] thread
How is it different from phpMyAdmin ?
Looks like it does some relational stuff automatically based on column names. Another difference looks like it doesn't have all the options of phpMyAdmin.
I haven't used this , but it looks like it's cleaner and simpler. phpmyadmin has a lot of options that non technical folks could use to break the database.
Hi, with this tool you have control over the generated code. You can add a login system, modify the views, add an upload images system...

The tool generates a base administrator and you can add all functionalities that you want.

Hi Jon, you should show some examples on the home page on how to extend the code. For example if I wanted to modify the administration for one of the tables is there a base class that I can inherit from? For example if I wanted to a hide a particular field in the admin, or if I had some custom validation rules.

Is this designed to work with any particular framework?

The generated code is "pure" PHP. You have a controller for create, edit, list and delete. You can modify the controllers without problems and extend the functionalities. You can hide fields, add new ones, implement an upload images/files system...

The used framework is Silex (http://silex.sensiolabs.org/)

Thank you.

Is there a good split between generated/edited code? Or do I have to change the generated code?

Also, can I regenerate only parts of the interface (after changes to the database, for instance)?

If I understand, the approach that you are taking is that code is generated for the admin using the generator and then you would do modifications afterwards? What happens in such a case that the code is modified and then you run the generator again?

An alternative approach would be to supply custom classes to the generator at the time that it generates.

For example.

  Class CustomerTable extends AdminTable {  
    $hiddenfields = [ "created_date" , "password" ];
    $validation = [ "email" => "validateEmail"];

    function validateEmail($validate_data) {
       return validEmailAddress($validate_data);
    }
  }  
Then the user can place this class somewhere specific or register it with the generator in some way, and when the generator runs it will use this class and not overwrite changes.

Like

  $adminGenerator->use("customer","CustomerTable");
This way you can keep using the generator even after you have done extensive modification to the tables and code.
I assume the idea is that it can be customised after the initial run..

A quick look at the code and it seems to treat all content as text - you either get a text input or a text area.

Even without any php Models defining the type of a field, the MySQL column types provide a reasonable amount of information about the type which can be translated (as phpMyAdmin/etc do) into more logical form fields.

>The backend is generated in seconds without configuration files where there is a lot of "magic" and is very difficult to adapt to your needs.

Double check that :).

There are pull requests from May that haven't been even answered or commented. Am I wrong, or shouldn't it be a custom to at least comment why you're not including it into the code?
You are right :( I want to review all pull request with careful, It implies a lot of code and I need find the time.
Just tell them that then... no harm in being straightforward.
This is good advice. I used to help maintain a bit on the bigger size project on Github and our lead developer I think really wanted to spend time looking over and trying to give quality responses. Which ended up sometimes taking a long time or not at all. Unfortunately, it came off to some people as not caring about their submissions. Just a simple message about being busy and asking them to remind you if you forget works wonders.

Example: "Thanks for sending this in. I'm busy right now but will look into it later. If I haven't responded in a week or two, do me a favor and ping this thread."

No reply most of the times is received as a "I don't care" message by the PR author, while it is almost always lack of time to reply by the project maintainer.
About 10 years ago, I had to do a php/mysql online shop for a customer, and I did not had much time for the backend.

So I bought a ~$100 product, I think it was CodeCharge Studio from YesSoftware. I was skeptic, but I had no option.

Turned out great. I was ready in a day and it looked very good. You could generate the admin site in multiple languages and it was very easy to use.

A similar tool that I've had great fun with is Sandman:

https://github.com/jeffknupp/sandman

From the Readme: "Given a legacy database, sandman not only gives you a REST API, it gives you a beautiful admin page." It uses Python and SQLAlchemy and supports a good selection of databases.

Thank you so much, I've been needing something like this forever.
Awesome, when I saw the OP I was thinking, "I wonder if someone has done this with Flask yet?" :) Thanks!
Another similar option is to use django's inspectdb, which will get you all the model's for a django app, which means adding the admin (a simple CRUD interface) is only a few lines of code away.
Came here to say the same thing. I've always fancied spicing up inspectdb to be a bit more dynamic and flexible - I like the idea of a dynamic Django Admin for any db I throw at it.

It shouldn't be too hard to do.

I'm wondering how this is different from using CakePHP or Ruby on Rails for generating a similar interface. I've used CakePHP heavily and am generally a fan of CakePHP - plus, CakePHP lets you customize your application once you have the basic CRUD scaffolding in.
My thoughts as well. I'm using Yii framework, and you can do a similar thing with Yii's Gii tool.
I've been working on a tool where you spec your data in an xml file and it'll generate a dbsteward [1] file and some Kohana [2] ORM files. It's pluggable so it could be easily add more modules to produce applications for other frameworks.

I'm using it for an application I'm working on now (and working out little kinks) and will be releasing it shortly.

[1] https://github.com/nkiraly/DBSteward [2] http://kohanaframework.org/

If this tool is taking data directly from MySQL, why does it need to rely on column names to determine relationships? Couldn't it just see that a column is a foreign key?
You or I might think of that as a serious design flaw. But it's just the way developers roll, out in PHP land.
http://dev.mysql.com/doc/refman/5.1/en/myisam-storage-engine...

See "Foreign key support" in MyISAM

Also, in my experience a lot of people do not always use the underlying database constraints even in InnoDB.

Not sure if that was the intent of the authors, but just so that others may understand that it could be more than just "PHP land". Might be a little closer to "MySQL land".

The point is that fundamentally overpowered features of this sort, while potentially quite useful (in some cases), should be optional (and the default setting should point to the non-enabled case).

Being as they can certainly make for very rude surprises, when you discover them by chance.

Ah, I missed that part of your statement. Snarky comments like "PHP land" while clever and gives us all a big chuckle can be a bit difficult to understand in context. If you actually want someone to understand what you are saying, subtle digs and pretentious put downs, while funny and I'm sure make you feel better about yourself, don't really contribute much beyond dividing people and making others feel bad.
(comment deleted)
The first screenshot is of PhpMyAdmin. That's embarrassing.