Skip to content

dandoh/web-haskell-graphql-postgres-boilerplate

Repository files navigation

Modern Haskell Webserver Boilerplate

This boilerplate wires up:

  • Reading .env using envy
  • Database
  • Graphql API
  • Authorization using JWT
  • Monad transformers

Running

Now GraphQL API is at http://localhost:8080/api

You can also access Graphql Playground at http://localhost:8080/graphiql

Playground

Running on Docker

  • Feed in you database & secret in .env:

    $ cp .env.default .env
    
  • (Optional) Edit anything you need in the .env file

  • Create and start docker containers

    $ docker-compose up
    
  • Now you can visit: http://localhost:8080/ in your local machine.

  • Migrations will automatically run, and you can run them manually anytime using

    $ docker-compose up dbmate
    
  • Stack will restart whenever you change any .hs file, thanks to entr

Contributors

PR are more than welcome. The only note is we use ormolu to format codes.