All Projects → dandoh → web-haskell-graphql-postgres-boilerplate

dandoh / web-haskell-graphql-postgres-boilerplate

Licence: MIT License
Modern webserver in Haskell: Graphql + Postgresql + Authentication + DB migration + Dotenv and more

Programming Languages

haskell
3896 projects
PLpgSQL
1095 projects
HTML
75241 projects
shell
77523 projects
Dockerfile
14818 projects
Makefile
30231 projects

Projects that are alternatives of or similar to web-haskell-graphql-postgres-boilerplate

Agoo
A High Performance HTTP Server for Ruby
Stars: ✭ 679 (+495.61%)
Mutual labels:  webserver, graphql-server
server
Core server in the Alkemio platform, offering a GraphQL api for interacting with the logical domain model.
Stars: ✭ 20 (-82.46%)
Mutual labels:  graphql-server, graphql-api
pern-stack-auth
📋 Repair. PERN stack todo app with jwt user authentication
Stars: ✭ 17 (-85.09%)
Mutual labels:  stack, jwt-authentication
36 Graphql Concepts
📜 36 concepts every GraphQL developer should know.
Stars: ✭ 209 (+83.33%)
Mutual labels:  graphql-server, graphql-api
rust-web-boilerplate
An implementation of a simple web server using Rust
Stars: ✭ 36 (-68.42%)
Mutual labels:  webserver, webserver-setup
Graphqlize
A Clojure & JVM library for developing GraphQL API instantly from Postgres and MySQL databases
Stars: ✭ 240 (+110.53%)
Mutual labels:  graphql-server, graphql-api
DotNetGraphQL
A sample demonstrating how to create a GraphQL Backend in .NET and consume it from a .NET mobile app created using Xamarin
Stars: ✭ 78 (-31.58%)
Mutual labels:  graphql-server, graphql-api
Gqlify
[NOT MAINTAINED]An API integration framework using GraphQL
Stars: ✭ 182 (+59.65%)
Mutual labels:  graphql-server, graphql-api
graphql-express-nodejs
A Simple GraphQL Server implementation using Express and Node. See post here: https://t.co/Cm6GitZaBL
Stars: ✭ 24 (-78.95%)
Mutual labels:  graphql-server, graphql-api
finch-graphql
Local GraphQL API in the background process of a web extension.
Stars: ✭ 48 (-57.89%)
Mutual labels:  graphql-server, graphql-api
Rails Devise Graphql
A Rails 6 boilerplate to create your next Saas product. Preloaded with graphQL, devise, JWT, CanCanCan, RailsAdmin, Rubocop, Rspec, i18n and more.
Stars: ✭ 199 (+74.56%)
Mutual labels:  graphql-server, graphql-api
Gitzilla
A resume builder for your GitHub profile.
Stars: ✭ 60 (-47.37%)
Mutual labels:  graphql-server, graphql-api
Grial
A Node.js framework for creating GraphQL API servers easily and without a lot of boilerplate.
Stars: ✭ 194 (+70.18%)
Mutual labels:  graphql-server, graphql-api
Flask Restplus Boilerplate
A boilerplate for flask restful web service
Stars: ✭ 466 (+308.77%)
Mutual labels:  migration, jwt-authentication
Graphql Spqr Spring Boot Starter
Spring Boot 2 starter powered by GraphQL SPQR
Stars: ✭ 187 (+64.04%)
Mutual labels:  graphql-server, graphql-api
Rayo.js
Micro framework for Node.js
Stars: ✭ 170 (+49.12%)
Mutual labels:  stack, webserver
Storefront Api
Storefront GraphQL API Gateway. Modular architecture. ElasticSearch included. Works great with Magento1, Magento2, Spree, OpenCart, Pimcore and custom backends
Stars: ✭ 180 (+57.89%)
Mutual labels:  graphql-server, graphql-api
Graphql2rest
GraphQL to REST converter: automatically generate a RESTful API from your existing GraphQL API
Stars: ✭ 181 (+58.77%)
Mutual labels:  graphql-server, graphql-api
kanji
A strongly typed GraphQL API framework
Stars: ✭ 12 (-89.47%)
Mutual labels:  graphql-server, graphql-api
ngraphql
GraphQL .NET Server and Client
Stars: ✭ 26 (-77.19%)
Mutual labels:  graphql-server, graphql-api

Modern Haskell Webserver Boilerplate

  • Graphql API
      type User {
          id: Int!
          email: String!
          name: String!
          updatedAt: String!
          createdAt: String!
      }
    
      type Session {
          token: String!
          user: User!
      }
    
      type Query {
          login(email: String!, password: String!): Session!
          myUserInfo: User!
      }
    
      type Mutation {
          register(email: String!, password: String!, name: String!): Session!
          changePassword(oldPassword: String!, newPassword: String!): Boolean!
      }
  • Database:

This boilerplate wires up:

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

Running

  • Feed in you database & secret in .env:
    $ cp .env.default .env
    
    DATABASE_URL="postgres://Dandoh:[email protected]:5432/webhaskell?sslmode=disable"
    JWT_SECRET="my_jwt_secret"
  • Migrations
    $ dbmate up
    
  • Run webserver
    $ stack run
    

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].