You need the stack servant tool that can be downloaded like this in Unix systems:
curl -sSL https://get.haskellstack.org/ | shFor further instructions about Stack please go to https://docs.haskellstack.org/en/stable/README/
This is a very minimal example of a project that uses
servantto specify a REST API,servant-serverto implement a server,hspecandservant-clientfor the test-suite.persistentfor database management.servant-authandservant-auth-serverfor JWT authentication.
To set up the project and run the test-suite, do:
stack setup
stack test --fastto reload the code (after making changes) and run the tests again.
To run the app, do:
stack build
stack exec servant-persistent-templateI tried to create a Clean architecture, complete domain testing and split commands/queries to make it easy to extend in the future.