yesod-crud alternatives and similar packages
Based on the "yesod" category.
Alternatively, view yesod-crud alternatives based on common mentions on social networks and blogs.
-
yesod-persistent
A RESTful Haskell web framework built on WAI. -
yesod-fay
Utilities for using the Fay Haskell-to-JS compiler with Yesod. -
yesod-dsl
A domain specific language and a code generator desined to create RESTful services for managing an RDBMS with Yesod web framework and Persistent. -
yesod-auth-hashdb
Yesod.Auth.HashDB plugin, now moved out of main yesod-auth package -
yesod-routes-typescript
generate TypeScript routes for Yesod -
yesod-content-pdf
Library for serving PDF content from a Yesod Application -
yesod-recaptcha
Dead simple support for reCAPTCHA on Yesod applications. -
yesod-worker
Drop-in(ish) background worker system for Yesod applications -
yesod-form-bootstrap4
yesod-form for bootstrap version 4 -
yesod-raml
Generate Yesod framework route definitions, documentaiton, mock-handler, and more from your RAML spec. -
yesod-transloadit
A resuable widget for the Transloadit service & Yesod -
yesod-crud-persist
Easy CRUD subsites for yesod with persistent -
yesod-auth-account-fork
Fork of yesod-auth-account with a few additions -
yesod-auth-smbclient
Authentication plugin for Yesod using smbclient -
yesod-auth-bcrypt
BCrypt salted and hashed passwords in a database as auth for yesod -
yesod-datatables
Routines for implementing server-side processing for DataTables (jQuery grid) in Haskell -
yesod-test-json
Utility functions for testing JSON web services written in Yesod -
yesod-auth-hmac-keccak
An account authentication plugin for yesod with encrypted token transfer. -
yesod-auth-ldap-native
Yesod LDAP authentication plugin using native Haskell Ldap.Client -
yesod-auth-zendesk
Zendesk remote authentication support for Yesod apps. -
yesod-auth-deskcom
Desk.com Multipass support for Yesod apps. -
yesod-pnotify
yet another getMessage/setMessage using pnotify jquery plugins -
yesod-paypal-rest
Yesod plugin to use PayPal with the paypal-rest-client library. -
yesod-articles
Automatically generate article previews for a yesod site -
yesod-examples
Example programs using the Yesod Web Framework. (deprecated)
WorkOS - The modern identity platform for B2B SaaS
Do you think we are missing an alternative of yesod-crud or a related project?
README
yesod-crud
This package helps you build administrative CRUD operations (Create, Retrieve,
Update, Delete) into your web site, as Yesod subsites. There is a demo site in
the example
directory in the distribution.
[Screenshot from the example CRUD subsite](example/crud-example-users.png)
To begin, add subsites to your routes
file, like these:
/users UserCrudR CrudSubsite-UserCrud mkUserCrud
/pubs/#UserId PubCrudR CrudSubsite-PubCrud mkPubCrud
Now, in your Foundation module, you must define the subsite foundation types and functions. Here we have one foundation type that is nullary, and another that carries a piece of data.
data UserCrud = UserCrud
mkUserCrud :: a -> CrudSubsite UserCrud
mkUserCrud _ = CrudSubsite UserCrud
data PubCrud = PubCrud UserId
mkPubCrud :: a -> UserId -> CrudSubsite PubCrud
mkPubCrud _ = CrudSubsite . PubCrud
Next, define the type families on which these will operate. The simplest case
is that ObjId
is a Persistent database Key
and Obj
is one of your model
types, but yesod-crud supports other types and non-Persistent databases too.
instance CrudTypes UserCrud where
type Site UserCrud = App
type ObjId UserCrud = UserId
type Obj UserCrud = User
instance CrudTypes PubCrud where
type Site PubCrud = App
type ObjId PubCrud = PublicationId
type Obj PubCrud = Publication
The above generally must go within the Foundation.hs
of a scaffolded site,
because it relies on the App
type, and is in turn used in the routes file.
The remaining CRUD operations can be defined elsewhere and then imported into
Application.hs
for the dispatcher to access.
instance RenderMessage (CrudSubsite UserCrud) CrudMessage where
renderMessage _ _ CrudMsgEntity = "User"
renderMessage _ _ CrudMsgEntities = "Users"
renderMessage _ _ m = defaultCrudMessage m
instance Crud UserCrud where
crudDB = return crudPersistDefaults
crudShow = return . userIdent
crudEq u v = return $ u == v
crudMakeForm uOpt =
return $ renderDivs $ User
<$> areq textField "User name" (userIdent <$> uOpt)
<*> aopt passwordField "Password" (userPassword <$> uOpt)
The minimal definition above will provide pages to list users, add a new user, update existing users, and delete users (with a confirmation step). Various aspects of the look and functionality can be overridden, and the CRUD widgets can be mixed and matched on other pages too.
Comments and critiques are welcome. Please use the Issues feature at https://github.com/league/yesod-crud