jakelowen / typescript-graphql-boilerplate-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inspired by Ben Awad's https://github.com/benawad/graphql-ts-server-boilerplate

Difference's from Awad's version

  • Uses knex and objectionjs instead of typeorm.
  • DB schema types exported by schemats
  • Uses JWT tokens instead of cookies. I found tokens much easier to validate when came to securing the websocket / subscriptions connections. JWT tokens are versioned to automatically invalidate "stale" tokens.
  • Tests use apollo client directly instead of fetch. This allows for tests of authenticated subscriptions via websocket connections.

Enhancements

  • 8/8/18 - added robust team permissions system. Permissions table defines possible permissions that might exist ("ADMIN", "SENDMESSAGES", etc). Team admins can grant or remove any allowed permission to any user via mutations. A Team's users and a user's teams can be queried. When non-team admins query for team users, the user email addresses are obfuscated.
  • 8/9/18 - heroku deploy ready

To deploy on heroku

Create an app: heroku create Provision redis: heroku addons:create heroku-redis:hobby-dev Privision postgres: heroku addons:create heroku-postgresql:hobby-dev Deploy: git push heroku master Migrate Database: heroku run knex migrate:latest --knexfile dist/knexfile.js

About


Languages

Language:TypeScript 99.6%Language:JavaScript 0.2%Language:Dockerfile 0.2%