Given a JSON description of some database tables, the scaffolder tool creates the database and generates a web application server to manage it. The resulting app server implements the Create, Read, Update and Delete (CRUD) operations on the tables.
The idea for the scaffolder comes from the Ruby-on-Rails scaffold generator. The app server is presented as Go source code and HTML templates, plus some unit and integration tests. The design follows the Model, View Controller (MVC) pattern. The HTTP requests follow the REST pattern. The tool is here: https://github.com/goblimey/scaffolder There are some screen shots of the resulting web pages here: http://www.goblimey.com/scaffolder/2.4.running.the.server.html Producing any web application involves a lot of boilerplate work, and this tool aims to automate some of that without imposing too many design decisions on the result. The generated web pages are fairly primitive, with very little styling. This is deliberate - if you want to use the result as a basis for building your own application, you will want to define your own styling, and the pages are structured to allow that. The material produced by the scaffolder is defined by a set of text templates. For each table it produces from these templates a model, a controller and set of HTML templates to produce the views. (So we have templates producing templates.) The scaffolder tool itself is very simple. It just reads the JSON specification into a data structure, enhances that data a little and then iterates through it, supplying it to the templates. This approach makes the tool very flexible - if it doesn't do quite what you want, it's very easy to tweak it. This idea of using a simple driver program, JSON data and templates to generate a result is very powerful. It can be used to produce all sorts of material that follows a prototypical pattern. All comment on this project are welcome. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.