README.md 2.08 KB
Newer Older
1 2
The Spicey Web Application Framework
====================================
3 4 5 6

To generate an application, follow the steps below.

1. Create a Curry program containing a constant of type `Database.ERD.ERD`
Michael Hanus 's avatar
Michael Hanus committed
7
   (the module `Database.ERD` is part of the package `cdbi`)
8 9 10
   which describes your entity-relationship model
   (see the file "examples/BlogERD.curry" as an example).

Michael Hanus 's avatar
Michael Hanus committed
11
2. Execute `spiceup` and supply the name of the Curry ERD program, e.g.,
12

Michael Hanus 's avatar
Michael Hanus committed
13
       spiceup .../BlogERD.curry
14 15

   This generates the complete source code of the initial application
Michael Hanus 's avatar
Michael Hanus committed
16
   as a Curry package
17 18 19 20 21
   (see the generated file README.txt for some explanations).

   You can also provide a file name for the SQLite3 database in which
   all data is stored, e.g.,

Michael Hanus 's avatar
Michael Hanus committed
22
       spiceup --db BlogData.db .../BlogERD.curry
23 24 25 26 27

   If the parameter "--db ..." is not provided, then the name of database
   file is "<ERD>.db" where <ERD> is the name of the specified ER model.
   Since this file name will be used in the _generated_ cgi programs,
   a relative file name will be relative to the place where
28 29 30 31 32
   the cgi programs are stored. In order to avoid confusion due to
   relative file names, it might be better to specify
   an absolute path name for the database file.
   This path could also be set in the definition of the constant
   `sqliteDBFile` in the generated Curry program `Model/<ERD>.curry`.
33

Michael Hanus 's avatar
Michael Hanus committed
34
3. Change into the generated directory containing all sources as a
Michael Hanus 's avatar
Michael Hanus committed
35
   Curry package, e.g., by `cd Blog`.
36

37 38
4. Define in the Makefile the variable WEBSERVERDIR (and possibly
   other variables, like SYSTEM or CURRYOPTIONS).
Michael Hanus 's avatar
Michael Hanus committed
39

40
5. Install all required packages by `make install`.
Michael Hanus 's avatar
Michael Hanus committed
41

42
6. Compile the generated programs by `make compile`.
43

44 45 46
7. Execute `make deploy` to deploy the web application.

8. After the successful compilation, the application is executable
47
   in a web browser by loading `<URL of web dir>/spicey.cgi`.
48 49 50 51 52

Note that the database is generated with the `cdbi` package.
Hence, one can also use embedded SQL statements when further developing
the Curry code. The syntax and use of such embedded SQL statements
is described in the Curry preprocessor.