lj-ditrapani / ultimate-tic-tac-toe-node

Ultimate Tic-tac-toe client/server on node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ultimate Tic-tac-toe

LAN multiplayer Ultimate tic-tac-toe client/server in typescript on node.

Game Rules

Docker

sh docker-build.sh
sh docker-run-server.sh
host=localhost sh docker-run-client.sh

UI Controls

On your turn:

  • Arrow keys to move around.
  • Enter to select.

Develop

Setup

Install node with nvm.

nvm install     # one-time install
nvm use         # each time you enter the project directory

Install npm packages.

npm install

Config

The server does not need config, but the client does. You need to set the host environment variable to the host name or ip address of the server. You can use the .env dotenv file to set it.

Run

npm run server
npm run client

Run during dev

While developing, you can skip building by using tsnode. You still need to setup your config as described above.

npm run server-dev
npm run client-dev

Format, lint, build, test

npm run all

Test coverage

# Run the tests with `npm run all` or
npm test
# This will generate the test coverage report
# Then open the test coverage report
firefox coverage/lcov-report/index.html

Manual Live Server Test

Run a manual live server test that simulates a complete game. First start the server.

npm run server-dev

Now run the test script.

npm run live-server-test

Generate documentation

npm run doc
firefox docs/index.html &

Update dependencies

npm run ncu

About

Ultimate Tic-tac-toe client/server on node


Languages

Language:TypeScript 97.7%Language:Dockerfile 1.6%Language:Shell 0.7%