Code for reverse-engineering a MySQL schema
PHP Other
Switch branches/tags
Nothing to show
Latest commit a5acb70 Jan 13, 2015
Failed to load latest commit information.
src re-work templated api.php Jan 13, 2015
.gitignore add .htaccess Feb 26, 2014 update README Dec 13, 2014
generate.php finish new row_to_assoc() in models Dec 7, 2014

PHP-MySQL Model Generator

This script is designed to fast-track the development of small, well-defined web applications. An application name and MySQL database schema are the only inputs:

    ./generate.php foobar < foobar-schema.sql

An SQL parser will interpret the schema, and generate a series of PHP models and controllers. These files are all generated with Doxygen-ready comments. The resulting object-oriented code includes data type awareness and referential integrity checking. It uses smart greedy fetching to retrieve parent rows, and generates models which can be filtered to remove sensitive fields for output. This fetching is diagrammed with Graphviz, just run "make" in the doc/ folder of your generated project.

You can this project to generate most of the server-side code. You will still need to write your own user-authentication (see lib/Util/Session.php) and permissions (see site/permissions.php) as needed. The client side of the app should simply be a HTML file, which can be set up to retrieve data from api.php, using the Backbone.js framework.

External Libraries

The client-side code uses the following libraries: