Yesod web framework/Model

Using in-memory mutable data (in the foundation datatype)
E.g. a visitor count. See ref.

The Database layer

 * persistent is the name of the database access layer with templates for generating types for entities and keys as well as schema initialization.

There is first class support for PostgreSQL, SQLite, MongoDB, CouchDB and MySQL, with experimental support for Redis.

The Database layout is described in a template listing the entities, fields and constraints.


 * For every entity listed, an integer key column "id" is generated with autoincrement and primary index attributes, with a type alias appending Id to the entity name
 * For every entity listed, a record type named as the entity is generated were record fields names are composed prefixing the entity name to the field name like "personName". An EntityField type "PersonName" is also generated for foreign key referencing from other entities.
 * There is an automatic database schema migration mechanism for DB schema updates, which, to succeed, requires, when adding columns to existent tables, to specify Default-column-value constraints with sql level notation.
 * "At most one" cardinality has a special mechanism around the type Checkmark.
 * Weak entities (childs in life constrained owner-child relationships) have no special support for cascade delete triggers, but there are functions to deleteCascade manually in the Database.Persist.Class module.


 * automatic table creation, schema update and table migration: Modifications of the entities template produces an schema update with automatic table creation, and migration for the DBMS's that support "ALTER TABLE" SQL commands in a migrateAll procedure, generated from the template content. See "Migrations" in ref. to look for migration aware DBMS.


 * Esqueleto: is a haskell combinators layer to generate correct relational queries to persistent.

Example for persistent rawSQL and Esqueleto queries.

E-mail
The following packages are part of the yesod-platform:
 * email-validate: Validating an email address.
 * mime-mail: Compose and send MIME email messages.

Facebook

 * Useful glue functions between the fb library and Yesod.

Development cycle
New Yesod apps are generated from the HaskellStack tool templates, replacing previous command "yesod init"

Stack based app. template names are prefixed by yesod as "yesod-{minimal | postgres | sqlite | mysql | mongo | ...}"


 * Since HaskellStack uses the stackage repo by default, extra packages from the hackage repo should be referred in the "stack.yaml" extra-deps section.
 * You may customize packages to a local subfolder. They must be referred in the "stack.yaml" packages section.

The "Yesod helper" tool

 * The yesod helper tool
 * run from the project site, recompiles and restarts the project at every file tree modification.
 * adds a new handler and module to the project, adding an import clause for the handler in the "Application" module.

Deploying with Keter: A web app server monitor and reverse proxy server
See refs.

Keter is a process as a service that handles deployment and restart of Yesod web app servers, and, per web app, database creation for PostgreSQL.

The console command  packs the web app. as a keter bundle for uploading to a keter folder named "incoming".

Keter monitors the "incoming" folder and unpacks the app. to a temporary one, then assigns the web app a port to listen to, and starts it.

Initially it worked with Nginx as reverse proxy (keter version 0.1*), adding virtual server entries to its configuration and making Nginx reload it, but now Keter itself provides its own reverse proxy functionality, removing Nginx dependency and acting as the main web server.

Old documentation (Nginx based).

Integration with JavaScript generated from functional languages
See ref.