smaccoun / beam-servant

Batteries included haskell-beam-servant template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CircleCI

Features

  • Typesafe SQL with Beam
  • Password encryption with scrypt
  • Protected and Unprotected Endpoints with Servant
  • Pagination
  • Automated CRUD utilities
  • Automatic API generation with Servant Swagger and Swagger UI

This is also the Haskell Back-End for Create-Haskstar-App

Table Of Contents

Below is a list of useful features for building out CRUD apps

Conventions

Pagination

Queries expected to return more than one result should generally be paginated. You can see an example of returning a pagianted result with Database.Crud.getEntities A PaginatedResult looks like:

{
  "pagination": {
    "nextPage": null,
    "currentPage": 0,
    "count": 1,
    "perPage": 10,
    "previousPage": null,
    "totalPages": 1
  },
  "data": [
    {
      "baseEntity": {
        "content": "### Here's some content",
        "title": "My First Post"
      },
      "meta": {
        "createdAt": "2018-05-29T21:08:19.463033Z",
        "id": "4bfdc901-302f-4276-89e0-e0c27c87cb1c",
        "updatedAt": "2018-05-29T21:08:34.150376Z"
      }
    }
  ]
}

Resource

Writeup coming soon. For now see

Api.Resource Database.CRUD

CRUD

Writeup coming soon. For now see

Database.CRUD

About

Batteries included haskell-beam-servant template

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Haskell 98.8%Language:Shell 1.2%