Skip to content

App built with Nest.js using GraphQL subscriptions to run real time scrum poker party

Notifications You must be signed in to change notification settings

MatthiasWanner/nest_gql-scrum_poker_server

Repository files navigation

Scrum Poker Server

Description

Real Time server using Graphql subscriptions to manage scrum poker games.

Features

  • Nest.js
  • GraphQL (code first approach)
  • Redis
  • Typescript

Prerequisites

💡 If you want to use Redis and Docker Image.
You can also create graphql-subscription PubSub instance instead

Environment variables

💡 Default port is 9000 if you don't provide PORT variable

PORT=9000
REDIS_PORT=6379
REDIS_HOST=localhost
REDIS_PASSWORD=password
CACHE_TTL=3600
MAX_ITEM_IN_CACHE=1000
JWT_SECRET=<JWT_sign_secret>
# JWT_EXPIRES_IN in string format 1h | 7d | 10h, etc
JWT_EXPIRES_IN=1h
CORS_ORIGIN=http://localhost:3000

Paste this content in a .env file previously created or run cp .env.example .env in your terminal since the project folder.

Installation

$ yarn

Running the app

# development
$ yarn start

# watch mode
$ yarn start:dev

# production mode
$ yarn start:prod

# debug mode
$ yarn start:debug

🚀 By default, run http://localhost:9000/graphql to launch the playground.

Another playground working with new graphql-ws is avaible at http://localhost:9000/graphql/subscriptions
Original html code: https://gist.github.com/enisdenjo/a68312878fdc4df299cb0433c60c1dea#file-graphiql-over-ws-html)
Thanks to @enisdenjo for this great work 🙏

Test

# unit tests
$ yarn test

# e2e tests
$ yarn test:e2e

# test coverage
$ yarn test:cov

Dev environment

This project contain workflows set to my personnal usage. Don't hesitate change by your own config

⚙️ Tools list:

  • ESLint / Prettier (base Nest config)
  • Husky hooks:
    • pre-commit:
      • can't commit on dev or master branch
      • format with prettier
      • check code linting with eslint
    • pre-push:
      • build project before push work
    • prepare-commit-msg:
      • run commitizen cli to write commits
  • commitizen:
    • config cz-emojis

      💡 You have not to launch git cz to run commitizen cli. A Git hook is intalled on git commit cmd. In this way, you can change the message at the end of the process with vim

  • GitHub actions:
    • Pull requests on dev and master branches:
      • check code linting
      • build the project

About

App built with Nest.js using GraphQL subscriptions to run real time scrum poker party

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published