Real Time server using Graphql subscriptions to manage scrum poker games.
- Nest.js
- GraphQL (code first approach)
- Redis
- Typescript
💡 If you want to use Redis and Docker Image.
You can also creategraphql-subscription
PubSub instance instead
- Docker: Link
💡 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.
$ yarn
# 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 🙏
# unit tests
$ yarn test
# e2e tests
$ yarn test:e2e
# test coverage
$ yarn test:cov
This project contain workflows set to my personnal usage. Don't hesitate change by your own config
- 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
- pre-commit:
- 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
- config cz-emojis
- GitHub actions:
- Pull requests on dev and master branches:
- check code linting
- build the project
- Pull requests on dev and master branches: