diff --git a/bin/rol-skel b/bin/rol-skel
new file mode 100644
index 0000000..250a051
--- /dev/null
+++ b/bin/rol-skel
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+NAME="$1"
+
+mkdir -p "$NAME"
+cd "$NAME"
+DIR="$PWD"
+
+cd "$(dirname "$0")/../../rol"
+ROL_DIR="$PWD"
+
+VARS=""
+VARS="$VARS -e s/@{NAME}/$NAME/g"
+VARS="$VARS -e s/@{ROL_DIR}/$ROL_DIR/g"
+
+cd "$(dirname "$0")/../skel"
+find | while read SKEL; do
+ if [ -d "$SKEL" ]; then
+ echo "D $SKEL"
+ mkdir "$DIR/$SKEL"
+ elif [ -f "$SKEL" ]; then
+ echo "F $SKEL"
+ sed $VARS
diff --git a/skel/Makefile b/skel/Makefile
new file mode 100644
index 0000000..1e90e23
--- /dev/null
+++ b/skel/Makefile
@@ -0,0 +1,14 @@
+## Makefile for @{NAME}
+## Usage: make (|build|clean|install|load|targets)
+
+APP = @{NAME}
+
+## Production settings, override in config/local.mk
+
+MEM = 512
+APP_USER = @{NAME}
+APP_GROUP = @{NAME}
+WEB_USER = @{NAME}
+WEB_GROUP = _nginx
+
+include lib/rol/server/app.mk
diff --git a/skel/config/app.lisp b/skel/config/app.lisp
index 657e8b4..3ba1c6b 100644
--- a/skel/config/app.lisp
+++ b/skel/config/app.lisp
@@ -1,17 +1,41 @@
-(setf *port* 4207)
(setf *layout* :main)
+(setf *port* 4207)
(setf *session-timeout* (* 3600 24 7))
-(setf facts:*db-path* #P"data/@{NAME}")
+(setf *smtp-server* "smtp.kmx.io")
+(setf *smtp-user* "noreply@kmx.io")
+(setf *smtp-password* "V7IwjWwLHOjRqemc")
+(setf facts:*db-path* #P"data/mentats")
(define-template-var title
- "@{NAME}")
+ "Mentats")
+
+(define-template-var nav
+ '("<li><a href=\"/competence\">Compétences</a></li>"
+ "<li><a href=\"/blog\">Blog</a></li>"))
+
+(define-template-var nav-right
+ '())
+
+(define-template-var classroom nil)
+(define-template-var token nil)
+
+(require :re)
+(use-package :re)
+
+(require :can)
+(require :gravatar)
+(require :rw-ut)
+
+(cl-json:set-decoder-simple-clos-semantics)
(defun setup-environment (env)
(log-msg :INFO "setup environment ~A" (string-downcase env))
+ (can:compile-rules)
(case env
((:development)
#+swank
(setf (debug-p :conditions) t)
+ (setf (debug-p :reply) t)
(setf (debug-p :app) t)
(setf (debug-p :assets) t)))
(log-msg :DEBUG "tags:~{ ~A~}" cl-debug::*debug*))
diff --git a/skel/config/assets.lisp b/skel/config/assets.lisp
new file mode 100644
index 0000000..41abc34
--- /dev/null
+++ b/skel/config/assets.lisp
@@ -0,0 +1,3 @@
+;; Define additional precompiled assets here
+;(precompiled-asset "joint.js")
+;(precompiled-asset "joint.css")
diff --git a/skel/config/routes.lisp b/skel/config/routes.lisp
new file mode 100644
index 0000000..7b1e730
--- /dev/null
+++ b/skel/config/routes.lisp
@@ -0,0 +1,68 @@
+;; Routes for mentats
+;;
+;; Each route binds a uri template to a controller form.
+
+(clear-routes)
+
+(define-route "/>" `(/>))
+(define-route "/>/{command}" `(/> ,command))
+(define-assets-route "/assets{/name}{.digest,ext}" "public/assets{/name}{.digest,ext}")
+
+(define-route "/account/register" '(/account/register))
+(define-route "/account/register/ok" '(/account/register/ok))
+(define-route "/account/login" '(/account/login))
+(define-route "/account/logout" '(/account/logout))
+(define-route "/account/reset-password" '(/account/reset-password))
+(define-route "/account/reset-password/{token}" `(/account/reset-password ,token))
+
+(define-route "/user/{login}" `(/user ,login))
+(define-route "/j/user/{login}" `(/user ,login "json"))
+(define-route "/user/update-email/{token}" `(/user/update-email ,token))
+
+(define-route "/module" `(/module))
+(define-route "/module/{module}" `(/module ,module))
+(define-route "/module/{module}/{action}" `(/module ,module ,action))
+(define-route "/module/{module}/{action}/{arg}" `(/module ,module ,action ,arg))
+(define-route "/j/module" `(/module))
+(define-route "/j/module/{module}" `(/module ,module "json"))
+(define-route "/j/module/{module}/{action}" `(/module ,module ,action))
+
+(define-route "/domaine/{domain}" `(/domain ,domain))
+(define-route "/domaine/{domain}/{action}" `(/domain ,domain ,action))
+(define-route "/j/domaine" `(/domain))
+(define-route "/j/domaine/{domain}" `(/domain ,domain "json"))
+(define-route "/j/domaine/{domain}/{action}" `(/domain ,domain ,action))
+
+(define-route "/competence" `(/competence))
+(define-route "/competence/{competence}" `(/competence ,competence))
+(define-route "/j/competence" `(/competence))
+(define-route "/j/competence/{competence}" `(/competence ,competence "json"))
+
+(define-route "/resource" `(/resource))
+(define-route "/resource/{resource}" `(/resource ,resource))
+(define-route "/j/resource" `(/resource))
+(define-route "/j/resource/{resource}" `(/resource ,resource "json"))
+
+(define-route "/classroom" `(/classroom))
+(define-route "/classroom/{classroom}" `(/classroom ,classroom))
+(define-route "/classroom/{classroom}/edit" `(/classroom ,classroom :edit))
+(define-route "/classroom/{classroom}/student" `(/classroom/student ,classroom))
+(define-route "/classroom/{classroom}/{module}" `(/classroom ,classroom))
+(define-route "/classroom/{classroom}/{module}/{domain}" `(/classroom ,classroom))
+(define-route "/classroom/{classroom}/{module}/{domain}/{student}" `(/classroom ,classroom))
+
+(define-route "/j/classroom" `(/classroom))
+(define-route "/j/classroom/{classroom}" `(/classroom ,classroom "json"))
+
+(define-route "/student" `(/student))
+(define-route "/student/{id}" `(/student ,id))
+(define-route "/student/{id}/{action}" `(/student ,id ,action))
+(define-route "/j/student/{id}" `(/student ,id :json))
+
+(define-route "/favicon.ico" (find-route "/assets/favicon.ico"))
+
+(define-route "/pemf" `(/file "public/pemf/"))
+(define-route "/pemf{/dir*}" `(/file "public/pemf/" ,dir))
+
+(define-route "/" `(/wiki "index"))
+(define-route "{/slug}" `(/wiki ,slug))
diff --git a/skel/lib/rol b/skel/lib/rol
new file mode 120000
index 0000000..b51dadf
--- /dev/null
+++ b/skel/lib/rol
@@ -0,0 +1 @@
+@{ROL_PATH}
\ No newline at end of file
diff --git a/skel/load.lisp b/skel/load.lisp
index 1b6dec3..752d5ca 100644
--- a/skel/load.lisp
+++ b/skel/load.lisp
@@ -2,4 +2,4 @@
;;
;; Set compilation options here
-(load #P"lib/rol/server/load/fastcgi")
+(load #P"lib/rol/server/load/thot")