This package present an alternative for the standard yesod init
. It was modified
to my taste and needs and as such might not be suitable for your taste or needs.
The application contains simple login system utilizing yesod-auth
.
I tried to avoid what other Yesod
based sites that I found (e.g. haskellers.com
) did with yesod-auth
, that is they
wrapped almost all User
(or similar type) fields in Maybe
so that they could circumvent the limitations of the yesod-auth
implementation of third party authetication services that make implementing registration feel unnatural.
I did it by having separate Identity
and Profile
tables. Ideal solution would have these two tables merged (even though having them separate might be advatageous in some cases).
Let me know if you know how to achieve that with yesod-auth
without resorting to Maybe
hacks.
-
src/Main.hs
This module contains the main function. This is analogous todevel.hs
+main.hs
of the originalyesod init
. -
src/Site.hs
This is analogous toApplication.hs
of the originalyesod init
. -
src/Site/Common.hs
This module contains some convenience functions and reexpors some widely used types and functions. -
src/Site/Core.hs
This module contains definition of the underlying data typeEnvironment
and instances of the following classes:Yesod
,YesodAuth
,YesodPersist
,RenderMessage
. This is analogous toFoundation.hs
of the originalyesod init
. -
src/Site/Settings.hs
This is analogous toSettings.hs
of the originalyesod init
. -
src/Site/Static.hs
This is analogous toSettings/Static.hs
of the originalyesod init
. -
src/Site/Model/Schema.hs
This module defines the schema of the database. This is analogous toModel.hs
+config/models
of the originalyesod init
. -
src/Site/Model/Type
This folder contains modules that reexport parts ofsrc/Site/Model/Schema.hs
for convenience. -
src/Site/Controller/Routes.hs
This module defines the routes of the application. This is analogous toconfig/routes
of the originalyesod init
. -
src/Site/Controller/Form
This folder contains modules that define various forms. -
src/Site/Controller/Handler
This folder contains modules taht define the site's handlers and some convenience modules (namelysrc/Site/Controller/Common.hs
).