

An open source tool to generate a complete backend from a MySql database - jonseg
http://crud-admin-generator.com

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

[https://github.com/jeffknupp/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.

~~~
smellf
Awesome, when I saw the OP I was thinking, "I wonder if someone has done this
with Flask yet?" :) Thanks!

------
dmacvicar
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.

------
mrleinad
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?

~~~
jonseg
You are right :( I want to review all pull request with careful, It implies a
lot of code and I need find the time.

~~~
mtrimpe
Just tell them that then... no harm in being straightforward.

~~~
fubu
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."

------
samspenc
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.

~~~
babuskov
My thoughts as well. I'm using Yii framework, and you can do a similar thing
with Yii's Gii tool.

------
jimktrains2
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](https://github.com/nkiraly/DBSteward)
[2] [http://kohanaframework.org/](http://kohanaframework.org/)

------
jeffasinger
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.

~~~
andybak
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.

------
kdazzle
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?

~~~
fubu
[http://dev.mysql.com/doc/refman/5.1/en/myisam-storage-
engine...](http://dev.mysql.com/doc/refman/5.1/en/myisam-storage-
engine.html#idm47466979839104)

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".

~~~
dreamweapon
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.

~~~
fubu
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.

------
thejosh
>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 :).

~~~
jonseg
Thank you :)

------
ponytech
How is it different from phpMyAdmin ?

~~~
jonseg
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.

~~~
jiggy2011
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?

~~~
jonseg
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/](http://silex.sensiolabs.org/))

Thank you.

~~~
jiggy2011
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.

------
ufmace
I haven't tried any of them personally, but I've seen several Ruby gems to
easily add full admin/crud interfaces to a Rails app. Sounds like it might be
about as easy to create a quick Rails app, point it at the database, and get
one of these admin gems up and running.

[https://www.ruby-
toolbox.com/categories/rails_admin_interfac...](https://www.ruby-
toolbox.com/categories/rails_admin_interfaces)

------
zerolinesofcode
Also have a look at Spring Roo and roostrap if you're planning to do with Java
and want to migrate your application to Google AppEngine or any other
database.

[http://bhagyas.github.io/roostrap/](http://bhagyas.github.io/roostrap/)

------
flip101
[http://www.phreeze.com/](http://www.phreeze.com/)

------
uberneo
download [http://www.sequelpro.com/](http://www.sequelpro.com/) and you are
sorted

------
ExpiredLink
Not one example on the front page.

------
SmokyBorbon
The first screenshot is of PhpMyAdmin. That's embarrassing.

