servant-effectful-template

A work in progress Nix starting template for web projects utilizing

The repository has a simple CRUD implementation of a "Users" API which demonstrates how to use included effects, create your own effects, write/compose HTML using Lucid, and bubble errors to Servant's ServerError type.

How to navigate this codebase (as of revision 77131c4a):

  • Core
    • Application data types
    • Effect definitions
    • Utility function for lifting IO to effectful's IOE
  • Database
    • Database effect handler
    • Table definitons as functions
    • Helper functions for constructing SQL queries
  • Handlers
    • Request handlers in the Eff monad
  • Logger
    • Logging implementation using the Database effect for logging to PSQL
    • Logging implementation to stdout
  • Main
    • Application entry point and initialization
    • Creates a PostgreSQL connection pool to include in the Reader effect
    • Effect stack runner for real database interactions
    • Debugging effect stack that mocks database interactions and logs to stdout instead
  • Routes
    • Type level route definitions for Servant
  • Views
    • Lucid2 HTML templating and composition functions
Description
HELPS stack template
Readme
Languages
Haskell 89.3%
Nix 10.7%