Skip to content

Repository files navigation

TicTacToe GraphQL + Typescript

Installation

$ npm install

Copy or rename the .env.sample to .env

Running the app

Start Redis in localhost:6379

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

And go to http://localhost:3000/graphql

1- Use GrahQL mutation 'createGame' to receive gameId and your token to play

2- If you've created a multiplayer game share the gameId with your partner

3- (Your partner) use the graphQL mutation joinToGame passing the gameId Now each of you have a token to identify and make moves in this game.

4- (Both player) must subcribe to 'watch' graphQL subscription to see the game

5- To make moves you have pass 'token' and any of the folling numbers as 'slotTarget' to 'makeMove' graphQL mutation.

1 | 2 | 3
4 | 5 | 6
7 | 8 | 9

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

License

Nest is MIT licensed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages