Spicey: An ER-based Web Framework for Curry


Spicey is a framework to support the implementation of web-based systems in the multi-paradigm declarative language Curry. Spicey generates an initial implementation from an entity-relationship (ER) description of the underlying data. The generated implementation contains operations to create and manipulate entities of the data model, supports authentication, authorization, session handling, and the composition of individual operations to user processes. Furthermore, the implementation ensures the consistency of the database w.r.t. the data dependencies specified in the ER model, i.e., updates initiated by the user cannot lead to an inconsistent state of the database.


As an example, we consider the implementation of a web log system with Spicey. A "blog" consists of "Entry" articles having title, text, author, and date as attributes, and "Comments" to each entry. Furthermore, there are a number of "Tags" to classify Entry articles. The complete entity-relationship model of this blog structure can be specified in Curry by a data term.

From this ER specification, Spicey generates the source code of a web-based system that provides access to the data via standard web browsers. For instance, here is a snapshot of the web interface generated by Spicey for the blog description:

Main view of Spicey

Spicey generates also forms to insert new entities or edit the attributes of existing ones. If an entity is related to other entities, the form allows the manipulation of these relations. For instance, each Entry of the blog can be related to multiple tags. Therefore, a form to edit an Entry also allows to select related tags, as shown below:

Edit form of Spicey

Beyond the basic CRUD (create/read/update/delete) functionality, a Spicey applications has also infrastructures for many features of web-based systems, like session management (storing of session data), authentication, authorization, or complex user processes. These aspects are described in the documents shown below.


There is no separate user manual for Spicey but there are documents where you can find more details about Spicey and its implementation.

An ER-based Framework for Declarative Web Programming (PADL 2010)
This conference paper introduces the basic ideas of Spicey and its implementation.
An ER-based Framework for Declarative Web Programming (TPLP 2012)
This is an expanded version of the previous paper. It provides some more details about Spicey and its implementation.
Master Thesis (in German)
This is a master thesis on Spicey, written by Sven Koschnicke. This thesis contains details about the design and implementation of Spicey.


The implementation of Spicey is freely available and part of the Curry implementations PAKCS and KiCS2. Hence, download one of these system (which also provides the infrastructure on which Spicey is based) and look into their manuals.

The default database system used by Spicey is SQLite3 so that it should be also installed, but this can be changed by configuring the generation of the database interface from ER descriptions (see the call to erd2curry in scaffolding/SpiceyScaffolding.curry).